<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[199072] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/199072">199072</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-04-05 14:27:05 -0700 (Tue, 05 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Modern IDB: Replace use of SerializedScriptValue with IDBValue.
https://bugs.webkit.org/show_bug.cgi?id=156242

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (No change in behavior).

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::putOrAddOnServer):

* Modules/indexeddb/IDBValue.cpp:
(WebCore::IDBValue::IDBValue):
(WebCore::IDBValue::isolatedCopy):
* Modules/indexeddb/IDBValue.h:
(WebCore::IDBValue::data):
(WebCore::IDBValue::encode):
(WebCore::IDBValue::decode):

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::putOrAdd):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::putOrAdd):
* Modules/indexeddb/server/IDBServer.h:

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::putOrAdd):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:

* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::putOrAdd):
* Modules/indexeddb/shared/InProcessIDBServer.h:

* WebCore.xcodeproj/project.pbxproj:

* platform/CrossThreadCopier.cpp:
(WebCore::IDBValue&gt;::copy):
* platform/CrossThreadCopier.h:

* platform/ThreadSafeDataBuffer.h:
(WebCore::ThreadSafeDataBuffer::encode):
(WebCore::ThreadSafeDataBuffer::decode):

Source/WebKit2:

* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::putOrAdd):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::putOrAdd):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactioncpp">trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBValuecpp">trunk/Source/WebCore/Modules/indexeddb/IDBValue.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBValueh">trunk/Source/WebCore/Modules/indexeddb/IDBValue.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerDelegateh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBServercpp">trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBServerh">trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactioncpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactionh">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServercpp">trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServerh">trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformCrossThreadCopiercpp">trunk/Source/WebCore/platform/CrossThreadCopier.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformCrossThreadCopierh">trunk/Source/WebCore/platform/CrossThreadCopier.h</a></li>
<li><a href="#trunkSourceWebCoreplatformThreadSafeDataBufferh">trunk/Source/WebCore/platform/ThreadSafeDataBuffer.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClientcpp">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClienth">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClientmessagesin">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServercpp">trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServerh">trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/ChangeLog        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -1,3 +1,55 @@
</span><ins>+2016-04-05  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Modern IDB: Replace use of SerializedScriptValue with IDBValue.
+        https://bugs.webkit.org/show_bug.cgi?id=156242
+
+        Reviewed by Alex Christensen.
+
+        No new tests (No change in behavior).
+
+        * Modules/indexeddb/IDBTransaction.cpp:
+        (WebCore::IDBTransaction::putOrAddOnServer):
+
+        * Modules/indexeddb/IDBValue.cpp:
+        (WebCore::IDBValue::IDBValue):
+        (WebCore::IDBValue::isolatedCopy):
+        * Modules/indexeddb/IDBValue.h:
+        (WebCore::IDBValue::data):
+        (WebCore::IDBValue::encode):
+        (WebCore::IDBValue::decode):
+
+        * Modules/indexeddb/client/IDBConnectionToServer.cpp:
+        (WebCore::IDBClient::IDBConnectionToServer::putOrAdd):
+        * Modules/indexeddb/client/IDBConnectionToServer.h:
+        * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
+
+        * Modules/indexeddb/server/IDBServer.cpp:
+        (WebCore::IDBServer::IDBServer::putOrAdd):
+        * Modules/indexeddb/server/IDBServer.h:
+
+        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
+        (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
+        * Modules/indexeddb/server/UniqueIDBDatabase.h:
+
+        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::putOrAdd):
+        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
+
+        * Modules/indexeddb/shared/InProcessIDBServer.cpp:
+        (WebCore::InProcessIDBServer::putOrAdd):
+        * Modules/indexeddb/shared/InProcessIDBServer.h:
+
+        * WebCore.xcodeproj/project.pbxproj:
+
+        * platform/CrossThreadCopier.cpp:
+        (WebCore::IDBValue&gt;::copy):
+        * platform/CrossThreadCopier.h:
+
+        * platform/ThreadSafeDataBuffer.h:
+        (WebCore::ThreadSafeDataBuffer::encode):
+        (WebCore::ThreadSafeDataBuffer::decode):
+
</ins><span class="cx"> 2016-04-05  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Avoid context save/restore in GraphicsContext::drawNativeImage 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include &quot;IDBOpenDBRequest.h&quot;
</span><span class="cx"> #include &quot;IDBRequest.h&quot;
</span><span class="cx"> #include &quot;IDBResultData.h&quot;
</span><ins>+#include &quot;IDBValue.h&quot;
</ins><span class="cx"> #include &quot;JSDOMWindowBase.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;ScriptExecutionContext.h&quot;
</span><span class="lines">@@ -869,6 +870,11 @@
</span><span class="cx">     ASSERT(!isReadOnly());
</span><span class="cx">     ASSERT(value);
</span><span class="cx"> 
</span><ins>+    if (!value-&gt;hasBlobURLs()) {
+        serverConnection().putOrAdd(operation, key.get(), *value, overwriteMode);
+        return;
+    }
+
</ins><span class="cx">     RefPtr&lt;IDBTransaction&gt; protector(this);
</span><span class="cx">     RefPtr&lt;IDBClient::TransactionOperation&gt; operationRef(&amp;operation);
</span><span class="cx">     value-&gt;writeBlobsToDiskForIndexedDB([protector, this, operationRef, key, value, overwriteMode](const IDBValue&amp;) {
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBValue.cpp (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBValue.cpp        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBValue.cpp        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -28,12 +28,26 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><ins>+#include &quot;SerializedScriptValue.h&quot;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> IDBValue::IDBValue()
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IDBValue::IDBValue(const SerializedScriptValue&amp; scriptValue)
+    : m_data(ThreadSafeDataBuffer::copyVector(scriptValue.data()))
+{
+}
+
+IDBValue IDBValue::isolatedCopy() const
+{
+    IDBValue result;
+    result.m_data = m_data;
+    return result;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBValue.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBValue.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBValue.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -26,13 +26,44 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><ins>+#include &quot;ThreadSafeDataBuffer.h&quot;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class SerializedScriptValue;
+
</ins><span class="cx"> class IDBValue {
</span><span class="cx"> public:
</span><del>-    IDBValue();
</del><ins>+    WEBCORE_EXPORT IDBValue();
+    IDBValue(const SerializedScriptValue&amp;);
+
+    IDBValue isolatedCopy() const;
+
+    const ThreadSafeDataBuffer&amp; data() const { return m_data; }
+
+    template&lt;class Encoder&gt; void encode(Encoder&amp;) const;
+    template&lt;class Decoder&gt; static bool decode(Decoder&amp;, IDBValue&amp;);
+
+private:
+    ThreadSafeDataBuffer m_data;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><ins>+
+template&lt;class Encoder&gt;
+void IDBValue::encode(Encoder&amp; encoder) const
+{
+    encoder &lt;&lt; m_data;
+}
+
+template&lt;class Decoder&gt;
+bool IDBValue::decode(Decoder&amp; decoder, IDBValue&amp; result)
+{
+    if (!decoder.decode(result.m_data))
+        return false;
+
+    return true;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -171,7 +171,7 @@
</span><span class="cx">     completeOperation(resultData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBConnectionToServer::putOrAdd(TransactionOperation&amp; operation, IDBKey* key, SerializedScriptValue&amp; value, const IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</del><ins>+void IDBConnectionToServer::putOrAdd(TransactionOperation&amp; operation, IDBKey* key, const IDBValue&amp; value, const IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBConnectionToServer::putOrAdd&quot;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> class IDBOpenDBRequest;
</span><span class="cx"> class IDBResultData;
</span><span class="cx"> class IDBTransaction;
</span><ins>+class IDBValue;
</ins><span class="cx"> 
</span><span class="cx"> namespace IDBClient {
</span><span class="cx"> 
</span><span class="lines">@@ -77,7 +78,7 @@
</span><span class="cx">     void deleteIndex(TransactionOperation&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName);
</span><span class="cx">     WEBCORE_EXPORT void didDeleteIndex(const IDBResultData&amp;);
</span><span class="cx"> 
</span><del>-    void putOrAdd(TransactionOperation&amp;, IDBKey*, SerializedScriptValue&amp;, const IndexedDB::ObjectStoreOverwriteMode);
</del><ins>+    void putOrAdd(TransactionOperation&amp;, IDBKey*, const IDBValue&amp;, const IndexedDB::ObjectStoreOverwriteMode);
</ins><span class="cx">     WEBCORE_EXPORT void didPutOrAdd(const IDBResultData&amp;);
</span><span class="cx"> 
</span><span class="cx">     void getRecord(TransactionOperation&amp;, const IDBKeyRangeData&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerDelegateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> class IDBRequestData;
</span><span class="cx"> class IDBResourceIdentifier;
</span><span class="cx"> class IDBTransactionInfo;
</span><del>-class SerializedScriptValue;
</del><ins>+class IDBValue;
</ins><span class="cx"> 
</span><span class="cx"> namespace IndexedDB {
</span><span class="cx"> enum class ObjectStoreOverwriteMode;
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx">     virtual void clearObjectStore(const IDBRequestData&amp;, uint64_t objectStoreIdentifier) = 0;
</span><span class="cx">     virtual void createIndex(const IDBRequestData&amp;, const IDBIndexInfo&amp;) = 0;
</span><span class="cx">     virtual void deleteIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName) = 0;
</span><del>-    virtual void putOrAdd(const IDBRequestData&amp;, IDBKey*, SerializedScriptValue&amp;, const IndexedDB::ObjectStoreOverwriteMode) = 0;
</del><ins>+    virtual void putOrAdd(const IDBRequestData&amp;, IDBKey*, const IDBValue&amp;, const IndexedDB::ObjectStoreOverwriteMode) = 0;
</ins><span class="cx">     virtual void getRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) = 0;
</span><span class="cx">     virtual void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) = 0;
</span><span class="cx">     virtual void deleteRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -238,7 +238,7 @@
</span><span class="cx">     transaction-&gt;deleteIndex(requestData, objectStoreIdentifier, indexName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBServer::putOrAdd(const IDBRequestData&amp; requestData, const IDBKeyData&amp; keyData, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</del><ins>+void IDBServer::putOrAdd(const IDBRequestData&amp; requestData, const IDBKeyData&amp; keyData, const IDBValue&amp; value, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBServer::putOrAdd&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -246,7 +246,7 @@
</span><span class="cx">     if (!transaction)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    transaction-&gt;putOrAdd(requestData, keyData, valueData, overwriteMode);
</del><ins>+    transaction-&gt;putOrAdd(requestData, keyData, value, overwriteMode);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void IDBServer::getRecord(const IDBRequestData&amp; requestData, const IDBKeyRangeData&amp; keyRangeData)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> class CrossThreadTask;
</span><span class="cx"> class IDBCursorInfo;
</span><span class="cx"> class IDBRequestData;
</span><ins>+class IDBValue;
</ins><span class="cx"> 
</span><span class="cx"> namespace IDBServer {
</span><span class="cx"> 
</span><span class="lines">@@ -67,7 +68,7 @@
</span><span class="cx">     WEBCORE_EXPORT void clearObjectStore(const IDBRequestData&amp;, uint64_t objectStoreIdentifier);
</span><span class="cx">     WEBCORE_EXPORT void createIndex(const IDBRequestData&amp;, const IDBIndexInfo&amp;);
</span><span class="cx">     WEBCORE_EXPORT void deleteIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName);
</span><del>-    WEBCORE_EXPORT void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode);
</del><ins>+    WEBCORE_EXPORT void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const IDBValue&amp;, IndexedDB::ObjectStoreOverwriteMode);
</ins><span class="cx">     WEBCORE_EXPORT void getRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     WEBCORE_EXPORT void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     WEBCORE_EXPORT void deleteRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;IDBResultData.h&quot;
</span><span class="cx"> #include &quot;IDBServer.h&quot;
</span><span class="cx"> #include &quot;IDBTransactionInfo.h&quot;
</span><ins>+#include &quot;IDBValue.h&quot;
</ins><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;ScopeGuard.h&quot;
</span><span class="cx"> #include &quot;UniqueIDBDatabaseConnection.h&quot;
</span><span class="lines">@@ -683,13 +684,13 @@
</span><span class="cx">     performErrorCallback(callbackIdentifier, error);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UniqueIDBDatabase::putOrAdd(const IDBRequestData&amp; requestData, const IDBKeyData&amp; keyData, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode overwriteMode, KeyDataCallback callback)
</del><ins>+void UniqueIDBDatabase::putOrAdd(const IDBRequestData&amp; requestData, const IDBKeyData&amp; keyData, const IDBValue&amp; value, IndexedDB::ObjectStoreOverwriteMode overwriteMode, KeyDataCallback callback)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx">     LOG(IndexedDB, &quot;(main) UniqueIDBDatabase::putOrAdd&quot;);
</span><span class="cx"> 
</span><span class="cx">     uint64_t callbackID = storeCallback(callback);
</span><del>-    m_server.postDatabaseTask(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::performPutOrAdd, callbackID, requestData.transactionIdentifier(), requestData.objectStoreIdentifier(), keyData, valueData, overwriteMode));
</del><ins>+    m_server.postDatabaseTask(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::performPutOrAdd, callbackID, requestData.transactionIdentifier(), requestData.objectStoreIdentifier(), keyData, value, overwriteMode));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> VM&amp; UniqueIDBDatabase::databaseThreadVM()
</span><span class="lines">@@ -709,7 +710,7 @@
</span><span class="cx">     return *globalObject.get()-&gt;globalExec();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UniqueIDBDatabase::performPutOrAdd(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp; keyData, const ThreadSafeDataBuffer&amp; originalRecordValue, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</del><ins>+void UniqueIDBDatabase::performPutOrAdd(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp; keyData, const IDBValue&amp; originalRecordValue, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!isMainThread());
</span><span class="cx">     LOG(IndexedDB, &quot;(db) UniqueIDBDatabase::performPutOrAdd&quot;);
</span><span class="lines">@@ -764,7 +765,7 @@
</span><span class="cx">     if (usedKeyIsGenerated &amp;&amp; !objectStoreInfo-&gt;keyPath().isNull()) {
</span><span class="cx">         JSLockHolder locker(databaseThreadVM());
</span><span class="cx"> 
</span><del>-        JSValue value = deserializeIDBValueDataToJSValue(databaseThreadExecState(), originalRecordValue);
</del><ins>+        JSValue value = deserializeIDBValueDataToJSValue(databaseThreadExecState(), originalRecordValue.data());
</ins><span class="cx">         if (value.isUndefined()) {
</span><span class="cx">             m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::didPerformPutOrAdd, callbackIdentifier, IDBError(IDBDatabaseException::ConstraintError, ASCIILiteral(&quot;Unable to deserialize record value for record key injection&quot;)), usedKey));
</span><span class="cx">             return;
</span><span class="lines">@@ -794,7 +795,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    error = m_backingStore-&gt;addRecord(transactionIdentifier, *objectStoreInfo, usedKey, injectedRecordValue.data() ? injectedRecordValue : originalRecordValue);
</del><ins>+    error = m_backingStore-&gt;addRecord(transactionIdentifier, *objectStoreInfo, usedKey, injectedRecordValue.data() ? injectedRecordValue : originalRecordValue.data());
</ins><span class="cx">     if (!error.isNull()) {
</span><span class="cx">         m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::didPerformPutOrAdd, callbackIdentifier, error, usedKey));
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx">     void clearObjectStore(UniqueIDBDatabaseTransaction&amp;, uint64_t objectStoreIdentifier, ErrorCallback);
</span><span class="cx">     void createIndex(UniqueIDBDatabaseTransaction&amp;, const IDBIndexInfo&amp;, ErrorCallback);
</span><span class="cx">     void deleteIndex(UniqueIDBDatabaseTransaction&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName, ErrorCallback);
</span><del>-    void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode, KeyDataCallback);
</del><ins>+    void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const IDBValue&amp;, IndexedDB::ObjectStoreOverwriteMode, KeyDataCallback);
</ins><span class="cx">     void getRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;, GetResultCallback);
</span><span class="cx">     void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;, CountCallback);
</span><span class="cx">     void deleteRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;, ErrorCallback);
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx">     void performClearObjectStore(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier);
</span><span class="cx">     void performCreateIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, const IDBIndexInfo&amp;);
</span><span class="cx">     void performDeleteIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier);
</span><del>-    void performPutOrAdd(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode);
</del><ins>+    void performPutOrAdd(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;, const IDBValue&amp;, IndexedDB::ObjectStoreOverwriteMode);
</ins><span class="cx">     void performGetRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;);
</span><span class="cx">     void performGetIndexRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;);
</span><span class="cx">     void performGetCount(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -187,7 +187,7 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UniqueIDBDatabaseTransaction::putOrAdd(const IDBRequestData&amp; requestData, const IDBKeyData&amp; keyData, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</del><ins>+void UniqueIDBDatabaseTransaction::putOrAdd(const IDBRequestData&amp; requestData, const IDBKeyData&amp; keyData, const IDBValue&amp; value, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;UniqueIDBDatabaseTransaction::putOrAdd&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -195,7 +195,7 @@
</span><span class="cx">     ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;UniqueIDBDatabaseTransaction&gt; self(this);
</span><del>-    m_databaseConnection-&gt;database().putOrAdd(requestData, keyData, valueData, overwriteMode, [this, self, requestData](const IDBError&amp; error, const IDBKeyData&amp; key) {
</del><ins>+    m_databaseConnection-&gt;database().putOrAdd(requestData, keyData, value, overwriteMode, [this, self, requestData](const IDBError&amp; error, const IDBKeyData&amp; key) {
</ins><span class="cx">         LOG(IndexedDB, &quot;UniqueIDBDatabaseTransaction::putOrAdd (callback)&quot;);
</span><span class="cx"> 
</span><span class="cx">         if (error.isNull())
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx"> class IDBKeyData;
</span><span class="cx"> class IDBObjectStoreInfo;
</span><span class="cx"> class IDBRequestData;
</span><del>-class ThreadSafeDataBuffer;
</del><ins>+class IDBValue;
</ins><span class="cx"> 
</span><span class="cx"> struct IDBKeyRangeData;
</span><span class="cx"> 
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx">     void clearObjectStore(const IDBRequestData&amp;, uint64_t objectStoreIdentifier);
</span><span class="cx">     void createIndex(const IDBRequestData&amp;, const IDBIndexInfo&amp;);
</span><span class="cx">     void deleteIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName);
</span><del>-    void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode);
</del><ins>+    void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const IDBValue&amp;, IndexedDB::ObjectStoreOverwriteMode);
</ins><span class="cx">     void getRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     void deleteRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include &quot;IDBOpenDBRequest.h&quot;
</span><span class="cx"> #include &quot;IDBRequestData.h&quot;
</span><span class="cx"> #include &quot;IDBResultData.h&quot;
</span><ins>+#include &quot;IDBValue.h&quot;
</ins><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &lt;wtf/RunLoop.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -287,14 +288,13 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InProcessIDBServer::putOrAdd(const IDBRequestData&amp; requestData, IDBKey* key, SerializedScriptValue&amp; value, const IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</del><ins>+void InProcessIDBServer::putOrAdd(const IDBRequestData&amp; requestData, IDBKey* key, const IDBValue&amp; value, const IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;InProcessIDBServer&gt; self(this);
</span><span class="cx">     IDBKeyData keyData(key);
</span><del>-    auto valueData = ThreadSafeDataBuffer::copyVector(value.data());
</del><span class="cx"> 
</span><del>-    RunLoop::current().dispatch([this, self, requestData, keyData, valueData, overwriteMode] {
-        m_server-&gt;putOrAdd(requestData, keyData, valueData, overwriteMode);
</del><ins>+    RunLoop::current().dispatch([this, self, requestData, keyData, value, overwriteMode] {
+        m_server-&gt;putOrAdd(requestData, keyData, value, overwriteMode);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx">     void clearObjectStore(const IDBRequestData&amp;, uint64_t objectStoreIdentifier) final;
</span><span class="cx">     void createIndex(const IDBRequestData&amp;, const IDBIndexInfo&amp;) final;
</span><span class="cx">     void deleteIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName) final;
</span><del>-    void putOrAdd(const IDBRequestData&amp;, IDBKey*, SerializedScriptValue&amp;, const IndexedDB::ObjectStoreOverwriteMode) final;
</del><ins>+    void putOrAdd(const IDBRequestData&amp;, IDBKey*, const IDBValue&amp;, const IndexedDB::ObjectStoreOverwriteMode) final;
</ins><span class="cx">     void getRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) final;
</span><span class="cx">     void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) final;
</span><span class="cx">     void deleteRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) final;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -2045,7 +2045,7 @@
</span><span class="cx">                 5160712F1BD8307800DBC4F2 /* IDBObjectStoreInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 5160712D1BD8307200DBC4F2 /* IDBObjectStoreInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 516071321BD8308B00DBC4F2 /* TransactionOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5160712B1BD8305300DBC4F2 /* TransactionOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 5160F4980B0AA75F00C1D2AF /* HistoryItemMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */; };
</span><del>-                516103AF1CADBA770016B4C7 /* IDBValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 516103AE1CADB9A30016B4C7 /* IDBValue.h */; };
</del><ins>+                516103AF1CADBA770016B4C7 /* IDBValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 516103AE1CADB9A30016B4C7 /* IDBValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 516103B01CADBA7A0016B4C7 /* IDBValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516103AD1CADB9A30016B4C7 /* IDBValue.cpp */; };
</span><span class="cx">                 5162C7F411F77EFB00612EFE /* SchemeRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */; };
</span><span class="cx">                 5162C7F511F77EFB00612EFE /* SchemeRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 5162C7F311F77EFB00612EFE /* SchemeRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformCrossThreadCopiercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/CrossThreadCopier.cpp (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/CrossThreadCopier.cpp        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/platform/CrossThreadCopier.cpp        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx"> #include &quot;IDBObjectStoreInfo.h&quot;
</span><span class="cx"> #include &quot;IDBResourceIdentifier.h&quot;
</span><span class="cx"> #include &quot;IDBTransactionInfo.h&quot;
</span><ins>+#include &quot;IDBValue.h&quot;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -165,6 +166,11 @@
</span><span class="cx">     return info.isolatedCopy();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+CrossThreadCopierBase&lt;false, false, IDBValue&gt;::Type CrossThreadCopierBase&lt;false, false, IDBValue&gt;::copy(const IDBValue&amp; value)
+{
+    return value.isolatedCopy();
+}
+
</ins><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><span class="cx"> // Test CrossThreadCopier using COMPILE_ASSERT.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformCrossThreadCopierh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/CrossThreadCopier.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/CrossThreadCopier.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/platform/CrossThreadCopier.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -227,6 +227,12 @@
</span><span class="cx">         static Type copy(const IDBCursorInfo&amp;);
</span><span class="cx">     };
</span><span class="cx"> 
</span><ins>+    class IDBValue;
+    template&lt;&gt; struct WEBCORE_EXPORT CrossThreadCopierBase&lt;false, false, IDBValue&gt; {
+        typedef IDBValue Type;
+        static Type copy(const IDBValue&amp;);
+    };
+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     template&lt;typename T&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformThreadSafeDataBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ThreadSafeDataBuffer.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ThreadSafeDataBuffer.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/platform/ThreadSafeDataBuffer.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -71,6 +71,9 @@
</span><span class="cx">         return m_impl ? &amp;m_impl-&gt;m_data : nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    template&lt;class Encoder&gt; void encode(Encoder&amp;) const;
+    template&lt;class Decoder&gt; static bool decode(Decoder&amp;, ThreadSafeDataBuffer&amp;);
+
</ins><span class="cx"> private:
</span><span class="cx">     explicit ThreadSafeDataBuffer(Vector&lt;uint8_t&gt;&amp; data, ThreadSafeDataBufferImpl::AdoptVectorTag tag)
</span><span class="cx">     {
</span><span class="lines">@@ -85,6 +88,34 @@
</span><span class="cx">     RefPtr&lt;ThreadSafeDataBufferImpl&gt; m_impl;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+template&lt;class Encoder&gt;
+void ThreadSafeDataBuffer::encode(Encoder&amp; encoder) const
+{
+    bool hasData = m_impl;
+    encoder &lt;&lt; hasData;
+
+    if (hasData)
+        encoder &lt;&lt; m_impl-&gt;m_data;
+}
+
+template&lt;class Decoder&gt;
+bool ThreadSafeDataBuffer::decode(Decoder&amp; decoder, ThreadSafeDataBuffer&amp; result)
+{
+    bool hasData;
+    if (!decoder.decode(hasData))
+        return false;
+
+    if (hasData) {
+        Vector&lt;uint8_t&gt; data;
+        if (!decoder.decode(data))
+            return false;
+
+        result = ThreadSafeDataBuffer::adoptVector(data);
+    }
+
+    return true;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ThreadSafeDataBuffer_h
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebKit2/ChangeLog        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2016-04-05  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Modern IDB: Replace use of SerializedScriptValue with IDBValue.
+        https://bugs.webkit.org/show_bug.cgi?id=156242
+
+        Reviewed by Alex Christensen.
+
+        * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
+        (WebKit::WebIDBConnectionToClient::putOrAdd):
+        * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
+        * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
+
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
+        (WebKit::WebIDBConnectionToServer::putOrAdd):
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
+
</ins><span class="cx"> 2016-04-05  Antoine Quint  &lt;graouts@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WebGL2] Turn the ENABLE_WEBGL2 flag on
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include &quot;WebIDBConnectionToServerMessages.h&quot;
</span><span class="cx"> #include &lt;WebCore/IDBError.h&gt;
</span><span class="cx"> #include &lt;WebCore/IDBResultData.h&gt;
</span><ins>+#include &lt;WebCore/IDBValue.h&gt;
</ins><span class="cx"> #include &lt;WebCore/ThreadSafeDataBuffer.h&gt;
</span><span class="cx"> #include &lt;WebCore/UniqueIDBDatabaseConnection.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -214,7 +215,7 @@
</span><span class="cx">     DatabaseProcess::singleton().idbServer().deleteIndex(request, objectStoreIdentifier, name);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebIDBConnectionToClient::putOrAdd(const IDBRequestData&amp; request, const IDBKeyData&amp; key, const IPC::DataReference&amp; data, unsigned overwriteMode)
</del><ins>+void WebIDBConnectionToClient::putOrAdd(const IDBRequestData&amp; request, const IDBKeyData&amp; key, const IDBValue&amp; value, unsigned overwriteMode)
</ins><span class="cx"> {
</span><span class="cx">     if (overwriteMode != static_cast&lt;unsigned&gt;(IndexedDB::ObjectStoreOverwriteMode::NoOverwrite)
</span><span class="cx">         &amp;&amp; overwriteMode != static_cast&lt;unsigned&gt;(IndexedDB::ObjectStoreOverwriteMode::Overwrite)
</span><span class="lines">@@ -225,9 +226,8 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     IndexedDB::ObjectStoreOverwriteMode mode = static_cast&lt;IndexedDB::ObjectStoreOverwriteMode&gt;(overwriteMode);
</span><del>-    auto buffer = ThreadSafeDataBuffer::copyVector(data.vector());
</del><span class="cx"> 
</span><del>-    DatabaseProcess::singleton().idbServer().putOrAdd(request, key, buffer, mode);
</del><ins>+    DatabaseProcess::singleton().idbServer().putOrAdd(request, key, value, mode);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebIDBConnectionToClient::getRecord(const IDBRequestData&amp; request, const IDBKeyRangeData&amp; range)
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> class IDBObjectStoreInfo;
</span><span class="cx"> class IDBRequestData;
</span><span class="cx"> class IDBTransactionInfo;
</span><ins>+class IDBValue;
</ins><span class="cx"> class SerializedScriptValue;
</span><span class="cx"> struct IDBKeyRangeData;
</span><span class="cx"> }
</span><span class="lines">@@ -90,7 +91,7 @@
</span><span class="cx">     void clearObjectStore(const WebCore::IDBRequestData&amp;, uint64_t objectStoreIdentifier);
</span><span class="cx">     void createIndex(const WebCore::IDBRequestData&amp;, const WebCore::IDBIndexInfo&amp;);
</span><span class="cx">     void deleteIndex(const WebCore::IDBRequestData&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName);
</span><del>-    void putOrAdd(const WebCore::IDBRequestData&amp;, const WebCore::IDBKeyData&amp;, const IPC::DataReference&amp; value, unsigned overwriteMode);
</del><ins>+    void putOrAdd(const WebCore::IDBRequestData&amp;, const WebCore::IDBKeyData&amp;, const WebCore::IDBValue&amp;, unsigned overwriteMode);
</ins><span class="cx">     void getRecord(const WebCore::IDBRequestData&amp;, const WebCore::IDBKeyRangeData&amp;);
</span><span class="cx">     void getCount(const WebCore::IDBRequestData&amp;, const WebCore::IDBKeyRangeData&amp;);
</span><span class="cx">     void deleteRecord(const WebCore::IDBRequestData&amp;, const WebCore::IDBKeyRangeData&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClientmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx">     ClearObjectStore(WebCore::IDBRequestData requestData, uint64_t objectStoreIdentifier);
</span><span class="cx">     CreateIndex(WebCore::IDBRequestData requestData, WebCore::IDBIndexInfo info);
</span><span class="cx">     DeleteIndex(WebCore::IDBRequestData requestData, uint64_t objectStoreIdentifier, String indexName);
</span><del>-    PutOrAdd(WebCore::IDBRequestData requestData, WebCore::IDBKeyData key, IPC::DataReference value, unsigned overwriteMode);
</del><ins>+    PutOrAdd(WebCore::IDBRequestData requestData, WebCore::IDBKeyData key, WebCore::IDBValue value, unsigned overwriteMode);
</ins><span class="cx">     GetRecord(WebCore::IDBRequestData requestData, struct WebCore::IDBKeyRangeData range);
</span><span class="cx">     GetCount(WebCore::IDBRequestData requestData, struct WebCore::IDBKeyRangeData range);
</span><span class="cx">     DeleteRecord(WebCore::IDBRequestData requestData, struct WebCore::IDBKeyRangeData range);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> #include &lt;WebCore/IDBResourceIdentifier.h&gt;
</span><span class="cx"> #include &lt;WebCore/IDBResultData.h&gt;
</span><span class="cx"> #include &lt;WebCore/IDBTransactionInfo.h&gt;
</span><ins>+#include &lt;WebCore/IDBValue.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="lines">@@ -128,11 +129,10 @@
</span><span class="cx">     send(Messages::WebIDBConnectionToClient::DeleteIndex(requestData, objectStoreIdentifier, indexName));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebIDBConnectionToServer::putOrAdd(const IDBRequestData&amp; requestData, IDBKey* key, SerializedScriptValue&amp; value, const IndexedDB::ObjectStoreOverwriteMode mode)
</del><ins>+void WebIDBConnectionToServer::putOrAdd(const IDBRequestData&amp; requestData, IDBKey* key, const IDBValue&amp; value, const IndexedDB::ObjectStoreOverwriteMode mode)
</ins><span class="cx"> {
</span><span class="cx">     IDBKeyData keyData(key);
</span><del>-    IPC::DataReference valueData(value.data());
-    send(Messages::WebIDBConnectionToClient::PutOrAdd(requestData, keyData, valueData, static_cast&lt;unsigned&gt;(mode)));
</del><ins>+    send(Messages::WebIDBConnectionToClient::PutOrAdd(requestData, keyData, value, static_cast&lt;unsigned&gt;(mode)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebIDBConnectionToServer::getRecord(const IDBRequestData&amp; requestData, const IDBKeyRangeData&amp; range)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">     void clearObjectStore(const WebCore::IDBRequestData&amp;, uint64_t objectStoreIdentifier) final;
</span><span class="cx">     void createIndex(const WebCore::IDBRequestData&amp;, const WebCore::IDBIndexInfo&amp;) final;
</span><span class="cx">     void deleteIndex(const WebCore::IDBRequestData&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName) final;
</span><del>-    void putOrAdd(const WebCore::IDBRequestData&amp;, WebCore::IDBKey*, WebCore::SerializedScriptValue&amp;, const WebCore::IndexedDB::ObjectStoreOverwriteMode) final;
</del><ins>+    void putOrAdd(const WebCore::IDBRequestData&amp;, WebCore::IDBKey*, const WebCore::IDBValue&amp;, const WebCore::IndexedDB::ObjectStoreOverwriteMode) final;
</ins><span class="cx">     void getRecord(const WebCore::IDBRequestData&amp;, const WebCore::IDBKeyRangeData&amp;) final;
</span><span class="cx">     void getCount(const WebCore::IDBRequestData&amp;, const WebCore::IDBKeyRangeData&amp;) final;
</span><span class="cx">     void deleteRecord(const WebCore::IDBRequestData&amp;, const WebCore::IDBKeyRangeData&amp;) final;
</span></span></pre>
</div>
</div>

</body>
</html>