<!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>[192123] 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/192123">192123</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2015-11-06 17:12:55 -0800 (Fri, 06 Nov 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Modern IDB: Make the result data for a &quot;get&quot; request be an IDBGetResult.
https://bugs.webkit.org/show_bug.cgi?id=150985

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Refactor, no change in behavior).

* Modules/indexeddb/IDBGetResult.h:
(WebCore::IDBGetResult::IDBGetResult):
(WebCore::IDBGetResult::dataFromBuffer):
(WebCore::IDBGetResult::isolatedCopy):

* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::didGetRecordOnServer):

* Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp:
(WebCore::GetOperation::perform):

* Modules/indexeddb/server/IDBBackingStore.h:

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

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

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

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::storeCallback):
(WebCore::IDBServer::UniqueIDBDatabase::getRecord):
(WebCore::IDBServer::UniqueIDBDatabase::performGetIndexRecord):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformGetRecord):
(WebCore::IDBServer::UniqueIDBDatabase::performGetResultCallback):
(WebCore::IDBServer::UniqueIDBDatabase::performValueDataCallback): Deleted.
* Modules/indexeddb/server/UniqueIDBDatabase.h:

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

* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::IDBResultData):
(WebCore::IDBResultData::getRecordSuccess):
(WebCore::IDBResultData::getResult):
* Modules/indexeddb/shared/IDBResultData.h:
(WebCore::IDBResultData::resultData): Deleted.

