<!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 "get" 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<IDBGetResult>::encode):
(IPC::ArgumentCoder<IDBGetResult>::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 <beidson@apple.com>
+
+ Modern IDB: Make the result data for a "get" 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 <cdumez@apple.com>
</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 "IDBKeyData.h"
</span><span class="cx"> #include "IDBKeyPath.h"
</span><span class="cx"> #include "SharedBuffer.h"
</span><ins>+#include "ThreadSafeDataBuffer.h"
</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<SharedBuffer> buffer)
</span><ins>+ {
+ if (buffer)
+ dataFromBuffer(*buffer);
+ }
+
+ IDBGetResult(const ThreadSafeDataBuffer& 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<SharedBuffer> buffer, PassRefPtr<IDBKey> key, const IDBKeyPath& 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& buffer)
+ {
+ Vector<uint8_t> 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->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<SharedBuffer> 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->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->onSuccess();
</span><span class="cx"> else
</span><span class="cx"> m_callbacks->onSuccess(result.keyData.maybeCreateIDBKey());
</span><span class="cx"> } else {
</span><ins>+ auto valueBuffer = SharedBuffer::create(result.valueBuffer.data()->data(), result.valueBuffer.data()->size());
</ins><span class="cx"> if (!result.keyData.isNull())
</span><del>- m_callbacks->onSuccess(result.valueBuffer, result.keyData.maybeCreateIDBKey(), result.keyPath);
</del><ins>+ m_callbacks->onSuccess(valueBuffer, result.keyData.maybeCreateIDBKey(), result.keyPath);
</ins><span class="cx"> else
</span><del>- m_callbacks->onSuccess(result.valueBuffer.get());
</del><ins>+ m_callbacks->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& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&) = 0;
</span><span class="cx"> virtual IDBError putRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, const ThreadSafeDataBuffer& value) = 0;
</span><span class="cx"> virtual IDBError getRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&, ThreadSafeDataBuffer& outValue) = 0;
</span><del>- virtual IDBError getIndexRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&, ThreadSafeDataBuffer& outValue) = 0;
</del><ins>+ virtual IDBError getIndexRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&, IDBGetResult& outValue) = 0;
</ins><span class="cx"> virtual IDBError getCount(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData&, uint64_t& outCount) = 0;
</span><span class="cx"> virtual IDBError generateKeyNumber(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t& 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& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType recordType, const IDBKeyRangeData& range, ThreadSafeDataBuffer& outValue)
</del><ins>+IDBError MemoryIDBBackingStore::getIndexRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType recordType, const IDBKeyRangeData& range, IDBGetResult& outValue)
</ins><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "MemoryIDBBackingStore::getIndexRecord");
</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& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&) override final;
</span><span class="cx"> virtual IDBError putRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, const ThreadSafeDataBuffer& value) override final;
</span><span class="cx"> virtual IDBError getRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&, ThreadSafeDataBuffer& outValue) override final;
</span><del>- virtual IDBError getIndexRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&, ThreadSafeDataBuffer& outValue) override final;
</del><ins>+ virtual IDBError getIndexRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&, IDBGetResult& outValue) override final;
</ins><span class="cx"> virtual IDBError getCount(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData&, uint64_t& outCount) override final;
</span><span class="cx"> virtual IDBError generateKeyNumber(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t& 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 "ThreadSafeDataBuffer.h"
</del><ins>+#include "IDBGetResult.h"
</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&) const
</del><ins>+IDBGetResult MemoryIndex::valueForKeyRange(IndexedDB::IndexRecordType, const IDBKeyRangeData&) 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 "IDBGetResult.h"
</ins><span class="cx"> #include "IDBIndexInfo.h"
</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& info() const { return m_info; }
</span><span class="cx">
</span><del>- ThreadSafeDataBuffer valueForKeyRange(IndexedDB::IndexRecordType, const IDBKeyRangeData&) const;
</del><ins>+ IDBGetResult valueForKeyRange(IndexedDB::IndexRecordType, const IDBKeyRangeData&) const;
</ins><span class="cx"> uint64_t countForKeyRange(const IDBKeyRangeData&);
</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->get(key);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ThreadSafeDataBuffer MemoryObjectStore::indexValueForKeyRange(uint64_t indexIdentifier, IndexedDB::IndexRecordType recordType, const IDBKeyRangeData& range) const
</del><ins>+IDBGetResult MemoryObjectStore::indexValueForKeyRange(uint64_t indexIdentifier, IndexedDB::IndexRecordType recordType, const IDBKeyRangeData& range) const
</ins><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "MemoryObjectStore::indexValueForKeyRange");
</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<KeyValueMap>&&);
</span><span class="cx">
</span><span class="cx"> ThreadSafeDataBuffer valueForKeyRange(const IDBKeyRangeData&) const;
</span><del>- ThreadSafeDataBuffer indexValueForKeyRange(uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&) const;
</del><ins>+ IDBGetResult indexValueForKeyRange(uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&) const;
</ins><span class="cx"> uint64_t countForKeyRange(uint64_t indexIdentifier, const IDBKeyRangeData&) const;
</span><span class="cx">
</span><span class="cx"> const IDBObjectStoreInfo& 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& requestData, const IDBKeyRangeData& range, ValueDataCallback callback)
</del><ins>+void UniqueIDBDatabase::getRecord(const IDBRequestData& requestData, const IDBKeyRangeData& range, GetResultCallback callback)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(isMainThread());
</span><span class="cx"> LOG(IndexedDB, "(main) UniqueIDBDatabase::getRecord");
</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->getIndexRecord(transactionIdentifier, objectStoreIdentifier, indexIdentifier, recordType, range, valueData);
</del><ins>+ IDBGetResult result;
+ IDBError error = m_backingStore->getIndexRecord(transactionIdentifier, objectStoreIdentifier, indexIdentifier, recordType, range, result);
</ins><span class="cx">
</span><del>- m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &UniqueIDBDatabase::didPerformGetRecord, callbackIdentifier, error, valueData));
</del><ins>+ m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &UniqueIDBDatabase::didPerformGetRecord, callbackIdentifier, error, result));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void UniqueIDBDatabase::didPerformGetRecord(uint64_t callbackIdentifier, const IDBError& error, const ThreadSafeDataBuffer& resultData)
</del><ins>+void UniqueIDBDatabase::didPerformGetRecord(uint64_t callbackIdentifier, const IDBError& error, const IDBGetResult& result)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(isMainThread());
</span><span class="cx"> LOG(IndexedDB, "(main) UniqueIDBDatabase::didPerformGetRecord");
</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& requestData, const IDBKeyRangeData& 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& error, const ThreadSafeDataBuffer& resultData)
</del><ins>+void UniqueIDBDatabase::performGetResultCallback(uint64_t callbackIdentifier, const IDBError& error, const IDBGetResult& 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 "IDBBackingStore.h"
</span><span class="cx"> #include "IDBDatabaseIdentifier.h"
</span><span class="cx"> #include "IDBDatabaseInfo.h"
</span><ins>+#include "IDBGetResult.h"
</ins><span class="cx"> #include "IDBServerOperation.h"
</span><span class="cx"> #include "ThreadSafeDataBuffer.h"
</span><span class="cx"> #include "Timer.h"
</span><span class="lines">@@ -59,7 +60,7 @@
</span><span class="cx">
</span><span class="cx"> typedef std::function<void(const IDBError&)> ErrorCallback;
</span><span class="cx"> typedef std::function<void(const IDBError&, const IDBKeyData&)> KeyDataCallback;
</span><del>-typedef std::function<void(const IDBError&, const ThreadSafeDataBuffer&)> ValueDataCallback;
</del><ins>+typedef std::function<void(const IDBError&, const IDBGetResult&)> GetResultCallback;
</ins><span class="cx"> typedef std::function<void(const IDBError&, uint64_t)> CountCallback;
</span><span class="cx">
</span><span class="cx"> class UniqueIDBDatabase : public ThreadSafeRefCounted<UniqueIDBDatabase> {
</span><span class="lines">@@ -79,7 +80,7 @@
</span><span class="cx"> void clearObjectStore(UniqueIDBDatabaseTransaction&, uint64_t objectStoreIdentifier, ErrorCallback);
</span><span class="cx"> void createIndex(UniqueIDBDatabaseTransaction&, const IDBIndexInfo&, ErrorCallback);
</span><span class="cx"> void putOrAdd(const IDBRequestData&, const IDBKeyData&, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode, KeyDataCallback);
</span><del>- void getRecord(const IDBRequestData&, const IDBKeyRangeData&, ValueDataCallback);
</del><ins>+ void getRecord(const IDBRequestData&, const IDBKeyRangeData&, GetResultCallback);
</ins><span class="cx"> void getCount(const IDBRequestData&, const IDBKeyRangeData&, CountCallback);
</span><span class="cx"> void deleteRecord(const IDBRequestData&, const IDBKeyRangeData&, ErrorCallback);
</span><span class="cx"> void commitTransaction(UniqueIDBDatabaseTransaction&, ErrorCallback);
</span><span class="lines">@@ -125,7 +126,7 @@
</span><span class="cx"> void didPerformClearObjectStore(uint64_t callbackIdentifier, const IDBError&);
</span><span class="cx"> void didPerformCreateIndex(uint64_t callbackIdentifier, const IDBError&, const IDBIndexInfo&);
</span><span class="cx"> void didPerformPutOrAdd(uint64_t callbackIdentifier, const IDBError&, const IDBKeyData&);
</span><del>- void didPerformGetRecord(uint64_t callbackIdentifier, const IDBError&, const ThreadSafeDataBuffer&);
</del><ins>+ void didPerformGetRecord(uint64_t callbackIdentifier, const IDBError&, const IDBGetResult&);
</ins><span class="cx"> void didPerformGetCount(uint64_t callbackIdentifier, const IDBError&, uint64_t);
</span><span class="cx"> void didPerformDeleteRecord(uint64_t callbackIdentifier, const IDBError&);
</span><span class="cx"> void didPerformCommitTransaction(uint64_t callbackIdentifier, const IDBError&, const IDBResourceIdentifier& 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&);
</span><span class="cx"> void performKeyDataCallback(uint64_t callbackIdentifier, const IDBError&, const IDBKeyData&);
</span><del>- void performValueDataCallback(uint64_t callbackIdentifier, const IDBError&, const ThreadSafeDataBuffer&);
</del><ins>+ void performGetResultCallback(uint64_t callbackIdentifier, const IDBError&, const IDBGetResult&);
</ins><span class="cx"> void performCountCallback(uint64_t callbackIdentifier, const IDBError&, 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<uint64_t, ErrorCallback> m_errorCallbacks;
</span><span class="cx"> HashMap<uint64_t, KeyDataCallback> m_keyDataCallbacks;
</span><del>- HashMap<uint64_t, ValueDataCallback> m_valueDataCallbacks;
</del><ins>+ HashMap<uint64_t, GetResultCallback> m_getResultCallbacks;
</ins><span class="cx"> HashMap<uint64_t, CountCallback> 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<UniqueIDBDatabaseTransaction> self(this);
</span><del>- m_databaseConnection->database().getRecord(requestData, keyRangeData, [this, self, requestData](const IDBError& error, const ThreadSafeDataBuffer& valueData) {
</del><ins>+ m_databaseConnection->database().getRecord(requestData, keyRangeData, [this, self, requestData](const IDBError& error, const IDBGetResult& result) {
</ins><span class="cx"> LOG(IndexedDB, "UniqueIDBDatabaseTransaction::getRecord (callback)");
</span><span class="cx">
</span><span class="cx"> if (error.isNull())
</span><del>- m_databaseConnection->connectionToClient().didGetRecord(IDBResultData::getRecordSuccess(requestData.requestIdentifier(), valueData));
</del><ins>+ m_databaseConnection->connectionToClient().didGetRecord(IDBResultData::getRecordSuccess(requestData.requestIdentifier(), result));
</ins><span class="cx"> else
</span><span class="cx"> m_databaseConnection->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<IDBDatabaseInfo>(*other.m_databaseInfo);
</span><span class="lines">@@ -59,6 +58,8 @@
</span><span class="cx"> m_transactionInfo = std::make_unique<IDBTransactionInfo>(*other.m_transactionInfo);
</span><span class="cx"> if (other.m_resultKey)
</span><span class="cx"> m_resultKey = std::make_unique<IDBKeyData>(*other.m_resultKey);
</span><ins>+ if (other.m_getResult)
+ m_getResult = std::make_unique<IDBGetResult>(*other.m_getResult);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> IDBResultData IDBResultData::error(const IDBResourceIdentifier& requestIdentifier, const IDBError& 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& requestIdentifier, const ThreadSafeDataBuffer& valueData)
</del><ins>+IDBResultData IDBResultData::getRecordSuccess(const IDBResourceIdentifier& requestIdentifier, const IDBGetResult& 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<IDBGetResult>(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& 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 "IDBDatabaseInfo.h"
</span><span class="cx"> #include "IDBError.h"
</span><ins>+#include "IDBGetResult.h"
</ins><span class="cx"> #include "IDBKeyData.h"
</span><span class="cx"> #include "IDBResourceIdentifier.h"
</span><span class="cx"> #include "IDBTransactionInfo.h"
</span><span class="lines">@@ -69,7 +70,7 @@
</span><span class="cx"> static IDBResultData clearObjectStoreSuccess(const IDBResourceIdentifier&);
</span><span class="cx"> static IDBResultData createIndexSuccess(const IDBResourceIdentifier&);
</span><span class="cx"> static IDBResultData putOrAddSuccess(const IDBResourceIdentifier&, const IDBKeyData&);
</span><del>- static IDBResultData getRecordSuccess(const IDBResourceIdentifier&, const ThreadSafeDataBuffer& valueData);
</del><ins>+ static IDBResultData getRecordSuccess(const IDBResourceIdentifier&, const IDBGetResult&);
</ins><span class="cx"> static IDBResultData getCountSuccess(const IDBResourceIdentifier&, uint64_t count);
</span><span class="cx"> static IDBResultData deleteRecordSuccess(const IDBResourceIdentifier&);
</span><span class="cx">
</span><span class="lines">@@ -85,9 +86,10 @@
</span><span class="cx"> const IDBTransactionInfo& transactionInfo() const;
</span><span class="cx">
</span><span class="cx"> const IDBKeyData* resultKey() const { return m_resultKey.get(); }
</span><del>- const ThreadSafeDataBuffer& resultData() const { return m_resultData; }
</del><span class="cx"> uint64_t resultInteger() const { return m_resultInteger; }
</span><span class="cx">
</span><ins>+ const IDBGetResult& getResult() const;
+
</ins><span class="cx"> private:
</span><span class="cx"> IDBResultData(const IDBResourceIdentifier&);
</span><span class="cx"> IDBResultData(IDBResultType, const IDBResourceIdentifier&);
</span><span class="lines">@@ -100,8 +102,8 @@
</span><span class="cx"> std::unique_ptr<IDBDatabaseInfo> m_databaseInfo;
</span><span class="cx"> std::unique_ptr<IDBTransactionInfo> m_transactionInfo;
</span><span class="cx"> std::unique_ptr<IDBKeyData> m_resultKey;
</span><ins>+ std::unique_ptr<IDBGetResult> 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 <beidson@apple.com>
+
+ Modern IDB: Make the result data for a "get" request be an IDBGetResult.
+ https://bugs.webkit.org/show_bug.cgi?id=150985
+
+ Reviewed by Alex Christensen.
+
+ * Shared/WebCoreArgumentCoders.cpp:
+ (IPC::ArgumentCoder<IDBGetResult>::encode):
+ (IPC::ArgumentCoder<IDBGetResult>::decode):
+
</ins><span class="cx"> 2015-11-06 Tim Horton <timothy_horton@apple.com>
</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<IDBGetResult>::encode(ArgumentEncoder& encoder, const IDBGetResult& result)
</span><span class="cx"> {
</span><del>- bool nullData = !result.valueBuffer;
</del><ins>+ bool nullData = !result.valueBuffer.data();
</ins><span class="cx"> encoder << nullData;
</span><span class="cx">
</span><span class="cx"> if (!nullData)
</span><del>- encoder << DataReference(reinterpret_cast<const uint8_t*>(result.valueBuffer->data()), result.valueBuffer->size());
</del><ins>+ encoder << DataReference(result.valueBuffer.data()->data(), result.valueBuffer.data()->size());
</ins><span class="cx">
</span><span class="cx"> encoder << result.keyData << 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<uint8_t> 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>