Source/WebKit2:

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder&lt;IDBGetResult&gt;::encode):
(IPC::ArgumentCoder&lt;IDBGetResult&gt;::decode):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBGetResulth">trunk/Source/WebCore/Modules/indexeddb/IDBGetResult.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddblegacyIDBTransactionBackendOperationscpp">trunk/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBBackingStoreh">trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStorecpp">trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStoreh">trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryIndexcpp">trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryIndexh">trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryObjectStorecpp">trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryObjectStoreh">trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.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="#trunkSourceWebCoreModulesindexeddbsharedIDBResultDatacpp">trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBResultDatah">trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCoreArgumentCoderscpp">trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (192122 => 192123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-11-06 23:58:09 UTC (rev 192122)
+++ trunk/Source/WebCore/ChangeLog        2015-11-07 01:12:55 UTC (rev 192123)
</span><span class="lines">@@ -1,3 +1,56 @@
</span><ins>+2015-11-06  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Modern IDB: Make the result data for a &quot;get&quot; request be an IDBGetResult.
+        https://bugs.webkit.org/show_bug.cgi?id=150985
+
+        Reviewed by Alex Christensen.
+
+        No new tests (Refactor, no change in behavior).
+
+        * Modules/indexeddb/IDBGetResult.h:
+        (WebCore::IDBGetResult::IDBGetResult):
+        (WebCore::IDBGetResult::dataFromBuffer):
+        (WebCore::IDBGetResult::isolatedCopy):
+        
+        * Modules/indexeddb/client/IDBTransactionImpl.cpp:
+        (WebCore::IDBClient::IDBTransaction::didGetRecordOnServer):
+        
+        * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp:
+        (WebCore::GetOperation::perform):
+        
+        * Modules/indexeddb/server/IDBBackingStore.h:
+        
+        * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
+        (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
+        * Modules/indexeddb/server/MemoryIDBBackingStore.h:
+        
+        * Modules/indexeddb/server/MemoryIndex.cpp:
+        (WebCore::IDBServer::MemoryIndex::valueForKeyRange):
+        * Modules/indexeddb/server/MemoryIndex.h:
+        
+        * Modules/indexeddb/server/MemoryObjectStore.cpp:
+        (WebCore::IDBServer::MemoryObjectStore::indexValueForKeyRange):
+        * Modules/indexeddb/server/MemoryObjectStore.h:
+        
+        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabase::storeCallback):
+        (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
+        (WebCore::IDBServer::UniqueIDBDatabase::performGetIndexRecord):
+        (WebCore::IDBServer::UniqueIDBDatabase::didPerformGetRecord):
+        (WebCore::IDBServer::UniqueIDBDatabase::performGetResultCallback):
+        (WebCore::IDBServer::UniqueIDBDatabase::performValueDataCallback): Deleted.
+        * Modules/indexeddb/server/UniqueIDBDatabase.h:
+        
+        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord):
+        
+        * Modules/indexeddb/shared/IDBResultData.cpp:
+        (WebCore::IDBResultData::IDBResultData):
+        (WebCore::IDBResultData::getRecordSuccess):
+        (WebCore::IDBResultData::getResult):
+        * Modules/indexeddb/shared/IDBResultData.h:
+        (WebCore::IDBResultData::resultData): Deleted.
+
</ins><span class="cx"> 2015-11-06  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove unused HTMLFormControlsCollection::namedItem()
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBGetResulth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBGetResult.h (192122 => 192123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBGetResult.h        2015-11-06 23:58:09 UTC (rev 192122)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBGetResult.h        2015-11-07 01:12:55 UTC (rev 192123)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &quot;IDBKeyData.h&quot;
</span><span class="cx"> #include &quot;IDBKeyPath.h&quot;
</span><span class="cx"> #include &quot;SharedBuffer.h&quot;
</span><ins>+#include &quot;ThreadSafeDataBuffer.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -41,6 +42,12 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     IDBGetResult(PassRefPtr&lt;SharedBuffer&gt; buffer)
</span><ins>+    {
+        if (buffer)
+            dataFromBuffer(*buffer);
+    }
+
+    IDBGetResult(const ThreadSafeDataBuffer&amp; buffer)
</ins><span class="cx">         : valueBuffer(buffer)
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="lines">@@ -56,24 +63,31 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     IDBGetResult(PassRefPtr&lt;SharedBuffer&gt; buffer, PassRefPtr&lt;IDBKey&gt; key, const IDBKeyPath&amp; path)
</span><del>-        : valueBuffer(buffer)
-        , keyData(key.get())
</del><ins>+        : keyData(key.get())
</ins><span class="cx">         , keyPath(path)
</span><span class="cx">     {
</span><ins>+        if (buffer)
+            dataFromBuffer(*buffer);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    void dataFromBuffer(SharedBuffer&amp; buffer)
+    {
+        Vector&lt;uint8_t&gt; data(buffer.size());
+        memcpy(data.data(), buffer.data(), buffer.size());
+
+        valueBuffer = ThreadSafeDataBuffer::adoptVector(data);
+    }
+
</ins><span class="cx">     IDBGetResult isolatedCopy() const
</span><span class="cx">     {
</span><span class="cx">         IDBGetResult result;
</span><del>-        if (valueBuffer)
-            result.valueBuffer = valueBuffer-&gt;copy();
-
</del><ins>+        result.valueBuffer = valueBuffer;
</ins><span class="cx">         result.keyData = keyData.isolatedCopy();
</span><span class="cx">         result.keyPath = keyPath.isolatedCopy();
</span><span class="cx">         return result;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;SharedBuffer&gt; valueBuffer;
</del><ins>+    ThreadSafeDataBuffer valueBuffer;
</ins><span class="cx">     IDBKeyData keyData;
</span><span class="cx">     IDBKeyPath keyPath;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp (192122 => 192123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp        2015-11-06 23:58:09 UTC (rev 192122)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp        2015-11-07 01:12:55 UTC (rev 192123)
</span><span class="lines">@@ -490,8 +490,8 @@
</span><span class="cx">         else
</span><span class="cx">             request.setResultToUndefined();
</span><span class="cx">     } else {
</span><del>-        if (resultData.resultData().data())
-            request.setResultToStructuredClone(resultData.resultData());
</del><ins>+        if (resultData.getResult().valueBuffer.data())
+            request.setResultToStructuredClone(resultData.getResult().valueBuffer);
</ins><span class="cx">         else
</span><span class="cx">             request.setResultToUndefined();
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddblegacyIDBTransactionBackendOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp (192122 => 192123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp        2015-11-06 23:58:09 UTC (rev 192122)
+++ trunk/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp        2015-11-07 01:12:55 UTC (rev 192123)
</span><span class="lines">@@ -100,16 +100,17 @@
</span><span class="cx">         if (error)
</span><span class="cx">             m_callbacks-&gt;onError(error);
</span><span class="cx">         else {
</span><del>-            if (!result.valueBuffer) {
</del><ins>+            if (!result.valueBuffer.data()) {
</ins><span class="cx">                 if (result.keyData.isNull())
</span><span class="cx">                     m_callbacks-&gt;onSuccess();
</span><span class="cx">                 else
</span><span class="cx">                     m_callbacks-&gt;onSuccess(result.keyData.maybeCreateIDBKey());
</span><span class="cx">             } else {
</span><ins>+                auto valueBuffer = SharedBuffer::create(result.valueBuffer.data()-&gt;data(), result.valueBuffer.data()-&gt;size());
</ins><span class="cx">                 if (!result.keyData.isNull())
</span><del>-                    m_callbacks-&gt;onSuccess(result.valueBuffer, result.keyData.maybeCreateIDBKey(), result.keyPath);
</del><ins>+                    m_callbacks-&gt;onSuccess(valueBuffer, result.keyData.maybeCreateIDBKey(), result.keyPath);
</ins><span class="cx">                 else
</span><del>-                    m_callbacks-&gt;onSuccess(result.valueBuffer.get());
</del><ins>+                    m_callbacks-&gt;onSuccess(valueBuffer);
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h (192122 => 192123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h        2015-11-06 23:58:09 UTC (rev 192122)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h        2015-11-07 01:12:55 UTC (rev 192123)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> class IDBTransactionInfo;
</span><span class="cx"> class ThreadSafeDataBuffer;
</span><span class="cx"> 
</span><ins>+struct IDBGetResult;
</ins><span class="cx"> struct IDBKeyRangeData;
</span><span class="cx"> 
</span><span class="cx"> namespace IndexedDB {
</span><span class="lines">@@ -66,7 +67,7 @@
</span><span class="cx">     virtual IDBError deleteRange(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;) = 0;
</span><span class="cx">     virtual IDBError putRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;, const ThreadSafeDataBuffer&amp; value) = 0;
</span><span class="cx">     virtual IDBError getRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;, ThreadSafeDataBuffer&amp; outValue) = 0;
</span><del>-    virtual IDBError getIndexRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;, ThreadSafeDataBuffer&amp; outValue) = 0;
</del><ins>+    virtual IDBError getIndexRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;, IDBGetResult&amp; outValue) = 0;
</ins><span class="cx">     virtual IDBError getCount(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData&amp;, uint64_t&amp; outCount) = 0;
</span><span class="cx">     virtual IDBError generateKeyNumber(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t&amp; keyNumber) = 0;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp (192122 => 192123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2015-11-06 23:58:09 UTC (rev 192122)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2015-11-07 01:12:55 UTC (rev 192123)
</span><span class="lines">@@ -279,7 +279,7 @@
</span><span class="cx">     return IDBError();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IDBError MemoryIDBBackingStore::getIndexRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType recordType, const IDBKeyRangeData&amp; range, ThreadSafeDataBuffer&amp; outValue)
</del><ins>+IDBError MemoryIDBBackingStore::getIndexRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType recordType, const IDBKeyRangeData&amp; range, IDBGetResult&amp; outValue)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;MemoryIDBBackingStore::getIndexRecord&quot;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h (192122 => 192123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h        2015-11-06 23:58:09 UTC (rev 192122)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h        2015-11-07 01:12:55 UTC (rev 192123)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx">     virtual IDBError deleteRange(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;) override final;
</span><span class="cx">     virtual IDBError putRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;, const ThreadSafeDataBuffer&amp; value) override final;
</span><span class="cx">     virtual IDBError getRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;, ThreadSafeDataBuffer&amp; outValue) override final;
</span><del>-    virtual IDBError getIndexRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;, ThreadSafeDataBuffer&amp; outValue) override final;
</del><ins>+    virtual IDBError getIndexRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;, IDBGetResult&amp; outValue) override final;
</ins><span class="cx">     virtual IDBError getCount(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData&amp;, uint64_t&amp; outCount) override final;
</span><span class="cx">     virtual IDBError generateKeyNumber(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t&amp; keyNumber) override final;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIndexcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp (192122 => 192123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp        2015-11-06 23:58:09 UTC (rev 192122)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp        2015-11-07 01:12:55 UTC (rev 192123)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><del>-#include &quot;ThreadSafeDataBuffer.h&quot;
</del><ins>+#include &quot;IDBGetResult.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> namespace IDBServer {
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ThreadSafeDataBuffer MemoryIndex::valueForKeyRange(IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;) const
</del><ins>+IDBGetResult MemoryIndex::valueForKeyRange(IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;) const
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: Once indexes actually index, we'll return something real.
</span><span class="cx">     // https://bugs.webkit.org/show_bug.cgi?id=150939
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIndexh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h (192122 => 192123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h        2015-11-06 23:58:09 UTC (rev 192122)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h        2015-11-07 01:12:55 UTC (rev 192123)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><ins>+#include &quot;IDBGetResult.h&quot;
</ins><span class="cx"> #include &quot;IDBIndexInfo.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -51,7 +52,7 @@
</span><span class="cx"> 
</span><span class="cx">     const IDBIndexInfo&amp; info() const { return m_info; }
</span><span class="cx"> 
</span><del>-    ThreadSafeDataBuffer valueForKeyRange(IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;) const;
</del><ins>+    IDBGetResult valueForKeyRange(IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;) const;
</ins><span class="cx">     uint64_t countForKeyRange(const IDBKeyRangeData&amp;);
</span><span class="cx">     
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp (192122 => 192123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp        2015-11-06 23:58:09 UTC (rev 192122)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp        2015-11-07 01:12:55 UTC (rev 192123)
</span><span class="lines">@@ -215,7 +215,7 @@
</span><span class="cx">     return m_keyValueStore-&gt;get(key);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ThreadSafeDataBuffer MemoryObjectStore::indexValueForKeyRange(uint64_t indexIdentifier, IndexedDB::IndexRecordType recordType, const IDBKeyRangeData&amp; range) const
</del><ins>+IDBGetResult MemoryObjectStore::indexValueForKeyRange(uint64_t indexIdentifier, IndexedDB::IndexRecordType recordType, const IDBKeyRangeData&amp; range) const
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;MemoryObjectStore::indexValueForKeyRange&quot;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryObjectStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h (192122 => 192123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h        2015-11-06 23:58:09 UTC (rev 192122)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h        2015-11-07 01:12:55 UTC (rev 192123)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx">     void replaceKeyValueStore(std::unique_ptr&lt;KeyValueMap&gt;&amp;&amp;);
</span><span class="cx"> 
</span><span class="cx">     ThreadSafeDataBuffer valueForKeyRange(const IDBKeyRangeData&amp;) const;
</span><del>-    ThreadSafeDataBuffer indexValueForKeyRange(uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;) const;
</del><ins>+    IDBGetResult indexValueForKeyRange(uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;) const;
</ins><span class="cx">     uint64_t countForKeyRange(uint64_t indexIdentifier, const IDBKeyRangeData&amp;) const;
</span><span class="cx"> 
</span><span class="cx">     const IDBObjectStoreInfo&amp; info() const { return m_info; }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (192122 => 192123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2015-11-06 23:58:09 UTC (rev 192122)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2015-11-07 01:12:55 UTC (rev 192123)
</span><span class="lines">@@ -149,11 +149,11 @@
</span><span class="cx">     return identifier;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-uint64_t UniqueIDBDatabase::storeCallback(ValueDataCallback callback)
</del><ins>+uint64_t UniqueIDBDatabase::storeCallback(GetResultCallback callback)
</ins><span class="cx"> {
</span><span class="cx">     uint64_t identifier = generateUniqueCallbackIdentifier();
</span><del>-    ASSERT(!m_valueDataCallbacks.contains(identifier));
-    m_valueDataCallbacks.add(identifier, callback);
</del><ins>+    ASSERT(!m_getResultCallbacks.contains(identifier));
+    m_getResultCallbacks.add(identifier, callback);
</ins><span class="cx">     return identifier;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -447,7 +447,7 @@
</span><span class="cx">     performKeyDataCallback(callbackIdentifier, error, resultKey);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UniqueIDBDatabase::getRecord(const IDBRequestData&amp; requestData, const IDBKeyRangeData&amp; range, ValueDataCallback callback)
</del><ins>+void UniqueIDBDatabase::getRecord(const IDBRequestData&amp; requestData, const IDBKeyRangeData&amp; range, GetResultCallback callback)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx">     LOG(IndexedDB, &quot;(main) UniqueIDBDatabase::getRecord&quot;);
</span><span class="lines">@@ -480,18 +480,18 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_backingStore);
</span><span class="cx"> 
</span><del>-    ThreadSafeDataBuffer valueData;
-    IDBError error = m_backingStore-&gt;getIndexRecord(transactionIdentifier, objectStoreIdentifier, indexIdentifier, recordType, range, valueData);
</del><ins>+    IDBGetResult result;
+    IDBError error = m_backingStore-&gt;getIndexRecord(transactionIdentifier, objectStoreIdentifier, indexIdentifier, recordType, range, result);
</ins><span class="cx"> 
</span><del>-    m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::didPerformGetRecord, callbackIdentifier, error, valueData));
</del><ins>+    m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::didPerformGetRecord, callbackIdentifier, error, result));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UniqueIDBDatabase::didPerformGetRecord(uint64_t callbackIdentifier, const IDBError&amp; error, const ThreadSafeDataBuffer&amp; resultData)
</del><ins>+void UniqueIDBDatabase::didPerformGetRecord(uint64_t callbackIdentifier, const IDBError&amp; error, const IDBGetResult&amp; result)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx">     LOG(IndexedDB, &quot;(main) UniqueIDBDatabase::didPerformGetRecord&quot;);
</span><span class="cx"> 
</span><del>-    performValueDataCallback(callbackIdentifier, error, resultData);
</del><ins>+    performGetResultCallback(callbackIdentifier, error, result);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void UniqueIDBDatabase::getCount(const IDBRequestData&amp; requestData, const IDBKeyRangeData&amp; range, CountCallback callback)
</span><span class="lines">@@ -815,9 +815,9 @@
</span><span class="cx">     callback(error, resultKey);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UniqueIDBDatabase::performValueDataCallback(uint64_t callbackIdentifier, const IDBError&amp; error, const ThreadSafeDataBuffer&amp; resultData)
</del><ins>+void UniqueIDBDatabase::performGetResultCallback(uint64_t callbackIdentifier, const IDBError&amp; error, const IDBGetResult&amp; resultData)
</ins><span class="cx"> {
</span><del>-    auto callback = m_valueDataCallbacks.take(callbackIdentifier);
</del><ins>+    auto callback = m_getResultCallbacks.take(callbackIdentifier);
</ins><span class="cx">     ASSERT(callback);
</span><span class="cx">     callback(error, resultData);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h (192122 => 192123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2015-11-06 23:58:09 UTC (rev 192122)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2015-11-07 01:12:55 UTC (rev 192123)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;IDBBackingStore.h&quot;
</span><span class="cx"> #include &quot;IDBDatabaseIdentifier.h&quot;
</span><span class="cx"> #include &quot;IDBDatabaseInfo.h&quot;
</span><ins>+#include &quot;IDBGetResult.h&quot;
</ins><span class="cx"> #include &quot;IDBServerOperation.h&quot;
</span><span class="cx"> #include &quot;ThreadSafeDataBuffer.h&quot;
</span><span class="cx"> #include &quot;Timer.h&quot;
</span><span class="lines">@@ -59,7 +60,7 @@
</span><span class="cx"> 
</span><span class="cx"> typedef std::function&lt;void(const IDBError&amp;)&gt; ErrorCallback;
</span><span class="cx"> typedef std::function&lt;void(const IDBError&amp;, const IDBKeyData&amp;)&gt; KeyDataCallback;
</span><del>-typedef std::function&lt;void(const IDBError&amp;, const ThreadSafeDataBuffer&amp;)&gt; ValueDataCallback;
</del><ins>+typedef std::function&lt;void(const IDBError&amp;, const IDBGetResult&amp;)&gt; GetResultCallback;
</ins><span class="cx"> typedef std::function&lt;void(const IDBError&amp;, uint64_t)&gt; CountCallback;
</span><span class="cx"> 
</span><span class="cx"> class UniqueIDBDatabase : public ThreadSafeRefCounted&lt;UniqueIDBDatabase&gt; {
</span><span class="lines">@@ -79,7 +80,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 putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode, KeyDataCallback);
</span><del>-    void getRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;, ValueDataCallback);
</del><ins>+    void getRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;, GetResultCallback);
</ins><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="cx">     void commitTransaction(UniqueIDBDatabaseTransaction&amp;, ErrorCallback);
</span><span class="lines">@@ -125,7 +126,7 @@
</span><span class="cx">     void didPerformClearObjectStore(uint64_t callbackIdentifier, const IDBError&amp;);
</span><span class="cx">     void didPerformCreateIndex(uint64_t callbackIdentifier, const IDBError&amp;, const IDBIndexInfo&amp;);
</span><span class="cx">     void didPerformPutOrAdd(uint64_t callbackIdentifier, const IDBError&amp;, const IDBKeyData&amp;);
</span><del>-    void didPerformGetRecord(uint64_t callbackIdentifier, const IDBError&amp;, const ThreadSafeDataBuffer&amp;);
</del><ins>+    void didPerformGetRecord(uint64_t callbackIdentifier, const IDBError&amp;, const IDBGetResult&amp;);
</ins><span class="cx">     void didPerformGetCount(uint64_t callbackIdentifier, const IDBError&amp;, uint64_t);
</span><span class="cx">     void didPerformDeleteRecord(uint64_t callbackIdentifier, const IDBError&amp;);
</span><span class="cx">     void didPerformCommitTransaction(uint64_t callbackIdentifier, const IDBError&amp;, const IDBResourceIdentifier&amp; transactionIdentifier);
</span><span class="lines">@@ -134,12 +135,12 @@
</span><span class="cx"> 
</span><span class="cx">     uint64_t storeCallback(ErrorCallback);
</span><span class="cx">     uint64_t storeCallback(KeyDataCallback);
</span><del>-    uint64_t storeCallback(ValueDataCallback);
</del><ins>+    uint64_t storeCallback(GetResultCallback);
</ins><span class="cx">     uint64_t storeCallback(CountCallback);
</span><span class="cx"> 
</span><span class="cx">     void performErrorCallback(uint64_t callbackIdentifier, const IDBError&amp;);
</span><span class="cx">     void performKeyDataCallback(uint64_t callbackIdentifier, const IDBError&amp;, const IDBKeyData&amp;);
</span><del>-    void performValueDataCallback(uint64_t callbackIdentifier, const IDBError&amp;, const ThreadSafeDataBuffer&amp;);
</del><ins>+    void performGetResultCallback(uint64_t callbackIdentifier, const IDBError&amp;, const IDBGetResult&amp;);
</ins><span class="cx">     void performCountCallback(uint64_t callbackIdentifier, const IDBError&amp;, uint64_t);
</span><span class="cx"> 
</span><span class="cx">     void invokeTransactionScheduler();
</span><span class="lines">@@ -163,7 +164,7 @@
</span><span class="cx"> 
</span><span class="cx">     HashMap&lt;uint64_t, ErrorCallback&gt; m_errorCallbacks;
</span><span class="cx">     HashMap&lt;uint64_t, KeyDataCallback&gt; m_keyDataCallbacks;
</span><del>-    HashMap&lt;uint64_t, ValueDataCallback&gt; m_valueDataCallbacks;
</del><ins>+    HashMap&lt;uint64_t, GetResultCallback&gt; m_getResultCallbacks;
</ins><span class="cx">     HashMap&lt;uint64_t, CountCallback&gt; m_countCallbacks;
</span><span class="cx"> 
</span><span class="cx">     Timer m_transactionSchedulingTimer;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp (192122 => 192123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2015-11-06 23:58:09 UTC (rev 192122)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2015-11-07 01:12:55 UTC (rev 192123)
</span><span class="lines">@@ -188,11 +188,11 @@
</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().getRecord(requestData, keyRangeData, [this, self, requestData](const IDBError&amp; error, const ThreadSafeDataBuffer&amp; valueData) {
</del><ins>+    m_databaseConnection-&gt;database().getRecord(requestData, keyRangeData, [this, self, requestData](const IDBError&amp; error, const IDBGetResult&amp; result) {
</ins><span class="cx">         LOG(IndexedDB, &quot;UniqueIDBDatabaseTransaction::getRecord (callback)&quot;);
</span><span class="cx"> 
</span><span class="cx">         if (error.isNull())
</span><del>-            m_databaseConnection-&gt;connectionToClient().didGetRecord(IDBResultData::getRecordSuccess(requestData.requestIdentifier(), valueData));
</del><ins>+            m_databaseConnection-&gt;connectionToClient().didGetRecord(IDBResultData::getRecordSuccess(requestData.requestIdentifier(), result));
</ins><span class="cx">         else
</span><span class="cx">             m_databaseConnection-&gt;connectionToClient().didGetRecord(IDBResultData::error(requestData.requestIdentifier(), error));
</span><span class="cx">     });
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBResultDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp (192122 => 192123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp        2015-11-06 23:58:09 UTC (rev 192122)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp        2015-11-07 01:12:55 UTC (rev 192123)
</span><span class="lines">@@ -51,7 +51,6 @@
</span><span class="cx">     , m_error(other.m_error)
</span><span class="cx">     , m_databaseConnectionIdentifier(other.m_databaseConnectionIdentifier)
</span><span class="cx">     , m_resultInteger(other.m_resultInteger)
</span><del>-    , m_resultData(other.m_resultData)
</del><span class="cx"> {
</span><span class="cx">     if (other.m_databaseInfo)
</span><span class="cx">         m_databaseInfo = std::make_unique&lt;IDBDatabaseInfo&gt;(*other.m_databaseInfo);
</span><span class="lines">@@ -59,6 +58,8 @@
</span><span class="cx">         m_transactionInfo = std::make_unique&lt;IDBTransactionInfo&gt;(*other.m_transactionInfo);
</span><span class="cx">     if (other.m_resultKey)
</span><span class="cx">         m_resultKey = std::make_unique&lt;IDBKeyData&gt;(*other.m_resultKey);
</span><ins>+    if (other.m_getResult)
+        m_getResult = std::make_unique&lt;IDBGetResult&gt;(*other.m_getResult);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IDBResultData IDBResultData::error(const IDBResourceIdentifier&amp; requestIdentifier, const IDBError&amp; error)
</span><span class="lines">@@ -116,10 +117,10 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IDBResultData IDBResultData::getRecordSuccess(const IDBResourceIdentifier&amp; requestIdentifier, const ThreadSafeDataBuffer&amp; valueData)
</del><ins>+IDBResultData IDBResultData::getRecordSuccess(const IDBResourceIdentifier&amp; requestIdentifier, const IDBGetResult&amp; getResult)
</ins><span class="cx"> {
</span><span class="cx">     IDBResultData result(IDBResultType::GetRecordSuccess, requestIdentifier);
</span><del>-    result.m_resultData = valueData;
</del><ins>+    result.m_getResult = std::make_unique&lt;IDBGetResult&gt;(getResult);
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -147,6 +148,12 @@
</span><span class="cx">     return *m_transactionInfo;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+const IDBGetResult&amp; IDBResultData::getResult() const
+{
+    RELEASE_ASSERT(m_getResult);
+    return *m_getResult;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBResultDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h (192122 => 192123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h        2015-11-06 23:58:09 UTC (rev 192122)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h        2015-11-07 01:12:55 UTC (rev 192123)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;IDBDatabaseInfo.h&quot;
</span><span class="cx"> #include &quot;IDBError.h&quot;
</span><ins>+#include &quot;IDBGetResult.h&quot;
</ins><span class="cx"> #include &quot;IDBKeyData.h&quot;
</span><span class="cx"> #include &quot;IDBResourceIdentifier.h&quot;
</span><span class="cx"> #include &quot;IDBTransactionInfo.h&quot;
</span><span class="lines">@@ -69,7 +70,7 @@
</span><span class="cx">     static IDBResultData clearObjectStoreSuccess(const IDBResourceIdentifier&amp;);
</span><span class="cx">     static IDBResultData createIndexSuccess(const IDBResourceIdentifier&amp;);
</span><span class="cx">     static IDBResultData putOrAddSuccess(const IDBResourceIdentifier&amp;, const IDBKeyData&amp;);
</span><del>-    static IDBResultData getRecordSuccess(const IDBResourceIdentifier&amp;, const ThreadSafeDataBuffer&amp; valueData);
</del><ins>+    static IDBResultData getRecordSuccess(const IDBResourceIdentifier&amp;, const IDBGetResult&amp;);
</ins><span class="cx">     static IDBResultData getCountSuccess(const IDBResourceIdentifier&amp;, uint64_t count);
</span><span class="cx">     static IDBResultData deleteRecordSuccess(const IDBResourceIdentifier&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -85,9 +86,10 @@
</span><span class="cx">     const IDBTransactionInfo&amp; transactionInfo() const;
</span><span class="cx"> 
</span><span class="cx">     const IDBKeyData* resultKey() const { return m_resultKey.get(); }
</span><del>-    const ThreadSafeDataBuffer&amp; resultData() const { return m_resultData; }
</del><span class="cx">     uint64_t resultInteger() const { return m_resultInteger; }
</span><span class="cx"> 
</span><ins>+    const IDBGetResult&amp; getResult() const;
+
</ins><span class="cx"> private:
</span><span class="cx">     IDBResultData(const IDBResourceIdentifier&amp;);
</span><span class="cx">     IDBResultData(IDBResultType, const IDBResourceIdentifier&amp;);
</span><span class="lines">@@ -100,8 +102,8 @@
</span><span class="cx">     std::unique_ptr&lt;IDBDatabaseInfo&gt; m_databaseInfo;
</span><span class="cx">     std::unique_ptr&lt;IDBTransactionInfo&gt; m_transactionInfo;
</span><span class="cx">     std::unique_ptr&lt;IDBKeyData&gt; m_resultKey;
</span><ins>+    std::unique_ptr&lt;IDBGetResult&gt; m_getResult;
</ins><span class="cx">     uint64_t m_resultInteger { 0 };
</span><del>-    ThreadSafeDataBuffer m_resultData;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (192122 => 192123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-11-06 23:58:09 UTC (rev 192122)
+++ trunk/Source/WebKit2/ChangeLog        2015-11-07 01:12:55 UTC (rev 192123)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-11-06  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Modern IDB: Make the result data for a &quot;get&quot; request be an IDBGetResult.
+        https://bugs.webkit.org/show_bug.cgi?id=150985
+
+        Reviewed by Alex Christensen.
+
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::ArgumentCoder&lt;IDBGetResult&gt;::encode):
+        (IPC::ArgumentCoder&lt;IDBGetResult&gt;::decode):
+
</ins><span class="cx"> 2015-11-06  Tim Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add preliminary (SPI) support for NSTextFinder on WKWebView
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCoreArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp (192122 => 192123)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2015-11-06 23:58:09 UTC (rev 192122)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2015-11-07 01:12:55 UTC (rev 192123)
</span><span class="lines">@@ -1827,11 +1827,11 @@
</span><span class="cx"> 
</span><span class="cx"> void ArgumentCoder&lt;IDBGetResult&gt;::encode(ArgumentEncoder&amp; encoder, const IDBGetResult&amp; result)
</span><span class="cx"> {
</span><del>-    bool nullData = !result.valueBuffer;
</del><ins>+    bool nullData = !result.valueBuffer.data();
</ins><span class="cx">     encoder &lt;&lt; nullData;
</span><span class="cx"> 
</span><span class="cx">     if (!nullData)
</span><del>-        encoder &lt;&lt; DataReference(reinterpret_cast&lt;const uint8_t*&gt;(result.valueBuffer-&gt;data()), result.valueBuffer-&gt;size());
</del><ins>+        encoder &lt;&lt; DataReference(result.valueBuffer.data()-&gt;data(), result.valueBuffer.data()-&gt;size());
</ins><span class="cx"> 
</span><span class="cx">     encoder &lt;&lt; result.keyData &lt;&lt; result.keyPath;
</span><span class="cx"> }
</span><span class="lines">@@ -1843,13 +1843,15 @@
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (nullData)
</span><del>-        result.valueBuffer = nullptr;
</del><ins>+        result.valueBuffer = { };
</ins><span class="cx">     else {
</span><span class="cx">         DataReference data;
</span><span class="cx">         if (!decoder.decode(data))
</span><span class="cx">             return false;
</span><span class="cx"> 
</span><del>-        result.valueBuffer = SharedBuffer::create(data.data(), data.size());
</del><ins>+        Vector&lt;uint8_t&gt; vector(data.size());
+        memcpy(vector.data(), data.data(), data.size());
+        result.valueBuffer = ThreadSafeDataBuffer::adoptVector(vector);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!decoder.decode(result.keyData))
</span></span></pre>
</div>
</div>

</body>
</html>