<!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>[208194] trunk</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/208194">208194</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-10-31 16:43:50 -0700 (Mon, 31 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
&lt;rdar://problem/28806934&gt; and https://bugs.webkit.org/show_bug.cgi?id=164097

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/IndexedDB/idbobjectstore_getAll-expected.txt:
* web-platform-tests/IndexedDB/idbobjectstore_getAllKeys-expected.txt:

Source/WebCore:

Tests: storage/indexeddb/modern/idbobjectstore-getall-1-private.html
       storage/indexeddb/modern/idbobjectstore-getall-1.html
       storage/indexeddb/modern/idbobjectstore-getallkeys-1-private.html
       storage/indexeddb/modern/idbobjectstore-getallkeys-1.html
       Existing imported W3C tests.

- Add new objects for &quot;IDBGetAllRequestData&quot; and &quot;IDBGetAllResult&quot; to represent these
  new requests and responses.
- Add lots of boilerplate code to move these new objects around in the IDB machinery.
- Update &quot;GetRecord&quot; code to be shared with &quot;GetAll&quot; code where necessary.
- Other tweaks here and there.

* WebCore.xcodeproj/project.pbxproj:
* CMakeLists.txt:

* Modules/indexeddb/IDBGetAllResult.cpp: Added.
(WebCore::isolatedCopyOfVariant):
(WebCore::IDBGetAllResult::isolatedCopy):
(WebCore::IDBGetAllResult::addKey):
(WebCore::IDBGetAllResult::addValue):
(WebCore::IDBGetAllResult::keys):
(WebCore::IDBGetAllResult::values):
(WebCore::IDBGetAllResult::allBlobFilePaths):
* Modules/indexeddb/IDBGetAllResult.h: Added.
(WebCore::IDBGetAllResult::IDBGetAllResult):
(WebCore::IDBGetAllResult::type):
(WebCore::IDBGetAllResult::encode):
(WebCore::IDBGetAllResult::decode):

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::getAll):
(WebCore::IDBObjectStore::getAllKeys):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::setResult):
* Modules/indexeddb/IDBRequest.h:

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
(WebCore::IDBTransaction::getAllRecordsOnServer):
(WebCore::IDBTransaction::didGetAllRecordsOnServer):
* Modules/indexeddb/IDBTransaction.h:

* Modules/indexeddb/IndexedDB.h:

* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::getAllRecords):
* Modules/indexeddb/client/IDBConnectionProxy.h:

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

* Modules/indexeddb/server/IDBBackingStore.h:

* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::didGetAllRecords):
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:

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

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

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

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::queryForGetAllRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllRecords):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::hasAnyPendingCallbacks):
(WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
(WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
(WebCore::IDBServer::UniqueIDBDatabase::performGetAllRecords):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformGetAllRecords):
(WebCore::IDBServer::UniqueIDBDatabase::performGetAllResultsCallback):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

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

* Modules/indexeddb/shared/IDBGetAllRecordsData.cpp: Added.
(WebCore::IDBGetAllRecordsData::isolatedCopy):
* Modules/indexeddb/shared/IDBGetAllRecordsData.h: Added.
(WebCore::IDBGetAllRecordsData::encode):
(WebCore::IDBGetAllRecordsData::decode):

* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::IDBResultData):
(WebCore::IDBResultData::getAllRecordsSuccess):
(WebCore::IDBResultData::getAllResult):
* Modules/indexeddb/shared/IDBResultData.h:
(WebCore::IDBResultData::encode):
(WebCore::IDBResultData::decode):

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

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::deserializeIDBValueToJSValue):
(WebCore::toJS):
* bindings/js/IDBBindingUtilities.h:

Source/WebKit2:

- Handle moving &quot;Get All&quot; requests to and from the DatabaseProcess.
- Handle the additional task of creating/passing Sandbox Extensions for
  referenced files when necessary.

* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::handleGetResult):
(WebKit::WebIDBConnectionToClient::didGetAllRecords):
(WebKit::WebIDBConnectionToClient::getAllRecords):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:

* Shared/WebCoreArgumentCoders.h:

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::getAllRecords):
(WebKit::preregisterSandboxExtensionsIfNecessary):
(WebKit::WebIDBConnectionToServer::didGetAllRecords):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:

LayoutTests:

* storage/indexeddb/modern/idbobjectstore-getall-1-expected.txt: Added.
* storage/indexeddb/modern/idbobjectstore-getall-1-private-expected.txt: Added.
* storage/indexeddb/modern/idbobjectstore-getall-1-private.html: Added.
* storage/indexeddb/modern/idbobjectstore-getall-1.html: Added.
* storage/indexeddb/modern/idbobjectstore-getallkeys-1-expected.txt: Added.
* storage/indexeddb/modern/idbobjectstore-getallkeys-1-private-expected.txt: Added.
* storage/indexeddb/modern/idbobjectstore-getallkeys-1-private.html: Added.
* storage/indexeddb/modern/idbobjectstore-getallkeys-1.html: Added.
* storage/indexeddb/modern/resources/idbobjectstore-getall-1.js: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsIndexedDBidbobjectstore_getAllexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_getAll-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsIndexedDBidbobjectstore_getAllKeysexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_getAllKeys-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStoreh">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStoreidl">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBRequestcpp">trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBRequesth">trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactioncpp">trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactionh">trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIndexedDBh">trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxycpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxyh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerDelegateh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBBackingStoreh">trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClientcpp">trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClienth">trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClientDelegateh">trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBServercpp">trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBServerh">trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h</a></li>
<li><a href="#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="#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="#trunkSourceWebCoreModulesindexeddbserverSQLiteIDBBackingStorecpp">trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverSQLiteIDBBackingStoreh">trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactioncpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactionh">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h</a></li>
<li><a href="#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="#trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServercpp">trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServerh">trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp">trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsIDBBindingUtilitiesh">trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClientcpp">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClienth">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClientmessagesin">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in</a></li>
<li><a href="#trunkSourceWebKit2PlatformIPCArgumentCodersh">trunk/Source/WebKit2/Platform/IPC/ArgumentCoders.h</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCoreArgumentCodersh">trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServercpp">trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServerh">trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServermessagesin">trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetall1expectedtxt">trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getall-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetall1privateexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getall-1-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetall1privatehtml">trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getall-1-private.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetall1html">trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getall-1.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetallkeys1expectedtxt">trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getallkeys-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetallkeys1privateexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getallkeys-1-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetallkeys1privatehtml">trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getallkeys-1-private.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetallkeys1html">trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getallkeys-1.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernresourcesidbobjectstoregetall1js">trunk/LayoutTests/storage/indexeddb/modern/resources/idbobjectstore-getall-1.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernresourcesidbobjectstoregetallkeys1js">trunk/LayoutTests/storage/indexeddb/modern/resources/idbobjectstore-getallkeys-1.js</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBGetAllResultcpp">trunk/Source/WebCore/Modules/indexeddb/IDBGetAllResult.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBGetAllResulth">trunk/Source/WebCore/Modules/indexeddb/IDBGetAllResult.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBGetAllRecordsDatacpp">trunk/Source/WebCore/Modules/indexeddb/shared/IDBGetAllRecordsData.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBGetAllRecordsDatah">trunk/Source/WebCore/Modules/indexeddb/shared/IDBGetAllRecordsData.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/LayoutTests/ChangeLog        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2016-10-31  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
+        &lt;rdar://problem/28806934&gt; and https://bugs.webkit.org/show_bug.cgi?id=164097
+
+        Reviewed by Darin Adler.
+
+        * storage/indexeddb/modern/idbobjectstore-getall-1-expected.txt: Added.
+        * storage/indexeddb/modern/idbobjectstore-getall-1-private-expected.txt: Added.
+        * storage/indexeddb/modern/idbobjectstore-getall-1-private.html: Added.
+        * storage/indexeddb/modern/idbobjectstore-getall-1.html: Added.
+        * storage/indexeddb/modern/idbobjectstore-getallkeys-1-expected.txt: Added.
+        * storage/indexeddb/modern/idbobjectstore-getallkeys-1-private-expected.txt: Added.
+        * storage/indexeddb/modern/idbobjectstore-getallkeys-1-private.html: Added.
+        * storage/indexeddb/modern/idbobjectstore-getallkeys-1.html: Added.
+        * storage/indexeddb/modern/resources/idbobjectstore-getall-1.js: Added.
+
</ins><span class="cx"> 2016-10-31  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Marking two http/tests/websocket/tests/hybi tests as flaky.
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-10-31  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
+        &lt;rdar://problem/28806934&gt; and https://bugs.webkit.org/show_bug.cgi?id=164097
+
+        Reviewed by Darin Adler.
+
+        * web-platform-tests/IndexedDB/idbobjectstore_getAll-expected.txt:
+        * web-platform-tests/IndexedDB/idbobjectstore_getAllKeys-expected.txt:
+
</ins><span class="cx"> 2016-10-31  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         CSSStyleDeclaration should be annotated with CEReactions
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsIndexedDBidbobjectstore_getAllexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_getAll-expected.txt (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_getAll-expected.txt        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_getAll-expected.txt        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -1,14 +1,14 @@
</span><span class="cx"> 
</span><del>-FAIL Single item get store.getAll is not a function. (In 'store.getAll(range, maxCount)', 'store.getAll' is undefined)
-FAIL Single item get (generated key) store.getAll is not a function. (In 'store.getAll(range, maxCount)', 'store.getAll' is undefined)
-FAIL getAll on empty object store store.getAll is not a function. (In 'store.getAll(range, maxCount)', 'store.getAll' is undefined)
-FAIL Get all values store.getAll is not a function. (In 'store.getAll(range, maxCount)', 'store.getAll' is undefined)
-FAIL Test maxCount store.getAll is not a function. (In 'store.getAll(range, maxCount)', 'store.getAll' is undefined)
-FAIL Get bound range store.getAll is not a function. (In 'store.getAll(range, maxCount)', 'store.getAll' is undefined)
-FAIL Get bound range with maxCount store.getAll is not a function. (In 'store.getAll(range, maxCount)', 'store.getAll' is undefined)
-FAIL Get upper excluded store.getAll is not a function. (In 'store.getAll(range, maxCount)', 'store.getAll' is undefined)
-FAIL Get lower excluded store.getAll is not a function. (In 'store.getAll(range, maxCount)', 'store.getAll' is undefined)
-FAIL Get bound range (generated) with maxCount store.getAll is not a function. (In 'store.getAll(range, maxCount)', 'store.getAll' is undefined)
-FAIL Non existent key store.getAll is not a function. (In 'store.getAll(range, maxCount)', 'store.getAll' is undefined)
-FAIL zero maxCount store.getAll is not a function. (In 'store.getAll(range, maxCount)', 'store.getAll' is undefined)
</del><ins>+PASS Single item get 
+PASS Single item get (generated key) 
+PASS getAll on empty object store 
+PASS Get all values 
+PASS Test maxCount 
+PASS Get bound range 
+PASS Get bound range with maxCount 
+PASS Get upper excluded 
+PASS Get lower excluded 
+PASS Get bound range (generated) with maxCount 
+PASS Non existent key 
+PASS zero maxCount 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsIndexedDBidbobjectstore_getAllKeysexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_getAllKeys-expected.txt (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_getAllKeys-expected.txt        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_getAllKeys-expected.txt        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -1,14 +1,14 @@
</span><span class="cx"> 
</span><del>-FAIL Single item get store.getAllKeys is not a function. (In 'store.getAllKeys(range, maxCount)', 'store.getAllKeys' is undefined)
-FAIL Single item get (generated key) store.getAllKeys is not a function. (In 'store.getAllKeys(range, maxCount)', 'store.getAllKeys' is undefined)
-FAIL getAllKeys on empty object store store.getAllKeys is not a function. (In 'store.getAllKeys(range, maxCount)', 'store.getAllKeys' is undefined)
-FAIL Get all values store.getAllKeys is not a function. (In 'store.getAllKeys(range, maxCount)', 'store.getAllKeys' is undefined)
-FAIL Test maxCount store.getAllKeys is not a function. (In 'store.getAllKeys(range, maxCount)', 'store.getAllKeys' is undefined)
-FAIL Get bound range store.getAllKeys is not a function. (In 'store.getAllKeys(range, maxCount)', 'store.getAllKeys' is undefined)
-FAIL Get bound range with maxCount store.getAllKeys is not a function. (In 'store.getAllKeys(range, maxCount)', 'store.getAllKeys' is undefined)
-FAIL Get upper excluded store.getAllKeys is not a function. (In 'store.getAllKeys(range, maxCount)', 'store.getAllKeys' is undefined)
-FAIL Get lower excluded store.getAllKeys is not a function. (In 'store.getAllKeys(range, maxCount)', 'store.getAllKeys' is undefined)
-FAIL Get bound range (generated) with maxCount store.getAllKeys is not a function. (In 'store.getAllKeys(range, maxCount)', 'store.getAllKeys' is undefined)
-FAIL Non existent key store.getAllKeys is not a function. (In 'store.getAllKeys(range, maxCount)', 'store.getAllKeys' is undefined)
-FAIL zero maxCount store.getAllKeys is not a function. (In 'store.getAllKeys(range, maxCount)', 'store.getAllKeys' is undefined)
</del><ins>+PASS Single item get 
+PASS Single item get (generated key) 
+PASS getAllKeys on empty object store 
+PASS Get all values 
+PASS Test maxCount 
+PASS Get bound range 
+PASS Get bound range with maxCount 
+PASS Get upper excluded 
+PASS Get lower excluded 
+PASS Get bound range (generated) with maxCount 
+PASS Non existent key 
+PASS zero maxCount 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetall1expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getall-1-expected.txt (0 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getall-1-expected.txt                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getall-1-expected.txt        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+Test IDBObjectStore.getAll()
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
+
+indexedDB.deleteDatabase(dbname)
+indexedDB.open(dbname)
+Initial upgrade needed: Old version - 0 New version - 1
+getAll() result is:
+[ 'false' '-10' '10' 'hello' 'hellothere' ]
+getAll(undefined, 4) result is:
+[ 'false' '-10' '10' 'hello' ]
+getAll(6) result is:
+[ ]
+getAll(3) result is:
+[ '10' ]
+getAll(IDBKeyRange.only(5)) result is:
+[ 'hellothere' ]
+getAll(IDBKeyRange.lowerBound(2)) result is:
+[ '-10' '10' 'hello' 'hellothere' ]
+getAll(IDBKeyRange.upperBound(2)) result is:
+[ 'false' '-10' ]
+getAll(IDBKeyRange.bound(2, 4)) result is:
+[ '-10' '10' 'hello' ]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetall1privateexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getall-1-private-expected.txt (0 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getall-1-private-expected.txt                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getall-1-private-expected.txt        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+Test IDBObjectStore.getAll()
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
+
+indexedDB.deleteDatabase(dbname)
+indexedDB.open(dbname)
+Initial upgrade needed: Old version - 0 New version - 1
+getAll() result is:
+[ 'false' '-10' '10' 'hello' 'hellothere' ]
+getAll(undefined, 4) result is:
+[ 'false' '-10' '10' 'hello' ]
+getAll(6) result is:
+[ ]
+getAll(3) result is:
+[ '10' ]
+getAll(IDBKeyRange.only(5)) result is:
+[ 'hellothere' ]
+getAll(IDBKeyRange.lowerBound(2)) result is:
+[ '-10' '10' 'hello' 'hellothere' ]
+getAll(IDBKeyRange.upperBound(2)) result is:
+[ 'false' '-10' ]
+getAll(IDBKeyRange.bound(2, 4)) result is:
+[ '-10' '10' 'hello' ]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetall1privatehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getall-1-private.html (0 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getall-1-private.html                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getall-1-private.html        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+enablePrivateBrowsing = true;
+&lt;/script&gt;
+&lt;script src=&quot;../../../resources/js-test.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/shared.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;script src=&quot;resources/idbobjectstore-getall-1.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetall1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getall-1.html (0 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getall-1.html                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getall-1.html        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../../resources/js-test.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/shared.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;script src=&quot;resources/idbobjectstore-getall-1.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetallkeys1expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getallkeys-1-expected.txt (0 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getallkeys-1-expected.txt                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getallkeys-1-expected.txt        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+Test IDBObjectStore.getAllKeys()
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
+
+indexedDB.deleteDatabase(dbname)
+indexedDB.open(dbname)
+Initial upgrade needed: Old version - 0 New version - 1
+getAllKeys() result is:
+[ '1' '2' '3' '4' '5' ]
+getAllKeys(undefined, 4) result is:
+[ '1' '2' '3' '4' ]
+getAllKeys(6) result is:
+[ ]
+getAllKeys(3) result is:
+[ '3' ]
+getAllKeys(IDBKeyRange.only(5)) result is:
+[ '5' ]
+getAllKeys(IDBKeyRange.lowerBound(2)) result is:
+[ '2' '3' '4' '5' ]
+getAllKeys(IDBKeyRange.upperBound(2)) result is:
+[ '1' '2' ]
+getAllKeys(IDBKeyRange.bound(2, 4)) result is:
+[ '2' '3' '4' ]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetallkeys1privateexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getallkeys-1-private-expected.txt (0 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getallkeys-1-private-expected.txt                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getallkeys-1-private-expected.txt        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+Test IDBObjectStore.getAllKeys()
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
+
+indexedDB.deleteDatabase(dbname)
+indexedDB.open(dbname)
+Initial upgrade needed: Old version - 0 New version - 1
+getAllKeys() result is:
+[ '1' '2' '3' '4' '5' ]
+getAllKeys(undefined, 4) result is:
+[ '1' '2' '3' '4' ]
+getAllKeys(6) result is:
+[ ]
+getAllKeys(3) result is:
+[ '3' ]
+getAllKeys(IDBKeyRange.only(5)) result is:
+[ '5' ]
+getAllKeys(IDBKeyRange.lowerBound(2)) result is:
+[ '2' '3' '4' '5' ]
+getAllKeys(IDBKeyRange.upperBound(2)) result is:
+[ '1' '2' ]
+getAllKeys(IDBKeyRange.bound(2, 4)) result is:
+[ '2' '3' '4' ]
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetallkeys1privatehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getallkeys-1-private.html (0 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getallkeys-1-private.html                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getallkeys-1-private.html        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+enablePrivateBrowsing = true;
+&lt;/script&gt;
+&lt;script src=&quot;../../../resources/js-test.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/shared.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;script src=&quot;resources/idbobjectstore-getallkeys-1.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetallkeys1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getallkeys-1.html (0 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getallkeys-1.html                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-getallkeys-1.html        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../../resources/js-test.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/shared.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;script src=&quot;resources/idbobjectstore-getallkeys-1.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernresourcesidbobjectstoregetall1js"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/resources/idbobjectstore-getall-1.js (0 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/resources/idbobjectstore-getall-1.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/resources/idbobjectstore-getall-1.js        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -0,0 +1,128 @@
</span><ins>+description(&quot;Test IDBObjectStore.getAll()&quot;);
+
+indexedDBTest(prepareDatabase);
+
+function done()
+{
+    finishJSTest();
+}
+
+function log(message)
+{
+    debug(message);
+}
+
+var testGenerator;
+
+function continueWithEvent(event)
+{
+    testGenerator.next(event);
+}
+
+function asyncContinue()
+{
+    setTimeout(&quot;testGenerator.next();&quot;, 0);
+}
+
+function idbRequest(request)
+{
+    request.onerror = continueWithEvent;
+    request.onsuccess = continueWithEvent;
+        return request;
+}
+
+var db;
+
+function prepareDatabase(event)
+{
+    debug(&quot;Initial upgrade needed: Old version - &quot; + event.oldVersion + &quot; New version - &quot; + event.newVersion);
+
+    db = event.target.result;
+    os = db.createObjectStore(&quot;foo&quot;);
+        os.add(false, 1);
+        os.add(-10, 2);
+        os.add(10, 3);
+        os.add(&quot;hello&quot;, 4);
+        os.add(&quot;hellothere&quot;, 5);
+
+    event.target.transaction.oncomplete = function() {
+        testGenerator = testSteps();
+        testGenerator.next();
+    };
+}
+
+function dumpArray(array)
+{
+        if (!array) {
+                debug(&quot;Undefined array&quot;);
+                return;
+        }
+
+        var string = &quot;[ &quot;;
+        for (var i = 0; i &lt; array.length; ++i)
+                string += &quot;'&quot; + array[i] + &quot;' &quot;;
+        string += &quot;]&quot;;
+        
+        debug(string);
+}
+
+function is(a, b, message) {
+    result = a == b ? &quot;true&quot; : &quot;false&quot;;
+    debug(message + &quot;: &quot; + result);
+}
+
+function* testSteps()
+{
+    objectStore = db.transaction(&quot;foo&quot;).objectStore(&quot;foo&quot;);

+        // Get everything
+    req = idbRequest(objectStore.getAll());
+    event = yield;    
+        debug(&quot;getAll() result is:&quot;);
+        dumpArray(req.result);
+
+        // Get everything, limit to 4
+    req = idbRequest(objectStore.getAll(undefined, 4));
+    event = yield;    
+        debug(&quot;getAll(undefined, 4) result is:&quot;);
+        dumpArray(req.result);
+        
+        // Non-existent key
+    req = idbRequest(objectStore.getAll(6));
+    event = yield;    
+        debug(&quot;getAll(6) result is:&quot;);
+        dumpArray(req.result);
+
+        // Existent key
+    req = idbRequest(objectStore.getAll(3));
+    event = yield;    
+        debug(&quot;getAll(3) result is:&quot;);
+        dumpArray(req.result);
+        
+        // Key range only
+    req = idbRequest(objectStore.getAll(IDBKeyRange.only(5)));
+    event = yield;    
+        debug(&quot;getAll(IDBKeyRange.only(5)) result is:&quot;);
+        dumpArray(req.result);
+
+        // Key range lower bound
+    req = idbRequest(objectStore.getAll(IDBKeyRange.lowerBound(2)));
+    event = yield;    
+        debug(&quot;getAll(IDBKeyRange.lowerBound(2)) result is:&quot;);
+        dumpArray(req.result);
+
+        // Key range upper bound
+    req = idbRequest(objectStore.getAll(IDBKeyRange.upperBound(2)));
+    event = yield;    
+        debug(&quot;getAll(IDBKeyRange.upperBound(2)) result is:&quot;);
+        dumpArray(req.result);
+
+        // Key range bound
+    req = idbRequest(objectStore.getAll(IDBKeyRange.bound(2, 4)));
+    event = yield;    
+        debug(&quot;getAll(IDBKeyRange.bound(2, 4)) result is:&quot;);
+        dumpArray(req.result);
+    
+    finishJSTest();
+ }

</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernresourcesidbobjectstoregetallkeys1js"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/resources/idbobjectstore-getallkeys-1.js (0 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/resources/idbobjectstore-getallkeys-1.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/resources/idbobjectstore-getallkeys-1.js        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -0,0 +1,128 @@
</span><ins>+description(&quot;Test IDBObjectStore.getAllKeys()&quot;);
+
+indexedDBTest(prepareDatabase);
+
+function done()
+{
+    finishJSTest();
+}
+
+function log(message)
+{
+    debug(message);
+}
+
+var testGenerator;
+
+function continueWithEvent(event)
+{
+    testGenerator.next(event);
+}
+
+function asyncContinue()
+{
+    setTimeout(&quot;testGenerator.next();&quot;, 0);
+}
+
+function idbRequest(request)
+{
+    request.onerror = continueWithEvent;
+    request.onsuccess = continueWithEvent;
+        return request;
+}
+
+var db;
+
+function prepareDatabase(event)
+{
+    debug(&quot;Initial upgrade needed: Old version - &quot; + event.oldVersion + &quot; New version - &quot; + event.newVersion);
+
+    db = event.target.result;
+    os = db.createObjectStore(&quot;foo&quot;);
+        os.add(false, 1);
+        os.add(-10, 2);
+        os.add(10, 3);
+        os.add(&quot;hello&quot;, 4);
+        os.add(&quot;hellothere&quot;, 5);
+
+    event.target.transaction.oncomplete = function() {
+        testGenerator = testSteps();
+        testGenerator.next();
+    };
+}
+
+function dumpArray(array)
+{
+        if (!array) {
+                debug(&quot;Undefined array&quot;);
+                return;
+        }
+
+        var string = &quot;[ &quot;;
+        for (var i = 0; i &lt; array.length; ++i)
+                string += &quot;'&quot; + array[i] + &quot;' &quot;;
+        string += &quot;]&quot;;
+        
+        debug(string);
+}
+
+function is(a, b, message) {
+    result = a == b ? &quot;true&quot; : &quot;false&quot;;
+    debug(message + &quot;: &quot; + result);
+}
+
+function* testSteps()
+{
+    objectStore = db.transaction(&quot;foo&quot;).objectStore(&quot;foo&quot;);

+        // Get everything
+    req = idbRequest(objectStore.getAllKeys());
+    event = yield;    
+        debug(&quot;getAllKeys() result is:&quot;);
+        dumpArray(req.result);
+
+        // Get everything, limit to 4
+    req = idbRequest(objectStore.getAllKeys(undefined, 4));
+    event = yield;    
+        debug(&quot;getAllKeys(undefined, 4) result is:&quot;);
+        dumpArray(req.result);
+        
+        // Non-existent key
+    req = idbRequest(objectStore.getAllKeys(6));
+    event = yield;    
+        debug(&quot;getAllKeys(6) result is:&quot;);
+        dumpArray(req.result);
+
+        // Existent key
+    req = idbRequest(objectStore.getAllKeys(3));
+    event = yield;    
+        debug(&quot;getAllKeys(3) result is:&quot;);
+        dumpArray(req.result);
+        
+        // Key range only
+    req = idbRequest(objectStore.getAllKeys(IDBKeyRange.only(5)));
+    event = yield;    
+        debug(&quot;getAllKeys(IDBKeyRange.only(5)) result is:&quot;);
+        dumpArray(req.result);
+
+        // Key range lower bound
+    req = idbRequest(objectStore.getAllKeys(IDBKeyRange.lowerBound(2)));
+    event = yield;    
+        debug(&quot;getAllKeys(IDBKeyRange.lowerBound(2)) result is:&quot;);
+        dumpArray(req.result);
+
+        // Key range upper bound
+    req = idbRequest(objectStore.getAllKeys(IDBKeyRange.upperBound(2)));
+    event = yield;    
+        debug(&quot;getAllKeys(IDBKeyRange.upperBound(2)) result is:&quot;);
+        dumpArray(req.result);
+
+        // Key range bound
+    req = idbRequest(objectStore.getAllKeys(IDBKeyRange.bound(2, 4)));
+    event = yield;    
+        debug(&quot;getAllKeys(IDBKeyRange.bound(2, 4)) result is:&quot;);
+        dumpArray(req.result);
+    
+    finishJSTest();
+ }

</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -824,6 +824,7 @@
</span><span class="cx">     Modules/indexeddb/IDBDatabaseIdentifier.cpp
</span><span class="cx">     Modules/indexeddb/IDBEventDispatcher.cpp
</span><span class="cx">     Modules/indexeddb/IDBFactory.cpp
</span><ins>+    Modules/indexeddb/IDBGetAllResult.cpp
</ins><span class="cx">     Modules/indexeddb/IDBGetResult.cpp
</span><span class="cx">     Modules/indexeddb/IDBIndex.cpp
</span><span class="cx">     Modules/indexeddb/IDBKey.cpp
</span><span class="lines">@@ -867,6 +868,7 @@
</span><span class="cx">     Modules/indexeddb/shared/IDBCursorInfo.cpp
</span><span class="cx">     Modules/indexeddb/shared/IDBDatabaseInfo.cpp
</span><span class="cx">     Modules/indexeddb/shared/IDBError.cpp
</span><ins>+    Modules/indexeddb/shared/IDBGetAllRecordsData.cpp
</ins><span class="cx">     Modules/indexeddb/shared/IDBGetRecordData.cpp
</span><span class="cx">     Modules/indexeddb/shared/IDBIndexInfo.cpp
</span><span class="cx">     Modules/indexeddb/shared/IDBObjectStoreInfo.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/ChangeLog        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -1,3 +1,128 @@
</span><ins>+2016-10-31  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
+        &lt;rdar://problem/28806934&gt; and https://bugs.webkit.org/show_bug.cgi?id=164097
+
+        Reviewed by Darin Adler.
+
+        Tests: storage/indexeddb/modern/idbobjectstore-getall-1-private.html
+               storage/indexeddb/modern/idbobjectstore-getall-1.html
+               storage/indexeddb/modern/idbobjectstore-getallkeys-1-private.html
+               storage/indexeddb/modern/idbobjectstore-getallkeys-1.html
+               Existing imported W3C tests.
+
+        - Add new objects for &quot;IDBGetAllRequestData&quot; and &quot;IDBGetAllResult&quot; to represent these
+          new requests and responses.
+        - Add lots of boilerplate code to move these new objects around in the IDB machinery.
+        - Update &quot;GetRecord&quot; code to be shared with &quot;GetAll&quot; code where necessary.
+        - Other tweaks here and there.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * CMakeLists.txt:
+
+        * Modules/indexeddb/IDBGetAllResult.cpp: Added.
+        (WebCore::isolatedCopyOfVariant):
+        (WebCore::IDBGetAllResult::isolatedCopy):
+        (WebCore::IDBGetAllResult::addKey):
+        (WebCore::IDBGetAllResult::addValue):
+        (WebCore::IDBGetAllResult::keys):
+        (WebCore::IDBGetAllResult::values):
+        (WebCore::IDBGetAllResult::allBlobFilePaths):
+        * Modules/indexeddb/IDBGetAllResult.h: Added.
+        (WebCore::IDBGetAllResult::IDBGetAllResult):
+        (WebCore::IDBGetAllResult::type):
+        (WebCore::IDBGetAllResult::encode):
+        (WebCore::IDBGetAllResult::decode):
+
+        * Modules/indexeddb/IDBObjectStore.cpp:
+        (WebCore::IDBObjectStore::getAll):
+        (WebCore::IDBObjectStore::getAllKeys):
+        * Modules/indexeddb/IDBObjectStore.h:
+        * Modules/indexeddb/IDBObjectStore.idl:
+
+        * Modules/indexeddb/IDBRequest.cpp:
+        (WebCore::IDBRequest::setResult):
+        * Modules/indexeddb/IDBRequest.h:
+
+        * Modules/indexeddb/IDBTransaction.cpp:
+        (WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
+        (WebCore::IDBTransaction::getAllRecordsOnServer):
+        (WebCore::IDBTransaction::didGetAllRecordsOnServer):
+        * Modules/indexeddb/IDBTransaction.h:
+
+        * Modules/indexeddb/IndexedDB.h:
+
+        * Modules/indexeddb/client/IDBConnectionProxy.cpp:
+        (WebCore::IDBClient::IDBConnectionProxy::getAllRecords):
+        * Modules/indexeddb/client/IDBConnectionProxy.h:
+
+        * Modules/indexeddb/client/IDBConnectionToServer.cpp:
+        (WebCore::IDBClient::IDBConnectionToServer::getAllRecords):
+        (WebCore::IDBClient::IDBConnectionToServer::didGetAllRecords):
+        * Modules/indexeddb/client/IDBConnectionToServer.h:
+        * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
+
+        * Modules/indexeddb/server/IDBBackingStore.h:
+
+        * Modules/indexeddb/server/IDBConnectionToClient.cpp:
+        (WebCore::IDBServer::IDBConnectionToClient::didGetAllRecords):
+        * Modules/indexeddb/server/IDBConnectionToClient.h:
+        * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
+
+        * Modules/indexeddb/server/IDBServer.cpp:
+        (WebCore::IDBServer::IDBServer::getAllRecords):
+        * Modules/indexeddb/server/IDBServer.h:
+
+        * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
+        (WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
+        * Modules/indexeddb/server/MemoryIDBBackingStore.h:
+
+        * Modules/indexeddb/server/MemoryObjectStore.cpp:
+        (WebCore::IDBServer::MemoryObjectStore::getAllRecords):
+        * Modules/indexeddb/server/MemoryObjectStore.h:
+
+        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
+        (WebCore::IDBServer::queryForGetAllRecords):
+        (WebCore::IDBServer::SQLiteIDBBackingStore::getAllRecords):
+        * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
+
+        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabase::hasAnyPendingCallbacks):
+        (WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
+        (WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
+        (WebCore::IDBServer::UniqueIDBDatabase::performGetAllRecords):
+        (WebCore::IDBServer::UniqueIDBDatabase::didPerformGetAllRecords):
+        (WebCore::IDBServer::UniqueIDBDatabase::performGetAllResultsCallback):
+        * Modules/indexeddb/server/UniqueIDBDatabase.h:
+
+        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getAllRecords):
+        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
+
+        * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp: Added.
+        (WebCore::IDBGetAllRecordsData::isolatedCopy):
+        * Modules/indexeddb/shared/IDBGetAllRecordsData.h: Added.
+        (WebCore::IDBGetAllRecordsData::encode):
+        (WebCore::IDBGetAllRecordsData::decode):
+
+        * Modules/indexeddb/shared/IDBResultData.cpp:
+        (WebCore::IDBResultData::IDBResultData):
+        (WebCore::IDBResultData::getAllRecordsSuccess):
+        (WebCore::IDBResultData::getAllResult):
+        * Modules/indexeddb/shared/IDBResultData.h:
+        (WebCore::IDBResultData::encode):
+        (WebCore::IDBResultData::decode):
+
+        * Modules/indexeddb/shared/InProcessIDBServer.cpp:
+        (WebCore::InProcessIDBServer::didGetAllRecords):
+        (WebCore::InProcessIDBServer::getAllRecords):
+        * Modules/indexeddb/shared/InProcessIDBServer.h:
+
+        * bindings/js/IDBBindingUtilities.cpp:
+        (WebCore::deserializeIDBValueToJSValue):
+        (WebCore::toJS):
+        * bindings/js/IDBBindingUtilities.h:
+
</ins><span class="cx"> 2016-10-31  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         GTK+ and EFL build fixes after r208176.
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBGetAllResultcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/indexeddb/IDBGetAllResult.cpp (0 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBGetAllResult.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBGetAllResult.cpp        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -0,0 +1,111 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;IDBGetAllResult.h&quot;
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include &lt;wtf/HashSet.h&gt;
+
+namespace WebCore {
+
+template&lt;typename T&gt; void isolatedCopyOfVariant(const WTF::Variant&lt;Vector&lt;IDBKeyData&gt;, Vector&lt;IDBValue&gt;, std::nullptr_t&gt;&amp; source, WTF::Variant&lt;Vector&lt;IDBKeyData&gt;, Vector&lt;IDBValue&gt;, std::nullptr_t&gt;&amp; target)
+{
+    target = Vector&lt;T&gt;();
+    auto&amp; sourceVector = WTF::get&lt;Vector&lt;T&gt;&gt;(source);
+    auto&amp; targetVector = WTF::get&lt;Vector&lt;T&gt;&gt;(target);
+    targetVector.reserveInitialCapacity(sourceVector.size());
+    for (auto&amp; element : sourceVector)
+        targetVector.uncheckedAppend(element.isolatedCopy());
+}
+
+IDBGetAllResult IDBGetAllResult::isolatedCopy() const
+{
+    IDBGetAllResult result;
+    result.m_type = m_type;
+
+    if (WTF::holds_alternative&lt;std::nullptr_t&gt;(m_results))
+        return result;
+
+    switch (m_type) {
+    case IndexedDB::GetAllType::Keys:
+        isolatedCopyOfVariant&lt;IDBKeyData&gt;(m_results, result.m_results);
+        break;
+    case IndexedDB::GetAllType::Values:
+        isolatedCopyOfVariant&lt;IDBValue&gt;(m_results, result.m_results);
+        break;
+    }
+
+    return result;
+}
+
+void IDBGetAllResult::addKey(IDBKeyData&amp;&amp; key)
+{
+    ASSERT(m_type == IndexedDB::GetAllType::Keys);
+    ASSERT(WTF::holds_alternative&lt;Vector&lt;IDBKeyData&gt;&gt;(m_results));
+    WTF::get&lt;Vector&lt;IDBKeyData&gt;&gt;(m_results).append(WTFMove(key));
+}
+
+void IDBGetAllResult::addValue(IDBValue&amp;&amp; value)
+{
+    ASSERT(m_type == IndexedDB::GetAllType::Values);
+    ASSERT(WTF::holds_alternative&lt;Vector&lt;IDBValue&gt;&gt;(m_results));
+    WTF::get&lt;Vector&lt;IDBValue&gt;&gt;(m_results).append(WTFMove(value));
+}
+
+const Vector&lt;IDBKeyData&gt;&amp; IDBGetAllResult::keys() const
+{
+    ASSERT(m_type == IndexedDB::GetAllType::Keys);
+    ASSERT(WTF::holds_alternative&lt;Vector&lt;IDBKeyData&gt;&gt;(m_results));
+    return WTF::get&lt;Vector&lt;IDBKeyData&gt;&gt;(m_results);
+}
+
+const Vector&lt;IDBValue&gt;&amp; IDBGetAllResult::values() const
+{
+    ASSERT(m_type == IndexedDB::GetAllType::Values);
+    ASSERT(WTF::holds_alternative&lt;Vector&lt;IDBValue&gt;&gt;(m_results));
+    return WTF::get&lt;Vector&lt;IDBValue&gt;&gt;(m_results);
+}
+
+Vector&lt;String&gt; IDBGetAllResult::allBlobFilePaths() const
+{
+    ASSERT(m_type == IndexedDB::GetAllType::Values);
+
+    HashSet&lt;String&gt; pathSet;
+    for (auto&amp; value : WTF::get&lt;Vector&lt;IDBValue&gt;&gt;(m_results)) {
+        for (auto&amp; path : value.blobFilePaths())
+            pathSet.add(path);
+    }
+
+    Vector&lt;String&gt; paths;
+    copyToVector(pathSet, paths);
+
+    return paths;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBGetAllResulth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/indexeddb/IDBGetAllResult.h (0 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBGetAllResult.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBGetAllResult.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -0,0 +1,128 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include &quot;IDBKeyData.h&quot;
+#include &quot;IDBValue.h&quot;
+#include &quot;IndexedDB.h&quot;
+
+#include &lt;wtf/Variant.h&gt;
+
+namespace WebCore {
+
+class IDBGetAllResult {
+public:
+    IDBGetAllResult()
+    {
+    }
+
+    IDBGetAllResult(IndexedDB::GetAllType type)
+        : m_type(type)
+    {
+        switch (m_type) {
+        case IndexedDB::GetAllType::Keys:
+            m_results = Vector&lt;IDBKeyData&gt;();
+            break;
+        case IndexedDB::GetAllType::Values:
+            m_results = Vector&lt;IDBValue&gt;();
+            break;
+        }
+    }
+
+    IDBGetAllResult isolatedCopy() const;
+
+    IndexedDB::GetAllType type() const { return m_type; }
+    const Vector&lt;IDBKeyData&gt;&amp; keys() const;
+    const Vector&lt;IDBValue&gt;&amp; values() const;
+
+    void addKey(IDBKeyData&amp;&amp;);
+    void addValue(IDBValue&amp;&amp;);
+
+    template&lt;class Encoder&gt; void encode(Encoder&amp;) const;
+    template&lt;class Decoder&gt; static bool decode(Decoder&amp;, IDBGetAllResult&amp;);
+
+    WEBCORE_EXPORT Vector&lt;String&gt; allBlobFilePaths() const;
+
+private:
+    IndexedDB::GetAllType m_type { IndexedDB::GetAllType::Keys };
+    WTF::Variant&lt;Vector&lt;IDBKeyData&gt;, Vector&lt;IDBValue&gt;, std::nullptr_t&gt; m_results { nullptr };
+};
+
+template&lt;class Encoder&gt;
+void IDBGetAllResult::encode(Encoder&amp; encoder) const
+{
+    encoder &lt;&lt; m_type &lt;&lt; static_cast&lt;uint64_t&gt;(m_results.index());
+
+    switch (m_results.index()) {
+    case 0:
+        encoder &lt;&lt; WTF::get&lt;Vector&lt;IDBKeyData&gt;&gt;(m_results);
+        break;
+    case 1:
+        encoder &lt;&lt; WTF::get&lt;Vector&lt;IDBValue&gt;&gt;(m_results);
+        break;
+    case 2:
+        break;
+    default:
+        RELEASE_ASSERT_NOT_REACHED();
+    }
+}
+
+template&lt;class Decoder&gt;
+bool IDBGetAllResult::decode(Decoder&amp; decoder, IDBGetAllResult&amp; result)
+{
+    if (!decoder.decode(result.m_type))
+        return false;
+
+    uint64_t index;
+    if (!decoder.decode(index))
+        return false;
+
+    switch (index) {
+    case 0:
+        result.m_results = Vector&lt;IDBKeyData&gt;();
+        if (!decoder.decode(WTF::get&lt;Vector&lt;IDBKeyData&gt;&gt;(result.m_results)))
+            return false;
+        break;
+    case 1:
+        result.m_results = Vector&lt;IDBValue&gt;();
+        if (!decoder.decode(WTF::get&lt;Vector&lt;IDBValue&gt;&gt;(result.m_results)))
+            return false;
+        break;
+    case 2:
+        result.m_results = nullptr;
+        break;
+    default:
+        RELEASE_ASSERT_NOT_REACHED();
+    }
+
+    return true;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -548,6 +548,52 @@
</span><span class="cx">     return m_transaction-&gt;requestCount(execState, *this, range);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::getAll(ExecState&amp; execState, RefPtr&lt;IDBKeyRange&gt; range, Optional&lt;uint32_t&gt; count)
+{
+    LOG(IndexedDB, &quot;IDBObjectStore::getAll&quot;);
+    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
+
+    if (m_deleted)
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'getAll' on 'IDBObjectStore': The object store has been deleted.&quot;) };
+
+    if (!m_transaction-&gt;isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'getAll' on 'IDBObjectStore': The transaction is inactive or finished.&quot;) };
+
+    return m_transaction-&gt;requestGetAllObjectStoreRecords(execState, *this, range.get(), IndexedDB::GetAllType::Values, count);
+}
+
+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::getAll(ExecState&amp; execState, JSValue key, Optional&lt;uint32_t&gt; count)
+{
+    auto onlyResult = IDBKeyRange::only(execState, key);
+    if (onlyResult.hasException())
+        return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to execute 'getAll' on 'IDBObjectStore': The parameter is not a valid key.&quot;) };
+
+    return getAll(execState, onlyResult.releaseReturnValue(), count);
+}
+
+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::getAllKeys(ExecState&amp; execState, RefPtr&lt;IDBKeyRange&gt; range, Optional&lt;uint32_t&gt; count)
+{
+    LOG(IndexedDB, &quot;IDBObjectStore::getAllKeys&quot;);
+    ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
+
+    if (m_deleted)
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral(&quot;Failed to execute 'getAllKeys' on 'IDBObjectStore': The object store has been deleted.&quot;) };
+
+    if (!m_transaction-&gt;isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral(&quot;Failed to execute 'getAllKeys' on 'IDBObjectStore': The transaction is inactive or finished.&quot;) };
+
+    return m_transaction-&gt;requestGetAllObjectStoreRecords(execState, *this, range.get(), IndexedDB::GetAllType::Keys, count);
+}
+
+ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBObjectStore::getAllKeys(ExecState&amp; execState, JSValue key, Optional&lt;uint32_t&gt; count)
+{
+    auto onlyResult = IDBKeyRange::only(execState, key);
+    if (onlyResult.hasException())
+        return Exception { IDBDatabaseException::DataError, ASCIILiteral(&quot;Failed to execute 'getAllKeys' on 'IDBObjectStore': The parameter is not a valid key.&quot;) };
+
+    return getAllKeys(execState, onlyResult.releaseReturnValue(), count);
+}
+
</ins><span class="cx"> void IDBObjectStore::markAsDeleted()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -88,6 +88,10 @@
</span><span class="cx">     ExceptionOr&lt;void&gt; deleteIndex(const String&amp; name);
</span><span class="cx">     ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; count(JSC::ExecState&amp;, IDBKeyRange*);
</span><span class="cx">     ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; count(JSC::ExecState&amp;, JSC::JSValue key);
</span><ins>+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; getAll(JSC::ExecState&amp;, RefPtr&lt;IDBKeyRange&gt;, Optional&lt;uint32_t&gt; count);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; getAll(JSC::ExecState&amp;, JSC::JSValue key, Optional&lt;uint32_t&gt; count);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; getAllKeys(JSC::ExecState&amp;, RefPtr&lt;IDBKeyRange&gt;, Optional&lt;uint32_t&gt; count);
+    ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; getAllKeys(JSC::ExecState&amp;, JSC::JSValue key, Optional&lt;uint32_t&gt; count);
</ins><span class="cx"> 
</span><span class="cx">     ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; putForCursorUpdate(JSC::ExecState&amp;, JSC::JSValue, JSC::JSValue key);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStoreidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -47,6 +47,10 @@
</span><span class="cx">     [CallWith=ScriptState, MayThrowException] IDBRequest openCursor(any key, optional DOMString direction = &quot;next&quot;);
</span><span class="cx">     [CallWith=ScriptState, MayThrowException] IDBRequest openKeyCursor(optional IDBKeyRange? range = null, optional DOMString direction = &quot;next&quot;);
</span><span class="cx">     [CallWith=ScriptState, MayThrowException] IDBRequest openKeyCursor(any key, optional DOMString direction = &quot;next&quot;);
</span><ins>+    [CallWith=ScriptState, MayThrowException] IDBRequest getAll(optional IDBKeyRange? range = null, [EnforceRange] optional unsigned long count);
+    [CallWith=ScriptState, MayThrowException] IDBRequest getAll(any key,  [EnforceRange] optional unsigned long count);
+    [CallWith=ScriptState, MayThrowException] IDBRequest getAllKeys(optional IDBKeyRange? range = null, [EnforceRange] optional unsigned long count);
+    [CallWith=ScriptState, MayThrowException] IDBRequest getAllKeys(any key,  [EnforceRange] optional unsigned long count);
</ins><span class="cx">     [CallWith=ScriptState, MayThrowException] IDBIndex createIndex(DOMString name, (DOMString or sequence&lt;DOMString&gt;) keyPath, optional IDBIndexParameters options);
</span><span class="cx">     [MayThrowException] IDBIndex index(DOMString name);
</span><span class="cx">     [MayThrowException] void deleteIndex(DOMString name);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include &quot;IDBKeyData.h&quot;
</span><span class="cx"> #include &quot;IDBObjectStore.h&quot;
</span><span class="cx"> #include &quot;IDBResultData.h&quot;
</span><ins>+#include &quot;JSDOMConvert.h&quot;
</ins><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;ScopeGuard.h&quot;
</span><span class="cx"> #include &quot;ScriptExecutionContext.h&quot;
</span><span class="lines">@@ -48,6 +49,8 @@
</span><span class="cx"> #include &quot;ThreadSafeDataBuffer.h&quot;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> 
</span><ins>+using namespace JSC;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> Ref&lt;IDBRequest&gt; IDBRequest::create(ScriptExecutionContext&amp; context, IDBObjectStore&amp; objectStore, IDBTransaction&amp; transaction)
</span><span class="lines">@@ -330,6 +333,42 @@
</span><span class="cx">     m_scriptResult = { context-&gt;vm(), idbKeyDataToScriptValue(*exec, keyData) };
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBRequest::setResult(const Vector&lt;IDBKeyData&gt;&amp; keyDatas)
+{
+    ASSERT(currentThread() == originThreadID());
+
+    auto* context = scriptExecutionContext();
+    if (!context)
+        return;
+
+    auto* state = context-&gt;execState();
+    if (!state)
+        return;
+
+    clearResult();
+
+    Locker&lt;JSLock&gt; locker(context-&gt;vm().apiLock());
+    m_scriptResult = { context-&gt;vm(), toJS(state, jsCast&lt;JSDOMGlobalObject*&gt;(state-&gt;lexicalGlobalObject()), keyDatas) };
+}
+
+void IDBRequest::setResult(const Vector&lt;IDBValue&gt;&amp; values)
+{
+    ASSERT(currentThread() == originThreadID());
+
+    auto* context = scriptExecutionContext();
+    if (!context)
+        return;
+
+    auto* exec = context-&gt;execState();
+    if (!exec)
+        return;
+
+    clearResult();
+
+    Locker&lt;JSLock&gt; locker(context-&gt;vm().apiLock());
+    m_scriptResult = { context-&gt;vm(), toJS(exec, jsCast&lt;JSDOMGlobalObject*&gt;(exec-&gt;lexicalGlobalObject()), values) };
+}
+
</ins><span class="cx"> void IDBRequest::setResult(uint64_t number)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(currentThread() == originThreadID());
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -88,6 +88,8 @@
</span><span class="cx">     void requestCompleted(const IDBResultData&amp;);
</span><span class="cx"> 
</span><span class="cx">     void setResult(const IDBKeyData&amp;);
</span><ins>+    void setResult(const Vector&lt;IDBKeyData&gt;&amp;);
+    void setResult(const Vector&lt;IDBValue&gt;&amp;);
</ins><span class="cx">     void setResult(uint64_t);
</span><span class="cx">     void setResultToStructuredClone(const IDBValue&amp;);
</span><span class="cx">     void setResultToUndefined();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -737,6 +737,58 @@
</span><span class="cx">     request.didOpenOrIterateCursor(resultData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Ref&lt;IDBRequest&gt; IDBTransaction::requestGetAllObjectStoreRecords(JSC::ExecState&amp; state, IDBObjectStore&amp; objectStore, const IDBKeyRangeData&amp; keyRangeData, IndexedDB::GetAllType getAllType, Optional&lt;uint32_t&gt; count)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::requestGetAllObjectStoreRecords&quot;);
+    ASSERT(isActive());
+    ASSERT(currentThread() == m_database-&gt;originThreadID());
+
+    ASSERT_UNUSED(state, scriptExecutionContext() == scriptExecutionContextFromExecState(&amp;state));
+
+    Ref&lt;IDBRequest&gt; request = IDBRequest::create(*scriptExecutionContext(), objectStore, *this);
+    addRequest(request.get());
+
+    IDBGetAllRecordsData getAllRecordsData { keyRangeData, getAllType, count, objectStore.info().identifier(), 0 };
+
+    auto operation = IDBClient::createTransactionOperation(*this, request.get(), &amp;IDBTransaction::didGetAllRecordsOnServer, &amp;IDBTransaction::getAllRecordsOnServer, getAllRecordsData);
+    scheduleOperation(WTFMove(operation));
+
+    return request;
+}
+
+void IDBTransaction::getAllRecordsOnServer(IDBClient::TransactionOperation&amp; operation, const IDBGetAllRecordsData&amp; getAllRecordsData)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::getAllRecordsOnServer&quot;);
+    ASSERT(currentThread() == m_database-&gt;originThreadID());
+
+    m_database-&gt;connectionProxy().getAllRecords(operation, getAllRecordsData);
+}
+
+void IDBTransaction::didGetAllRecordsOnServer(IDBRequest&amp; request, const IDBResultData&amp; resultData)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::didGetAllRecordsOnServer&quot;);
+    ASSERT(currentThread() == m_database-&gt;originThreadID());
+
+    if (resultData.type() == IDBResultType::Error) {
+        request.requestCompleted(resultData);
+        return;
+    }
+
+    ASSERT(resultData.type() == IDBResultType::GetAllRecordsSuccess);
+
+    auto&amp; getAllResult = resultData.getAllResult();
+    switch (getAllResult.type()) {
+    case IndexedDB::GetAllType::Keys:
+        request.setResult(getAllResult.keys());
+        break;
+    case IndexedDB::GetAllType::Values:
+        request.setResult(getAllResult.values());
+        break;
+    }
+
+    request.requestCompleted(resultData);
+}
+
</ins><span class="cx"> Ref&lt;IDBRequest&gt; IDBTransaction::requestGetRecord(ExecState&amp; execState, IDBObjectStore&amp; objectStore, const IDBGetRecordData&amp; getRecordData)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBTransaction::requestGetRecord&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &quot;EventTarget.h&quot;
</span><span class="cx"> #include &quot;IDBActiveDOMObject.h&quot;
</span><span class="cx"> #include &quot;IDBError.h&quot;
</span><ins>+#include &quot;IDBGetAllRecordsData.h&quot;
</ins><span class="cx"> #include &quot;IDBGetRecordData.h&quot;
</span><span class="cx"> #include &quot;IDBKeyRangeData.h&quot;
</span><span class="cx"> #include &quot;IDBOpenDBRequest.h&quot;
</span><span class="lines">@@ -113,6 +114,7 @@
</span><span class="cx"> 
</span><span class="cx">     Ref&lt;IDBRequest&gt; requestPutOrAdd(JSC::ExecState&amp;, IDBObjectStore&amp;, IDBKey*, SerializedScriptValue&amp;, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx">     Ref&lt;IDBRequest&gt; requestGetRecord(JSC::ExecState&amp;, IDBObjectStore&amp;, const IDBGetRecordData&amp;);
</span><ins>+    Ref&lt;IDBRequest&gt; requestGetAllObjectStoreRecords(JSC::ExecState&amp;, IDBObjectStore&amp;, const IDBKeyRangeData&amp;, IndexedDB::GetAllType, Optional&lt;uint32_t&gt; count);
</ins><span class="cx">     Ref&lt;IDBRequest&gt; requestDeleteRecord(JSC::ExecState&amp;, IDBObjectStore&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     Ref&lt;IDBRequest&gt; requestClearObjectStore(JSC::ExecState&amp;, IDBObjectStore&amp;);
</span><span class="cx">     Ref&lt;IDBRequest&gt; requestCount(JSC::ExecState&amp;, IDBObjectStore&amp;, const IDBKeyRangeData&amp;);
</span><span class="lines">@@ -185,6 +187,9 @@
</span><span class="cx">     void getRecordOnServer(IDBClient::TransactionOperation&amp;, const IDBGetRecordData&amp;);
</span><span class="cx">     void didGetRecordOnServer(IDBRequest&amp;, const IDBResultData&amp;);
</span><span class="cx"> 
</span><ins>+    void getAllRecordsOnServer(IDBClient::TransactionOperation&amp;, const IDBGetAllRecordsData&amp;);
+    void didGetAllRecordsOnServer(IDBRequest&amp;, const IDBResultData&amp;);
+
</ins><span class="cx">     void getCountOnServer(IDBClient::TransactionOperation&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     void didGetCountOnServer(IDBRequest&amp;, const IDBResultData&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIndexedDBh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/IndexedDB.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -91,6 +91,11 @@
</span><span class="cx">     Other,
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+enum class GetAllType {
+    Keys,
+    Values,
+};
+
</ins><span class="cx"> } // namespace IndexedDB
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -189,6 +189,14 @@
</span><span class="cx">     callConnectionOnMainThread(&amp;IDBConnectionToServer::getRecord, requestData, getRecordData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBConnectionProxy::getAllRecords(TransactionOperation&amp; operation, const IDBGetAllRecordsData&amp; getAllRecordsData)
+{
+    const IDBRequestData requestData(operation);
+    saveOperation(operation);
+
+    callConnectionOnMainThread(&amp;IDBConnectionToServer::getAllRecords, requestData, getAllRecordsData);
+}
+
</ins><span class="cx"> void IDBConnectionProxy::getCount(TransactionOperation&amp; operation, const IDBKeyRangeData&amp; keyRange)
</span><span class="cx"> {
</span><span class="cx">     const IDBRequestData requestData(operation);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -73,6 +73,7 @@
</span><span class="cx">     void deleteIndex(TransactionOperation&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName);
</span><span class="cx">     void putOrAdd(TransactionOperation&amp;, IDBKeyData&amp;&amp;, const IDBValue&amp;, const IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx">     void getRecord(TransactionOperation&amp;, const IDBGetRecordData&amp;);
</span><ins>+    void getAllRecords(TransactionOperation&amp;, const IDBGetAllRecordsData&amp;);
</ins><span class="cx">     void getCount(TransactionOperation&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     void deleteRecord(TransactionOperation&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     void openCursor(TransactionOperation&amp;, const IDBCursorInfo&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -215,6 +215,20 @@
</span><span class="cx">     m_proxy-&gt;completeOperation(resultData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBConnectionToServer::getAllRecords(const IDBRequestData&amp; requestData, const IDBGetAllRecordsData&amp; getAllRecordsData)
+{
+    LOG(IndexedDB, &quot;IDBConnectionToServer::getAllRecords&quot;);
+    ASSERT(isMainThread());
+
+    m_delegate-&gt;getAllRecords(requestData, getAllRecordsData);
+}
+
+void IDBConnectionToServer::didGetAllRecords(const IDBResultData&amp; resultData)
+{
+    LOG(IndexedDB, &quot;IDBConnectionToServer::didGetAllRecords&quot;);
+    m_proxy-&gt;completeOperation(resultData);
+}
+
</ins><span class="cx"> void IDBConnectionToServer::getCount(const IDBRequestData&amp; requestData, const IDBKeyRangeData&amp; keyRangeData)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBConnectionToServer::getCount&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> class IDBValue;
</span><span class="cx"> class SecurityOrigin;
</span><span class="cx"> 
</span><ins>+struct IDBGetAllRecordsData;
</ins><span class="cx"> struct IDBGetRecordData;
</span><span class="cx"> 
</span><span class="cx"> namespace IDBClient {
</span><span class="lines">@@ -89,6 +90,9 @@
</span><span class="cx">     void getRecord(const IDBRequestData&amp;, const IDBGetRecordData&amp;);
</span><span class="cx">     WEBCORE_EXPORT void didGetRecord(const IDBResultData&amp;);
</span><span class="cx"> 
</span><ins>+    void getAllRecords(const IDBRequestData&amp;, const IDBGetAllRecordsData&amp;);
+    WEBCORE_EXPORT void didGetAllRecords(const IDBResultData&amp;);
+
</ins><span class="cx">     void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     WEBCORE_EXPORT void didGetCount(const IDBResultData&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerDelegateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> class IDBTransactionInfo;
</span><span class="cx"> class IDBValue;
</span><span class="cx"> 
</span><ins>+struct IDBGetAllRecordsData;
</ins><span class="cx"> struct IDBGetRecordData;
</span><span class="cx"> struct SecurityOriginData;
</span><span class="cx"> 
</span><span class="lines">@@ -70,6 +71,7 @@
</span><span class="cx">     virtual void renameIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName) = 0;
</span><span class="cx">     virtual void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const IDBValue&amp;, const IndexedDB::ObjectStoreOverwriteMode) = 0;
</span><span class="cx">     virtual void getRecord(const IDBRequestData&amp;, const IDBGetRecordData&amp;) = 0;
</span><ins>+    virtual void getAllRecords(const IDBRequestData&amp;, const IDBGetAllRecordsData&amp;) = 0;
</ins><span class="cx">     virtual void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) = 0;
</span><span class="cx">     virtual void deleteRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) = 0;
</span><span class="cx">     virtual void openCursor(const IDBRequestData&amp;, const IDBCursorInfo&amp;) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class IDBCursorInfo;
</span><ins>+class IDBGetAllResult;
</ins><span class="cx"> class IDBGetResult;
</span><span class="cx"> class IDBIndexInfo;
</span><span class="cx"> class IDBKeyData;
</span><span class="lines">@@ -43,6 +44,7 @@
</span><span class="cx"> class IDBValue;
</span><span class="cx"> class ThreadSafeDataBuffer;
</span><span class="cx"> 
</span><ins>+struct IDBGetAllRecordsData;
</ins><span class="cx"> struct IDBKeyRangeData;
</span><span class="cx"> 
</span><span class="cx"> namespace IndexedDB {
</span><span class="lines">@@ -79,6 +81,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 addRecord(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBObjectStoreInfo&amp;, const IDBKeyData&amp;, const IDBValue&amp;) = 0;
</span><span class="cx">     virtual IDBError getRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;, IDBGetResult&amp; outValue) = 0;
</span><ins>+    virtual IDBError getAllRecords(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBGetAllRecordsData&amp;, IDBGetAllResult&amp; outValue) = 0;
</ins><span class="cx">     virtual IDBError getIndexRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;, IDBGetResult&amp; outValue) = 0;
</span><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></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -108,6 +108,11 @@
</span><span class="cx">     m_delegate-&gt;didGetRecord(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBConnectionToClient::didGetAllRecords(const IDBResultData&amp; result)
+{
+    m_delegate-&gt;didGetAllRecords(result);
+}
+
</ins><span class="cx"> void IDBConnectionToClient::didGetCount(const IDBResultData&amp; result)
</span><span class="cx"> {
</span><span class="cx">     m_delegate-&gt;didGetCount(result);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -62,6 +62,7 @@
</span><span class="cx">     void didRenameIndex(const IDBResultData&amp;);
</span><span class="cx">     void didPutOrAdd(const IDBResultData&amp;);
</span><span class="cx">     void didGetRecord(const IDBResultData&amp;);
</span><ins>+    void didGetAllRecords(const IDBResultData&amp;);
</ins><span class="cx">     void didGetCount(const IDBResultData&amp;);
</span><span class="cx">     void didDeleteRecord(const IDBResultData&amp;);
</span><span class="cx">     void didOpenCursor(const IDBResultData&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClientDelegateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx">     virtual void didRenameIndex(const IDBResultData&amp;) = 0;
</span><span class="cx">     virtual void didPutOrAdd(const IDBResultData&amp;) = 0;
</span><span class="cx">     virtual void didGetRecord(const IDBResultData&amp;) = 0;
</span><ins>+    virtual void didGetAllRecords(const IDBResultData&amp;) = 0;
</ins><span class="cx">     virtual void didGetCount(const IDBResultData&amp;) = 0;
</span><span class="cx">     virtual void didDeleteRecord(const IDBResultData&amp;) = 0;
</span><span class="cx">     virtual void didOpenCursor(const IDBResultData&amp;) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -294,6 +294,17 @@
</span><span class="cx">     transaction-&gt;getRecord(requestData, getRecordData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBServer::getAllRecords(const IDBRequestData&amp; requestData, const IDBGetAllRecordsData&amp; getAllRecordsData)
+{
+    LOG(IndexedDB, &quot;IDBServer::getAllRecords&quot;);
+
+    auto transaction = m_transactions.get(requestData.transactionIdentifier());
+    if (!transaction)
+        return;
+
+    transaction-&gt;getAllRecords(requestData, getAllRecordsData);
+}
+
</ins><span class="cx"> void IDBServer::getCount(const IDBRequestData&amp; requestData, const IDBKeyRangeData&amp; keyRangeData)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBServer::getCount&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -74,6 +74,7 @@
</span><span class="cx">     WEBCORE_EXPORT void renameIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName);
</span><span class="cx">     WEBCORE_EXPORT void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const IDBValue&amp;, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx">     WEBCORE_EXPORT void getRecord(const IDBRequestData&amp;, const IDBGetRecordData&amp;);
</span><ins>+    WEBCORE_EXPORT void getAllRecords(const IDBRequestData&amp;, const IDBGetAllRecordsData&amp;);
</ins><span class="cx">     WEBCORE_EXPORT void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     WEBCORE_EXPORT void deleteRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     WEBCORE_EXPORT void openCursor(const IDBRequestData&amp;, const IDBCursorInfo&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;IDBCursorInfo.h&quot;
</span><ins>+#include &quot;IDBGetAllRecordsData.h&quot;
</ins><span class="cx"> #include &quot;IDBGetResult.h&quot;
</span><span class="cx"> #include &quot;IDBIndexInfo.h&quot;
</span><span class="cx"> #include &quot;IDBKeyRangeData.h&quot;
</span><span class="lines">@@ -365,6 +366,23 @@
</span><span class="cx">     return IDBError();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IDBError MemoryIDBBackingStore::getAllRecords(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBGetAllRecordsData&amp; getAllRecordsData, IDBGetAllResult&amp; result)
+{
+    LOG(IndexedDB, &quot;MemoryIDBBackingStore::getAllRecords&quot;);
+
+    ASSERT(getAllRecordsData.objectStoreIdentifier);
+
+    if (!m_transactions.contains(transactionIdentifier))
+        return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral(&quot;No backing store transaction found to get all records&quot;));
+
+    MemoryObjectStore* objectStore = m_objectStoresByIdentifier.get(getAllRecordsData.objectStoreIdentifier);
+    if (!objectStore)
+        return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral(&quot;No backing store object store found&quot;));
+
+    objectStore-&gt;getAllRecords(getAllRecordsData.keyRangeData, getAllRecordsData.count, getAllRecordsData.getAllType, result);
+    return { };
+}
+
</ins><span class="cx"> IDBError MemoryIDBBackingStore::getIndexRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType recordType, const IDBKeyRangeData&amp; range, IDBGetResult&amp; outValue)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;MemoryIDBBackingStore::getIndexRecord&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -63,6 +63,7 @@
</span><span class="cx">     IDBError deleteRange(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;) final;
</span><span class="cx">     IDBError addRecord(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBObjectStoreInfo&amp;, const IDBKeyData&amp;, const IDBValue&amp;) final;
</span><span class="cx">     IDBError getRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;, IDBGetResult&amp; outValue) final;
</span><ins>+    IDBError getAllRecords(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBGetAllRecordsData&amp;, IDBGetAllResult&amp; outValue) final;
</ins><span class="cx">     IDBError getIndexRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;, IDBGetResult&amp; outValue) final;
</span><span class="cx">     IDBError getCount(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData&amp;, uint64_t&amp; outCount) final;
</span><span class="cx">     IDBError generateKeyNumber(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t&amp; keyNumber) final;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;IDBBindingUtilities.h&quot;
</span><span class="cx"> #include &quot;IDBDatabaseException.h&quot;
</span><span class="cx"> #include &quot;IDBError.h&quot;
</span><ins>+#include &quot;IDBGetAllResult.h&quot;
</ins><span class="cx"> #include &quot;IDBKeyRangeData.h&quot;
</span><span class="cx"> #include &quot;IDBValue.h&quot;
</span><span class="cx"> #include &quot;IndexKey.h&quot;
</span><span class="lines">@@ -407,6 +408,35 @@
</span><span class="cx">     return m_keyValueStore-&gt;get(key);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void MemoryObjectStore::getAllRecords(const IDBKeyRangeData&amp; keyRangeData, Optional&lt;uint32_t&gt; count, IndexedDB::GetAllType type, IDBGetAllResult&amp; result) const
+{
+    result = { type };
+
+    uint32_t targetCount;
+    if (count &amp;&amp; count.value())
+        targetCount = count.value();
+    else
+        targetCount = std::numeric_limits&lt;uint32_t&gt;::max();
+
+    IDBKeyRangeData range = keyRangeData;
+    uint32_t currentCount = 0;
+    while (currentCount &lt; targetCount) {
+        IDBKeyData key = lowestKeyWithRecordInRange(range);
+        if (key.isNull())
+            return;
+
+        range.lowerKey = key;
+        range.lowerOpen = true;
+
+        if (type == IndexedDB::GetAllType::Keys)
+            result.addKey(WTFMove(key));
+        else
+            result.addValue(valueForKey(key));
+
+        ++currentCount;
+    }
+}
+
</ins><span class="cx"> IDBGetResult MemoryObjectStore::indexValueForKeyRange(uint64_t indexIdentifier, IndexedDB::IndexRecordType recordType, const IDBKeyRangeData&amp; range) const
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;MemoryObjectStore::indexValueForKeyRange&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryObjectStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> 
</span><span class="cx"> class IDBCursorInfo;
</span><span class="cx"> class IDBError;
</span><ins>+class IDBGetAllResult;
</ins><span class="cx"> class IDBKeyData;
</span><span class="cx"> class IDBValue;
</span><span class="cx"> 
</span><span class="lines">@@ -47,6 +48,7 @@
</span><span class="cx"> struct IDBKeyRangeData;
</span><span class="cx"> 
</span><span class="cx"> namespace IndexedDB {
</span><ins>+enum class GetAllType;
</ins><span class="cx"> enum class IndexRecordType;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -87,6 +89,8 @@
</span><span class="cx">     IDBGetResult indexValueForKeyRange(uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;) const;
</span><span class="cx">     uint64_t countForKeyRange(uint64_t indexIdentifier, const IDBKeyRangeData&amp;) const;
</span><span class="cx"> 
</span><ins>+    void getAllRecords(const IDBKeyRangeData&amp;, Optional&lt;uint32_t&gt; count, IndexedDB::GetAllType, IDBGetAllResult&amp;) const;
+
</ins><span class="cx">     const IDBObjectStoreInfo&amp; info() const { return m_info; }
</span><span class="cx"> 
</span><span class="cx">     MemoryObjectStoreCursor* maybeOpenCursor(const IDBCursorInfo&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverSQLiteIDBBackingStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -31,6 +31,8 @@
</span><span class="cx"> #include &quot;FileSystem.h&quot;
</span><span class="cx"> #include &quot;IDBBindingUtilities.h&quot;
</span><span class="cx"> #include &quot;IDBDatabaseException.h&quot;
</span><ins>+#include &quot;IDBGetAllRecordsData.h&quot;
+#include &quot;IDBGetAllResult.h&quot;
</ins><span class="cx"> #include &quot;IDBGetResult.h&quot;
</span><span class="cx"> #include &quot;IDBKeyData.h&quot;
</span><span class="cx"> #include &quot;IDBObjectStoreInfo.h&quot;
</span><span class="lines">@@ -1876,6 +1878,132 @@
</span><span class="cx">     return { };
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static const ASCIILiteral&amp; queryForGetAllRecords(const IDBGetAllRecordsData&amp; getAllRecordsData)
+{
+    static NeverDestroyed&lt;const ASCIILiteral&gt; lowerOpenUpperOpenKey(&quot;SELECT key FROM Records WHERE objectStoreID = ? AND key &gt; CAST(? AS TEXT) AND key &lt; CAST(? AS TEXT) ORDER BY key;&quot;);
+    static NeverDestroyed&lt;const ASCIILiteral&gt; lowerOpenUpperClosedKey(&quot;SELECT key FROM Records WHERE objectStoreID = ? AND key &gt; CAST(? AS TEXT) AND key &lt;= CAST(? AS TEXT) ORDER BY key;&quot;);
+    static NeverDestroyed&lt;const ASCIILiteral&gt; lowerClosedUpperOpenKey(&quot;SELECT key FROM Records WHERE objectStoreID = ? AND key &gt;= CAST(? AS TEXT) AND key &lt; CAST(? AS TEXT) ORDER BY key;&quot;);
+    static NeverDestroyed&lt;const ASCIILiteral&gt; lowerClosedUpperClosedKey(&quot;SELECT key FROM Records WHERE objectStoreID = ? AND key &gt;= CAST(? AS TEXT) AND key &lt;= CAST(? AS TEXT) ORDER BY key;&quot;);
+    static NeverDestroyed&lt;const ASCIILiteral&gt; lowerOpenUpperOpenValue(&quot;SELECT value, ROWID FROM Records WHERE objectStoreID = ? AND key &gt; CAST(? AS TEXT) AND key &lt; CAST(? AS TEXT) ORDER BY key;&quot;);
+    static NeverDestroyed&lt;const ASCIILiteral&gt; lowerOpenUpperClosedValue(&quot;SELECT value, ROWID FROM Records WHERE objectStoreID = ? AND key &gt; CAST(? AS TEXT) AND key &lt;= CAST(? AS TEXT) ORDER BY key;&quot;);
+    static NeverDestroyed&lt;const ASCIILiteral&gt; lowerClosedUpperOpenValue(&quot;SELECT value, ROWID FROM Records WHERE objectStoreID = ? AND key &gt;= CAST(? AS TEXT) AND key &lt; CAST(? AS TEXT) ORDER BY key;&quot;);
+    static NeverDestroyed&lt;const ASCIILiteral&gt; lowerClosedUpperClosedValue(&quot;SELECT value, ROWID FROM Records WHERE objectStoreID = ? AND key &gt;= CAST(? AS TEXT) AND key &lt;= CAST(? AS TEXT) ORDER BY key;&quot;);
+
+    if (getAllRecordsData.getAllType == IndexedDB::GetAllType::Keys) {
+        if (getAllRecordsData.keyRangeData.lowerOpen) {
+            if (getAllRecordsData.keyRangeData.upperOpen)
+                return lowerOpenUpperOpenKey.get();
+            return lowerOpenUpperClosedKey.get();
+        }
+
+        if (getAllRecordsData.keyRangeData.upperOpen)
+            return lowerClosedUpperOpenKey.get();
+        return lowerClosedUpperClosedKey.get();
+    }
+
+    if (getAllRecordsData.keyRangeData.lowerOpen) {
+        if (getAllRecordsData.keyRangeData.upperOpen)
+            return lowerOpenUpperOpenValue.get();
+        return lowerOpenUpperClosedValue.get();
+    }
+
+    if (getAllRecordsData.keyRangeData.upperOpen)
+        return lowerClosedUpperOpenValue.get();
+    return lowerClosedUpperClosedValue.get();
+}
+
+IDBError SQLiteIDBBackingStore::getAllRecords(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBGetAllRecordsData&amp; getAllRecordsData, IDBGetAllResult&amp; result)
+{
+    LOG(IndexedDB, &quot;SQLiteIDBBackingStore::getAllRecords&quot;);
+
+    ASSERT(m_sqliteDB);
+    ASSERT(m_sqliteDB-&gt;isOpen());
+
+    auto* transaction = m_transactions.get(transactionIdentifier);
+    if (!transaction || !transaction-&gt;inProgress()) {
+        LOG_ERROR(&quot;Attempt to get records from database without an in-progress transaction&quot;);
+        return { IDBDatabaseException::UnknownError, ASCIILiteral(&quot;Attempt to get records from database without an in-progress transaction&quot;) };
+    }
+
+    auto key = getAllRecordsData.keyRangeData.lowerKey;
+    if (key.isNull())
+        key = IDBKeyData::minimum();
+    auto lowerBuffer = serializeIDBKeyData(key);
+    if (!lowerBuffer) {
+        LOG_ERROR(&quot;Unable to serialize lower IDBKey in lookup range&quot;);
+        return { IDBDatabaseException::UnknownError, ASCIILiteral(&quot;Unable to serialize lower IDBKey in lookup range&quot;) };
+    }
+
+    key = getAllRecordsData.keyRangeData.upperKey;
+    if (key.isNull())
+        key = IDBKeyData::maximum();
+    auto upperBuffer = serializeIDBKeyData(key);
+    if (!upperBuffer) {
+        LOG_ERROR(&quot;Unable to serialize upper IDBKey in lookup range&quot;);
+        return { IDBDatabaseException::UnknownError, ASCIILiteral(&quot;Unable to serialize upper IDBKey in lookup range&quot;) };
+    }
+
+    SQLiteStatement sql(*m_sqliteDB, queryForGetAllRecords(getAllRecordsData));
+    if (sql.prepare() != SQLITE_OK
+        || sql.bindInt64(1, getAllRecordsData.objectStoreIdentifier) != SQLITE_OK
+        || sql.bindBlob(2, lowerBuffer-&gt;data(), lowerBuffer-&gt;size()) != SQLITE_OK
+        || sql.bindBlob(3, upperBuffer-&gt;data(), upperBuffer-&gt;size()) != SQLITE_OK) {
+        LOG_ERROR(&quot;Could not get key range record from object store %&quot; PRIi64 &quot; from Records table (%i) - %s&quot;, getAllRecordsData.objectStoreIdentifier, m_sqliteDB-&gt;lastError(), m_sqliteDB-&gt;lastErrorMsg());
+        return { IDBDatabaseException::UnknownError, ASCIILiteral(&quot;Failed to look up record in object store by key range&quot;) };
+    }
+
+    result = { getAllRecordsData.getAllType };
+
+    int sqlResult = sql.step();
+    uint32_t returnedResults = 0;
+    uint32_t targetResults = getAllRecordsData.count ? getAllRecordsData.count.value() : 0;
+    if (!targetResults)
+        targetResults = std::numeric_limits&lt;uint32_t&gt;::max();
+
+    while (sqlResult == SQLITE_ROW &amp;&amp; returnedResults &lt; targetResults) {
+        if (getAllRecordsData.getAllType == IndexedDB::GetAllType::Values) {
+            Vector&lt;uint8_t&gt; buffer;
+            sql.getColumnBlobAsVector(0, buffer);
+            ThreadSafeDataBuffer resultBuffer = ThreadSafeDataBuffer::adoptVector(buffer);
+
+            auto recordID = sql.getColumnInt64(1);
+
+            ASSERT(recordID);
+            Vector&lt;String&gt; blobURLs, blobFilePaths;
+            auto error = getBlobRecordsForObjectStoreRecord(recordID, blobURLs, blobFilePaths);
+            ASSERT(blobURLs.size() == blobFilePaths.size());
+
+            if (!error.isNull())
+                return error;
+
+            result.addValue({ resultBuffer, WTFMove(blobURLs), WTFMove(blobFilePaths) });
+        } else {
+            Vector&lt;uint8_t&gt; keyData;
+            IDBKeyData key;
+            sql.getColumnBlobAsVector(0, keyData);
+
+            if (!deserializeIDBKeyData(keyData.data(), keyData.size(), key)) {
+                LOG_ERROR(&quot;Unable to deserialize key data from database while getting all key records&quot;);
+                return { IDBDatabaseException::UnknownError, ASCIILiteral(&quot;Unable to deserialize key data while getting all key records&quot;) };
+            }
+
+            result.addKey(WTFMove(key));
+        }
+
+        ++returnedResults;
+        sqlResult = sql.step();
+    }
+
+    if (sqlResult == SQLITE_OK || sqlResult == SQLITE_DONE || sqlResult == SQLITE_ROW) {
+        // Finished getting results
+        return { };
+    }
+
+    // There was an error fetching records from the database.
+    LOG_ERROR(&quot;Could not get record from object store %&quot; PRIi64 &quot; from Records table (%i) - %s&quot;, getAllRecordsData.objectStoreIdentifier, m_sqliteDB-&gt;lastError(), m_sqliteDB-&gt;lastErrorMsg());
+    return { IDBDatabaseException::UnknownError, ASCIILiteral(&quot;Error looking up record in object store by key range&quot;) };
+}
+
</ins><span class="cx"> IDBError SQLiteIDBBackingStore::getIndexRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreID, uint64_t indexID, IndexedDB::IndexRecordType type, const IDBKeyRangeData&amp; range, IDBGetResult&amp; getResult)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;SQLiteIDBBackingStore::getIndexRecord - %s&quot;, range.loggingString().utf8().data());
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverSQLiteIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -67,6 +67,7 @@
</span><span class="cx">     IDBError deleteRange(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;) final;
</span><span class="cx">     IDBError addRecord(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBObjectStoreInfo&amp;, const IDBKeyData&amp;, const IDBValue&amp;) final;
</span><span class="cx">     IDBError getRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;, IDBGetResult&amp; outValue) final;
</span><ins>+    IDBError getAllRecords(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBGetAllRecordsData&amp;, IDBGetAllResult&amp; outValue) final;
</ins><span class="cx">     IDBError getIndexRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;, IDBGetResult&amp; outValue) final;
</span><span class="cx">     IDBError getCount(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData&amp;, uint64_t&amp; outCount) final;
</span><span class="cx">     IDBError generateKeyNumber(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t&amp; keyNumber) final;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -29,6 +29,8 @@
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;IDBCursorInfo.h&quot;
</span><ins>+#include &quot;IDBGetAllRecordsData.h&quot;
+#include &quot;IDBGetAllResult.h&quot;
</ins><span class="cx"> #include &quot;IDBGetRecordData.h&quot;
</span><span class="cx"> #include &quot;IDBKeyRangeData.h&quot;
</span><span class="cx"> #include &quot;IDBResultData.h&quot;
</span><span class="lines">@@ -97,6 +99,7 @@
</span><span class="cx">     return !m_errorCallbacks.isEmpty()
</span><span class="cx">         || !m_keyDataCallbacks.isEmpty()
</span><span class="cx">         || !m_getResultCallbacks.isEmpty()
</span><ins>+        || !m_getAllResultsCallbacks.isEmpty()
</ins><span class="cx">         || !m_countCallbacks.isEmpty();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -408,6 +411,19 @@
</span><span class="cx">     return identifier;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+uint64_t UniqueIDBDatabase::storeCallbackOrFireError(GetAllResultsCallback callback)
+{
+    if (m_hardClosedForUserDelete) {
+        callback(IDBError::userDeleteError(), { });
+        return 0;
+    }
+
+    uint64_t identifier = generateUniqueCallbackIdentifier();
+    ASSERT(!m_getAllResultsCallbacks.contains(identifier));
+    m_getAllResultsCallbacks.add(identifier, callback);
+    return identifier;
+}
+
</ins><span class="cx"> uint64_t UniqueIDBDatabase::storeCallbackOrFireError(CountCallback callback)
</span><span class="cx"> {
</span><span class="cx">     if (m_hardClosedForUserDelete) {
</span><span class="lines">@@ -1028,6 +1044,18 @@
</span><span class="cx">         postDatabaseTask(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::performGetRecord, callbackID, requestData.transactionIdentifier(), requestData.objectStoreIdentifier(), getRecordData.keyRangeData));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UniqueIDBDatabase::getAllRecords(const IDBRequestData&amp; requestData, const IDBGetAllRecordsData&amp; getAllRecordsData, GetAllResultsCallback callback)
+{
+    ASSERT(isMainThread());
+    LOG(IndexedDB, &quot;(main) UniqueIDBDatabase::getAllRecords&quot;);
+
+    uint64_t callbackID = storeCallbackOrFireError(callback);
+    if (!callbackID)
+        return;
+
+    postDatabaseTask(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::performGetAllRecords, callbackID, requestData.transactionIdentifier(), getAllRecordsData));
+}
+
</ins><span class="cx"> void UniqueIDBDatabase::performGetRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp; keyRangeData)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!isMainThread());
</span><span class="lines">@@ -1062,6 +1090,27 @@
</span><span class="cx">     performGetResultCallback(callbackIdentifier, error, result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UniqueIDBDatabase::performGetAllRecords(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, const IDBGetAllRecordsData&amp; getAllRecordsData)
+{
+    ASSERT(!isMainThread());
+    LOG(IndexedDB, &quot;(db) UniqueIDBDatabase::performGetAllRecords&quot;);
+
+    ASSERT(m_backingStore);
+
+    IDBGetAllResult result;
+    IDBError error = m_backingStore-&gt;getAllRecords(transactionIdentifier, getAllRecordsData, result);
+
+    postDatabaseTaskReply(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::didPerformGetAllRecords, callbackIdentifier, error, WTFMove(result)));
+}
+
+void UniqueIDBDatabase::didPerformGetAllRecords(uint64_t callbackIdentifier, const IDBError&amp; error, const IDBGetAllResult&amp; result)
+{
+    ASSERT(isMainThread());
+    LOG(IndexedDB, &quot;(main) UniqueIDBDatabase::didPerformGetAllRecords&quot;);
+
+    performGetAllResultsCallback(callbackIdentifier, error, result);
+}
+
</ins><span class="cx"> void UniqueIDBDatabase::getCount(const IDBRequestData&amp; requestData, const IDBKeyRangeData&amp; range, CountCallback callback)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="lines">@@ -1801,6 +1850,14 @@
</span><span class="cx">         callback(error, resultData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UniqueIDBDatabase::performGetAllResultsCallback(uint64_t callbackIdentifier, const IDBError&amp; error, const IDBGetAllResult&amp; resultData)
+{
+    auto callback = m_getAllResultsCallbacks.take(callbackIdentifier);
+    ASSERT(callback || m_hardClosedForUserDelete);
+    if (callback)
+        callback(error, resultData);
+}
+
</ins><span class="cx"> void UniqueIDBDatabase::performCountCallback(uint64_t callbackIdentifier, const IDBError&amp; error, uint64_t count)
</span><span class="cx"> {
</span><span class="cx">     auto callback = m_countCallbacks.take(callbackIdentifier);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class IDBError;
</span><ins>+class IDBGetAllResult;
</ins><span class="cx"> class IDBRequestData;
</span><span class="cx"> class IDBTransactionInfo;
</span><span class="cx"> 
</span><span class="lines">@@ -68,6 +69,7 @@
</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><span class="cx"> typedef std::function&lt;void(const IDBError&amp;, const IDBGetResult&amp;)&gt; GetResultCallback;
</span><ins>+typedef std::function&lt;void(const IDBError&amp;, const IDBGetAllResult&amp;)&gt; GetAllResultsCallback;
</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">@@ -94,6 +96,7 @@
</span><span class="cx">     void renameIndex(UniqueIDBDatabaseTransaction&amp;, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName, ErrorCallback);
</span><span class="cx">     void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const IDBValue&amp;, IndexedDB::ObjectStoreOverwriteMode, KeyDataCallback);
</span><span class="cx">     void getRecord(const IDBRequestData&amp;, const IDBGetRecordData&amp;, GetResultCallback);
</span><ins>+    void getAllRecords(const IDBRequestData&amp;, const IDBGetAllRecordsData&amp;, GetAllResultsCallback);
</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 openCursor(const IDBRequestData&amp;, const IDBCursorInfo&amp;, GetResultCallback);
</span><span class="lines">@@ -153,6 +156,7 @@
</span><span class="cx">     void performRenameIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName);
</span><span class="cx">     void performPutOrAdd(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;, const IDBValue&amp;, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx">     void performGetRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;);
</span><ins>+    void performGetAllRecords(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, const IDBGetAllRecordsData&amp;);
</ins><span class="cx">     void performGetIndexRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;);
</span><span class="cx">     void performGetCount(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData&amp;);
</span><span class="cx">     void performDeleteRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;);
</span><span class="lines">@@ -173,6 +177,7 @@
</span><span class="cx">     void didPerformRenameIndex(uint64_t callbackIdentifier, const IDBError&amp;, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName);
</span><span class="cx">     void didPerformPutOrAdd(uint64_t callbackIdentifier, const IDBError&amp;, const IDBKeyData&amp;);
</span><span class="cx">     void didPerformGetRecord(uint64_t callbackIdentifier, const IDBError&amp;, const IDBGetResult&amp;);
</span><ins>+    void didPerformGetAllRecords(uint64_t callbackIdentifier, const IDBError&amp;, const IDBGetAllResult&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 didPerformOpenCursor(uint64_t callbackIdentifier, const IDBError&amp;, const IDBGetResult&amp;);
</span><span class="lines">@@ -184,6 +189,7 @@
</span><span class="cx"> 
</span><span class="cx">     uint64_t storeCallbackOrFireError(ErrorCallback);
</span><span class="cx">     uint64_t storeCallbackOrFireError(KeyDataCallback);
</span><ins>+    uint64_t storeCallbackOrFireError(GetAllResultsCallback);
</ins><span class="cx">     uint64_t storeCallbackOrFireError(GetResultCallback);
</span><span class="cx">     uint64_t storeCallbackOrFireError(CountCallback);
</span><span class="cx"> 
</span><span class="lines">@@ -190,6 +196,7 @@
</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><span class="cx">     void performGetResultCallback(uint64_t callbackIdentifier, const IDBError&amp;, const IDBGetResult&amp;);
</span><ins>+    void performGetAllResultsCallback(uint64_t callbackIdentifier, const IDBError&amp;, const IDBGetAllResult&amp;);
</ins><span class="cx">     void performCountCallback(uint64_t callbackIdentifier, const IDBError&amp;, uint64_t);
</span><span class="cx"> 
</span><span class="cx">     void forgetErrorCallback(uint64_t callbackIdentifier);
</span><span class="lines">@@ -237,6 +244,7 @@
</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><span class="cx">     HashMap&lt;uint64_t, GetResultCallback&gt; m_getResultCallbacks;
</span><ins>+    HashMap&lt;uint64_t, GetAllResultsCallback&gt; m_getAllResultsCallbacks;
</ins><span class="cx">     HashMap&lt;uint64_t, CountCallback&gt; m_countCallbacks;
</span><span class="cx"> 
</span><span class="cx">     Timer m_operationAndTransactionTimer;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -257,6 +257,23 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UniqueIDBDatabaseTransaction::getAllRecords(const IDBRequestData&amp; requestData, const IDBGetAllRecordsData&amp; getAllRecordsData)
+{
+    LOG(IndexedDB, &quot;UniqueIDBDatabaseTransaction::getAllRecords&quot;);
+
+    ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
+
+    RefPtr&lt;UniqueIDBDatabaseTransaction&gt; protectedThis(this);
+    m_databaseConnection-&gt;database().getAllRecords(requestData, getAllRecordsData, [this, protectedThis, requestData](const IDBError&amp; error, const IDBGetAllResult&amp; result) {
+        LOG(IndexedDB, &quot;UniqueIDBDatabaseTransaction::getAllRecords (callback)&quot;);
+
+        if (error.isNull())
+            m_databaseConnection-&gt;connectionToClient().didGetAllRecords(IDBResultData::getAllRecordsSuccess(requestData.requestIdentifier(), result));
+        else
+            m_databaseConnection-&gt;connectionToClient().didGetAllRecords(IDBResultData::error(requestData.requestIdentifier(), error));
+    });
+}
+
</ins><span class="cx"> void UniqueIDBDatabaseTransaction::getCount(const IDBRequestData&amp; requestData, const IDBKeyRangeData&amp; keyRangeData)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;UniqueIDBDatabaseTransaction::getCount&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx"> class IDBRequestData;
</span><span class="cx"> class IDBValue;
</span><span class="cx"> 
</span><ins>+struct IDBGetAllRecordsData;
</ins><span class="cx"> struct IDBGetRecordData;
</span><span class="cx"> struct IDBKeyRangeData;
</span><span class="cx"> 
</span><span class="lines">@@ -76,6 +77,7 @@
</span><span class="cx">     void renameIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName);
</span><span class="cx">     void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const IDBValue&amp;, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx">     void getRecord(const IDBRequestData&amp;, const IDBGetRecordData&amp;);
</span><ins>+    void getAllRecords(const IDBRequestData&amp;, const IDBGetAllRecordsData&amp;);
</ins><span class="cx">     void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     void deleteRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     void openCursor(const IDBRequestData&amp;, const IDBCursorInfo&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBGetAllRecordsDatacpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/indexeddb/shared/IDBGetAllRecordsData.cpp (0 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBGetAllRecordsData.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBGetAllRecordsData.cpp        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;IDBGetAllRecordsData.h&quot;
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include &quot;IDBKeyRangeData.h&quot;
+
+namespace WebCore {
+
+IDBGetAllRecordsData IDBGetAllRecordsData::isolatedCopy() const
+{
+    return { keyRangeData.isolatedCopy(), getAllType, count, objectStoreIdentifier, indexIdentifier };
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBGetAllRecordsDatah"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/indexeddb/shared/IDBGetAllRecordsData.h (0 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBGetAllRecordsData.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBGetAllRecordsData.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -0,0 +1,84 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include &quot;IDBKeyRangeData.h&quot;
+#include &lt;wtf/Optional.h&gt;
+
+namespace WebCore {
+
+namespace IndexedDB {
+enum class DataSource;
+enum class GetAllType;
+}
+
+struct IDBGetAllRecordsData {
+    IDBKeyRangeData keyRangeData;
+    IndexedDB::GetAllType getAllType;
+    Optional&lt;uint32_t&gt; count;
+    uint64_t objectStoreIdentifier;
+    uint64_t indexIdentifier;
+
+    IDBGetAllRecordsData isolatedCopy() const;
+
+    template&lt;class Encoder&gt; void encode(Encoder&amp;) const;
+    template&lt;class Decoder&gt; static bool decode(Decoder&amp;, IDBGetAllRecordsData&amp;);
+};
+
+template&lt;class Encoder&gt;
+void IDBGetAllRecordsData::encode(Encoder&amp; encoder) const
+{
+    encoder &lt;&lt; keyRangeData;
+    encoder.encodeEnum(getAllType);
+    encoder &lt;&lt; count &lt;&lt; objectStoreIdentifier &lt;&lt; indexIdentifier;
+}
+
+template&lt;class Decoder&gt;
+bool IDBGetAllRecordsData::decode(Decoder&amp; decoder, IDBGetAllRecordsData&amp; getAllRecordsData)
+{
+    if (!decoder.decode(getAllRecordsData.keyRangeData))
+        return false;
+
+    if (!decoder.decodeEnum(getAllRecordsData.getAllType))
+        return false;
+
+    if (!decoder.decode(getAllRecordsData.count))
+        return false;
+
+    if (!decoder.decode(getAllRecordsData.objectStoreIdentifier))
+        return false;
+
+    if (!decoder.decode(getAllRecordsData.indexIdentifier))
+        return false;
+
+    return true;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBResultDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -64,6 +64,8 @@
</span><span class="cx">         m_resultKey = std::make_unique&lt;IDBKeyData&gt;(*other.m_resultKey);
</span><span class="cx">     if (other.m_getResult)
</span><span class="cx">         m_getResult = std::make_unique&lt;IDBGetResult&gt;(*other.m_getResult);
</span><ins>+    if (other.m_getAllResult)
+        m_getAllResult = std::make_unique&lt;IDBGetAllResult&gt;(*other.m_getAllResult);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IDBResultData::IDBResultData(const IDBResultData&amp; that, IsolatedCopyTag)
</span><span class="lines">@@ -178,6 +180,13 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IDBResultData IDBResultData::getAllRecordsSuccess(const IDBResourceIdentifier&amp; requestIdentifier, const IDBGetAllResult&amp; getAllResult)
+{
+    IDBResultData result(IDBResultType::GetAllRecordsSuccess, requestIdentifier);
+    result.m_getAllResult = std::make_unique&lt;IDBGetAllResult&gt;(getAllResult);
+    return result;
+}
+
</ins><span class="cx"> IDBResultData IDBResultData::getCountSuccess(const IDBResourceIdentifier&amp; requestIdentifier, uint64_t count)
</span><span class="cx"> {
</span><span class="cx">     IDBResultData result(IDBResultType::GetRecordSuccess, requestIdentifier);
</span><span class="lines">@@ -222,6 +231,12 @@
</span><span class="cx">     return *m_getResult;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+const IDBGetAllResult&amp; IDBResultData::getAllResult() const
+{
+    RELEASE_ASSERT(m_getAllResult);
+    return *m_getAllResult;
+}
+
</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 (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h        2016-10-31 23:43:50 UTC (rev 208194)
</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;IDBGetAllResult.h&quot;
</ins><span class="cx"> #include &quot;IDBGetResult.h&quot;
</span><span class="cx"> #include &quot;IDBKeyData.h&quot;
</span><span class="cx"> #include &quot;IDBResourceIdentifier.h&quot;
</span><span class="lines">@@ -51,6 +52,7 @@
</span><span class="cx">     ClearObjectStoreSuccess,
</span><span class="cx">     PutOrAddSuccess,
</span><span class="cx">     GetRecordSuccess,
</span><ins>+    GetAllRecordsSuccess,
</ins><span class="cx">     GetCountSuccess,
</span><span class="cx">     DeleteRecordSuccess,
</span><span class="cx">     CreateIndexSuccess,
</span><span class="lines">@@ -81,6 +83,7 @@
</span><span class="cx">     static IDBResultData renameIndexSuccess(const IDBResourceIdentifier&amp;);
</span><span class="cx">     static IDBResultData putOrAddSuccess(const IDBResourceIdentifier&amp;, const IDBKeyData&amp;);
</span><span class="cx">     static IDBResultData getRecordSuccess(const IDBResourceIdentifier&amp;, const IDBGetResult&amp;);
</span><ins>+    static IDBResultData getAllRecordsSuccess(const IDBResourceIdentifier&amp;, const IDBGetAllResult&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">     static IDBResultData openCursorSuccess(const IDBResourceIdentifier&amp;, const IDBGetResult&amp;);
</span><span class="lines">@@ -105,6 +108,7 @@
</span><span class="cx">     uint64_t resultInteger() const { return m_resultInteger; }
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT const IDBGetResult&amp; getResult() const;
</span><ins>+    WEBCORE_EXPORT const IDBGetAllResult&amp; getAllResult() const;
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT IDBResultData();
</span><span class="cx">     template&lt;class Encoder&gt; void encode(Encoder&amp;) const;
</span><span class="lines">@@ -125,6 +129,7 @@
</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><span class="cx">     std::unique_ptr&lt;IDBGetResult&gt; m_getResult;
</span><ins>+    std::unique_ptr&lt;IDBGetAllResult&gt; m_getAllResult;
</ins><span class="cx">     uint64_t m_resultInteger { 0 };
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -150,6 +155,10 @@
</span><span class="cx">     encoder &lt;&lt; !!m_getResult;
</span><span class="cx">     if (m_getResult)
</span><span class="cx">         encoder &lt;&lt; *m_getResult;
</span><ins>+
+    encoder &lt;&lt; !!m_getAllResult;
+    if (m_getAllResult)
+        encoder &lt;&lt; *m_getAllResult;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;class Decoder&gt; bool IDBResultData::decode(Decoder&amp; decoder, IDBResultData&amp; result)
</span><span class="lines">@@ -174,7 +183,7 @@
</span><span class="cx">     if (!decoder.decode(hasObject))
</span><span class="cx">         return false;
</span><span class="cx">     if (hasObject) {
</span><del>-        std::unique_ptr&lt;IDBDatabaseInfo&gt; object = std::make_unique&lt;IDBDatabaseInfo&gt;();
</del><ins>+        auto object = std::make_unique&lt;IDBDatabaseInfo&gt;();
</ins><span class="cx">         if (!decoder.decode(*object))
</span><span class="cx">             return false;
</span><span class="cx">         result.m_databaseInfo = WTFMove(object);
</span><span class="lines">@@ -183,7 +192,7 @@
</span><span class="cx">     if (!decoder.decode(hasObject))
</span><span class="cx">         return false;
</span><span class="cx">     if (hasObject) {
</span><del>-        std::unique_ptr&lt;IDBTransactionInfo&gt; object = std::make_unique&lt;IDBTransactionInfo&gt;();
</del><ins>+        auto object = std::make_unique&lt;IDBTransactionInfo&gt;();
</ins><span class="cx">         if (!decoder.decode(*object))
</span><span class="cx">             return false;
</span><span class="cx">         result.m_transactionInfo = WTFMove(object);
</span><span class="lines">@@ -192,7 +201,7 @@
</span><span class="cx">     if (!decoder.decode(hasObject))
</span><span class="cx">         return false;
</span><span class="cx">     if (hasObject) {
</span><del>-        std::unique_ptr&lt;IDBKeyData&gt; object = std::make_unique&lt;IDBKeyData&gt;();
</del><ins>+        auto object = std::make_unique&lt;IDBKeyData&gt;();
</ins><span class="cx">         if (!decoder.decode(*object))
</span><span class="cx">             return false;
</span><span class="cx">         result.m_resultKey = WTFMove(object);
</span><span class="lines">@@ -201,12 +210,21 @@
</span><span class="cx">     if (!decoder.decode(hasObject))
</span><span class="cx">         return false;
</span><span class="cx">     if (hasObject) {
</span><del>-        std::unique_ptr&lt;IDBGetResult&gt; object = std::make_unique&lt;IDBGetResult&gt;();
</del><ins>+        auto object = std::make_unique&lt;IDBGetResult&gt;();
</ins><span class="cx">         if (!decoder.decode(*object))
</span><span class="cx">             return false;
</span><span class="cx">         result.m_getResult = WTFMove(object);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (!decoder.decode(hasObject))
+        return false;
+    if (hasObject) {
+        auto object = std::make_unique&lt;IDBGetAllResult&gt;();
+        if (!decoder.decode(*object))
+            return false;
+        result.m_getAllResult = WTFMove(object);
+    }
+
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -195,6 +195,13 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InProcessIDBServer::didGetAllRecords(const IDBResultData&amp; resultData)
+{
+    RunLoop::current().dispatch([this, protectedThis = makeRef(*this), resultData] {
+        m_connectionToServer-&gt;didGetAllRecords(resultData);
+    });
+}
+
</ins><span class="cx"> void InProcessIDBServer::didGetCount(const IDBResultData&amp; resultData)
</span><span class="cx"> {
</span><span class="cx">     RunLoop::current().dispatch([this, protectedThis = makeRef(*this), resultData] {
</span><span class="lines">@@ -307,6 +314,13 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InProcessIDBServer::getAllRecords(const IDBRequestData&amp; requestData, const IDBGetAllRecordsData&amp; getAllRecordsData)
+{
+    RunLoop::current().dispatch([this, protectedThis = makeRef(*this), requestData, getAllRecordsData] {
+        m_server-&gt;getAllRecords(requestData, getAllRecordsData);
+    });
+}
+
</ins><span class="cx"> void InProcessIDBServer::getCount(const IDBRequestData&amp; requestData, const IDBKeyRangeData&amp; keyRangeData)
</span><span class="cx"> {
</span><span class="cx">     RunLoop::current().dispatch([this, protectedThis = makeRef(*this), requestData, keyRangeData] {
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -71,6 +71,7 @@
</span><span class="cx">     void renameIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName) final;
</span><span class="cx">     void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const IDBValue&amp;, const IndexedDB::ObjectStoreOverwriteMode) final;
</span><span class="cx">     void getRecord(const IDBRequestData&amp;, const IDBGetRecordData&amp;) final;
</span><ins>+    void getAllRecords(const IDBRequestData&amp;, const IDBGetAllRecordsData&amp;) final;
</ins><span class="cx">     void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) final;
</span><span class="cx">     void deleteRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) final;
</span><span class="cx">     void openCursor(const IDBRequestData&amp;, const IDBCursorInfo&amp;) final;
</span><span class="lines">@@ -98,6 +99,7 @@
</span><span class="cx">     void didRenameIndex(const IDBResultData&amp;) final;
</span><span class="cx">     void didPutOrAdd(const IDBResultData&amp;) final;
</span><span class="cx">     void didGetRecord(const IDBResultData&amp;) final;
</span><ins>+    void didGetAllRecords(const IDBResultData&amp;) final;
</ins><span class="cx">     void didGetCount(const IDBResultData&amp;) final;
</span><span class="cx">     void didDeleteRecord(const IDBResultData&amp;) final;
</span><span class="cx">     void didOpenCursor(const IDBResultData&amp;) final;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -2206,6 +2206,10 @@
</span><span class="cx">                 5198F7AD1BBDD3EB00E2CC5F /* IDBTransactionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 5198F7AB1BBDD3E300E2CC5F /* IDBTransactionInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 5198F7C01BC4856700E2CC5F /* IDBConnectionToServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5185FCBC1BB5CB770012898F /* IDBConnectionToServer.cpp */; };
</span><span class="cx">                 5198F7C11BC4856700E2CC5F /* IDBConnectionToServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 510A58FD1BB07A9600C19282 /* IDBConnectionToServer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                519DBC6E1DC011A200329BF5 /* IDBGetAllRecordsData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 519DBC6D1DC00FB900329BF5 /* IDBGetAllRecordsData.cpp */; };
+                519DBC6F1DC011A700329BF5 /* IDBGetAllRecordsData.h in Headers */ = {isa = PBXBuildFile; fileRef = 519DBC6C1DC00FA000329BF5 /* IDBGetAllRecordsData.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                519DBC721DC10F5200329BF5 /* IDBGetAllResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 519DBC711DC10D3300329BF5 /* IDBGetAllResult.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                519DBC731DC10F5600329BF5 /* IDBGetAllResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 519DBC701DC10D3300329BF5 /* IDBGetAllResult.cpp */; };
</ins><span class="cx">                 51A052331058774F00CC9E95 /* CredentialStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 51A052311058774F00CC9E95 /* CredentialStorage.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 51A052341058774F00CC9E95 /* CredentialStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51A052321058774F00CC9E95 /* CredentialStorage.cpp */; };
</span><span class="cx">                 51A052561058874000CC9E95 /* ProtectionSpaceHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 51A052551058874000CC9E95 /* ProtectionSpaceHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -9314,6 +9318,10 @@
</span><span class="cx">                 5198F7A71BBDD38100E2CC5F /* UniqueIDBDatabaseTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UniqueIDBDatabaseTransaction.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5198F7AA1BBDD3E300E2CC5F /* IDBTransactionInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBTransactionInfo.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5198F7AB1BBDD3E300E2CC5F /* IDBTransactionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBTransactionInfo.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                519DBC6C1DC00FA000329BF5 /* IDBGetAllRecordsData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBGetAllRecordsData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                519DBC6D1DC00FB900329BF5 /* IDBGetAllRecordsData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBGetAllRecordsData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                519DBC701DC10D3300329BF5 /* IDBGetAllResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBGetAllResult.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                519DBC711DC10D3300329BF5 /* IDBGetAllResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBGetAllResult.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 519FE0A10DAD446E00A08F21 /* HTMLAttributeNames.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLAttributeNames.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 519FE0A20DAD446E00A08F21 /* HTMLTagNames.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLTagNames.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51A052311058774F00CC9E95 /* CredentialStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CredentialStorage.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16844,6 +16852,8 @@
</span><span class="cx">                                 51BA4AC21BBB5CBF00DF3D6D /* IDBDatabaseInfo.h */,
</span><span class="cx">                                 5148453C1BB9D076006A72ED /* IDBError.cpp */,
</span><span class="cx">                                 5148453D1BB9D076006A72ED /* IDBError.h */,
</span><ins>+                                519DBC6D1DC00FB900329BF5 /* IDBGetAllRecordsData.cpp */,
+                                519DBC6C1DC00FA000329BF5 /* IDBGetAllRecordsData.h */,
</ins><span class="cx">                                 5105F06A1D4BB0BC00FB80BC /* IDBGetRecordData.cpp */,
</span><span class="cx">                                 5105F0681D4BA54100FB80BC /* IDBGetRecordData.h */,
</span><span class="cx">                                 51F798EB1BE880D3008AE491 /* IDBIndexInfo.cpp */,
</span><span class="lines">@@ -18901,6 +18911,8 @@
</span><span class="cx">                                 51645B461B9F889B00F789CE /* IDBFactory.cpp */,
</span><span class="cx">                                 51645B471B9F889B00F789CE /* IDBFactory.h */,
</span><span class="cx">                                 51D7198A181106DF0016DC51 /* IDBFactory.idl */,
</span><ins>+                                519DBC701DC10D3300329BF5 /* IDBGetAllResult.cpp */,
+                                519DBC711DC10D3300329BF5 /* IDBGetAllResult.h */,
</ins><span class="cx">                                 512F1A771C07EA0D00908239 /* IDBGetResult.cpp */,
</span><span class="cx">                                 5123AF1C18918AE40031CDC9 /* IDBGetResult.h */,
</span><span class="cx">                                 51645B481B9F889B00F789CE /* IDBIndex.cpp */,
</span><span class="lines">@@ -24821,6 +24833,7 @@
</span><span class="cx">                                 E16A84FA14C85CCC002977DF /* CSSBorderImage.h in Headers */,
</span><span class="cx">                                 BC274B2F140EBEB200EADFA6 /* CSSBorderImageSliceValue.h in Headers */,
</span><span class="cx">                                 49AE2D8F134EE50C0072920A /* CSSCalculationValue.h in Headers */,
</span><ins>+                                519DBC6F1DC011A700329BF5 /* IDBGetAllRecordsData.h in Headers */,
</ins><span class="cx">                                 BC6049CC0DB560C200204739 /* CSSCanvasValue.h in Headers */,
</span><span class="cx">                                 BCEA4790097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h in Headers */,
</span><span class="cx">                                 9DAC7C551AF2CAA200437C44 /* CSSContentDistributionValue.h in Headers */,
</span><span class="lines">@@ -26287,6 +26300,7 @@
</span><span class="cx">                                 FFEFAB2A18380DA000514534 /* LineLayoutState.h in Headers */,
</span><span class="cx">                                 FFDBC047183D27B700407109 /* LineWidth.h in Headers */,
</span><span class="cx">                                 A7AD2F880EC89D07008AB002 /* LinkHash.h in Headers */,
</span><ins>+                                519DBC721DC10F5200329BF5 /* IDBGetAllResult.h in Headers */,
</ins><span class="cx">                                 1A4DA4221CDD3A8300F4473C /* LinkIconCollector.h in Headers */,
</span><span class="cx">                                 1A250E0D1CDD632000D0BE63 /* LinkIconType.h in Headers */,
</span><span class="cx">                                 98CE432A129E00E5005821DC /* LinkLoader.h in Headers */,
</span><span class="lines">@@ -28500,6 +28514,7 @@
</span><span class="cx">                                 CDEA76351460B71A008B31F1 /* Clock.cpp in Sources */,
</span><span class="cx">                                 CDEA76341460B56F008B31F1 /* ClockGeneric.cpp in Sources */,
</span><span class="cx">                                 9BD8A95A18BEFC7600987E9A /* CollectionIndexCache.cpp in Sources */,
</span><ins>+                                519DBC6E1DC011A200329BF5 /* IDBGetAllRecordsData.cpp in Sources */,
</ins><span class="cx">                                 B27535660B053814002CE64F /* Color.cpp in Sources */,
</span><span class="cx">                                 0FCF33240F2B9715004B6795 /* ColorCG.cpp in Sources */,
</span><span class="cx">                                 1ABA76C911D20E47004C201C /* ColorData.cpp in Sources */,
</span><span class="lines">@@ -29094,6 +29109,7 @@
</span><span class="cx">                                 A8EA7D320A19385500A8EF5F /* HTMLMapElement.cpp in Sources */,
</span><span class="cx">                                 A8EA7CAC0A192B9C00A8EF5F /* HTMLMarqueeElement.cpp in Sources */,
</span><span class="cx">                                 E44613A40CD6331000FADA75 /* HTMLMediaElement.cpp in Sources */,
</span><ins>+                                519DBC731DC10F5600329BF5 /* IDBGetAllResult.cpp in Sources */,
</ins><span class="cx">                                 C968B2E81B1E778100EF1F81 /* HTMLMediaElementMediaSession.cpp in Sources */,
</span><span class="cx">                                 0779BF0D18453168000B6AE7 /* HTMLMediaElementMediaStream.cpp in Sources */,
</span><span class="cx">                                 A8EA79F80A1916DF00A8EF5F /* HTMLMenuElement.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -301,7 +301,7 @@
</span><span class="cx">     return canInjectNthValueOnKeyPath(exec, scriptValue, keyPathElements, keyPathElements.size() - 1);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue deserializeIDBValueToJSValue(ExecState&amp; exec, const IDBValue&amp; value)
</del><ins>+static JSValue deserializeIDBValueToJSValue(ExecState&amp; state, JSC::JSGlobalObject&amp; globalObject, const IDBValue&amp; value)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: I think it's peculiar to use undefined to mean &quot;null data&quot; and null to mean &quot;empty data&quot;.
</span><span class="cx">     // But I am not changing this at the moment because at least some callers are specifically checking isUndefined.
</span><span class="lines">@@ -315,14 +315,25 @@
</span><span class="cx"> 
</span><span class="cx">     auto serializedValue = SerializedScriptValue::createFromWireBytes(Vector&lt;uint8_t&gt;(data));
</span><span class="cx"> 
</span><del>-    exec.vm().apiLock().lock();
</del><ins>+    state.vm().apiLock().lock();
</ins><span class="cx">     Vector&lt;RefPtr&lt;MessagePort&gt;&gt; messagePorts;
</span><del>-    JSValue result = serializedValue-&gt;deserialize(exec, exec.lexicalGlobalObject(), messagePorts, value.blobURLs(), value.blobFilePaths(), NonThrowing);
-    exec.vm().apiLock().unlock();
</del><ins>+    JSValue result = serializedValue-&gt;deserialize(state, &amp;globalObject, messagePorts, value.blobURLs(), value.blobFilePaths(), NonThrowing);
+    state.vm().apiLock().unlock();
</ins><span class="cx"> 
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSValue deserializeIDBValueToJSValue(ExecState&amp; state, const IDBValue&amp; value)
+{
+    return deserializeIDBValueToJSValue(state, *state.lexicalGlobalObject(), value);
+}
+
+JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, const IDBValue&amp; value)
+{
+    ASSERT(state);
+    return deserializeIDBValueToJSValue(*state, *globalObject, value);
+}
+
</ins><span class="cx"> Ref&lt;IDBKey&gt; scriptValueToIDBKey(ExecState&amp; exec, const JSValue&amp; scriptValue)
</span><span class="cx"> {
</span><span class="cx">     return createIDBKeyFromValue(exec, scriptValue);
</span><span class="lines">@@ -334,6 +345,14 @@
</span><span class="cx">     return toJS(exec, *exec.lexicalGlobalObject(), key.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, const IDBKeyData&amp; keyData)
+{
+    ASSERT(state);
+    ASSERT(globalObject);
+
+    return toJS(*state, *globalObject, keyData.maybeCreateIDBKey().get());
+}
+
</ins><span class="cx"> static Vector&lt;IDBKeyData&gt; createKeyPathArray(ExecState&amp; exec, JSValue value, const IDBIndexInfo&amp; info)
</span><span class="cx"> {
</span><span class="cx">     auto visitor = WTF::makeVisitor([&amp;](const String&amp; string) -&gt; Vector&lt;IDBKeyData&gt; {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsIDBBindingUtilitiesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -62,6 +62,9 @@
</span><span class="cx"> 
</span><span class="cx"> Ref&lt;IDBKey&gt; scriptValueToIDBKey(JSC::ExecState&amp;, const JSC::JSValue&amp;);
</span><span class="cx"> 
</span><ins>+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, const IDBKeyData&amp;);
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, const IDBValue&amp;);
+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebKit2/ChangeLog        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2016-10-31  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
+        &lt;rdar://problem/28806934&gt; and https://bugs.webkit.org/show_bug.cgi?id=164097
+
+        Reviewed by Darin Adler.
+
+        - Handle moving &quot;Get All&quot; requests to and from the DatabaseProcess.
+        - Handle the additional task of creating/passing Sandbox Extensions for
+          referenced files when necessary. 
+          
+        * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
+        (WebKit::WebIDBConnectionToClient::handleGetResult):
+        (WebKit::WebIDBConnectionToClient::didGetAllRecords):
+        (WebKit::WebIDBConnectionToClient::getAllRecords):
+        * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
+        * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
+        
+        * Shared/WebCoreArgumentCoders.h:
+        
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
+        (WebKit::WebIDBConnectionToServer::getAllRecords):
+        (WebKit::preregisterSandboxExtensionsIfNecessary):
+        (WebKit::WebIDBConnectionToServer::didGetAllRecords):
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
+
</ins><span class="cx"> 2016-10-31  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WK1] Candidate visibility should not update as a result of selection during a dictionary lookup
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -144,7 +144,12 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto&amp; blobFilePaths = resultData.getResult().value().blobFilePaths();
</del><ins>+    if (resultData.type() == IDBResultType::GetAllRecordsSuccess &amp;&amp; resultData.getAllResult().type() == IndexedDB::GetAllType::Keys) {
+        send(MessageType(resultData));
+        return;
+    }
+
+    auto blobFilePaths = resultData.type() == IDBResultType::GetAllRecordsSuccess ? resultData.getAllResult().allBlobFilePaths() : resultData.getResult().value().blobFilePaths();
</ins><span class="cx">     if (blobFilePaths.isEmpty()) {
</span><span class="cx">         send(MessageType(resultData));
</span><span class="cx">         return;
</span><span class="lines">@@ -165,6 +170,11 @@
</span><span class="cx">     handleGetResult&lt;Messages::WebIDBConnectionToServer::DidGetRecord&gt;(resultData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebIDBConnectionToClient::didGetAllRecords(const WebCore::IDBResultData&amp; resultData)
+{
+    handleGetResult&lt;Messages::WebIDBConnectionToServer::DidGetAllRecords&gt;(resultData);
+}
+
</ins><span class="cx"> void WebIDBConnectionToClient::didGetCount(const WebCore::IDBResultData&amp; resultData)
</span><span class="cx"> {
</span><span class="cx">     send(Messages::WebIDBConnectionToServer::DidGetCount(resultData));
</span><span class="lines">@@ -290,6 +300,11 @@
</span><span class="cx">     DatabaseProcess::singleton().idbServer().getRecord(request, getRecordData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebIDBConnectionToClient::getAllRecords(const IDBRequestData&amp; request, const IDBGetAllRecordsData&amp; getAllRecordsData)
+{
+    DatabaseProcess::singleton().idbServer().getAllRecords(request, getAllRecordsData);
+}
+
</ins><span class="cx"> void WebIDBConnectionToClient::getCount(const IDBRequestData&amp; request, const IDBKeyRangeData&amp; range)
</span><span class="cx"> {
</span><span class="cx">     DatabaseProcess::singleton().idbServer().getCount(request, range);
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> class IDBTransactionInfo;
</span><span class="cx"> class IDBValue;
</span><span class="cx"> class SerializedScriptValue;
</span><ins>+struct IDBGetAllRecordsData;
</ins><span class="cx"> struct IDBGetRecordData;
</span><span class="cx"> struct IDBKeyRangeData;
</span><span class="cx"> struct SecurityOriginData;
</span><span class="lines">@@ -71,6 +72,7 @@
</span><span class="cx">     void didRenameIndex(const WebCore::IDBResultData&amp;) final;
</span><span class="cx">     void didPutOrAdd(const WebCore::IDBResultData&amp;) final;
</span><span class="cx">     void didGetRecord(const WebCore::IDBResultData&amp;) final;
</span><ins>+    void didGetAllRecords(const WebCore::IDBResultData&amp;) final;
</ins><span class="cx">     void didGetCount(const WebCore::IDBResultData&amp;) final;
</span><span class="cx">     void didDeleteRecord(const WebCore::IDBResultData&amp;) final;
</span><span class="cx">     void didOpenCursor(const WebCore::IDBResultData&amp;) final;
</span><span class="lines">@@ -101,6 +103,7 @@
</span><span class="cx">     void renameIndex(const WebCore::IDBRequestData&amp;, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName);
</span><span class="cx">     void putOrAdd(const WebCore::IDBRequestData&amp;, const WebCore::IDBKeyData&amp;, const WebCore::IDBValue&amp;, unsigned overwriteMode);
</span><span class="cx">     void getRecord(const WebCore::IDBRequestData&amp;, const WebCore::IDBGetRecordData&amp;);
</span><ins>+    void getAllRecords(const WebCore::IDBRequestData&amp;, const WebCore::IDBGetAllRecordsData&amp;);
</ins><span class="cx">     void getCount(const WebCore::IDBRequestData&amp;, const WebCore::IDBKeyRangeData&amp;);
</span><span class="cx">     void deleteRecord(const WebCore::IDBRequestData&amp;, const WebCore::IDBKeyRangeData&amp;);
</span><span class="cx">     void openCursor(const WebCore::IDBRequestData&amp;, const WebCore::IDBCursorInfo&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClientmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx">     RenameIndex(WebCore::IDBRequestData requestData, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, String newName);
</span><span class="cx">     PutOrAdd(WebCore::IDBRequestData requestData, WebCore::IDBKeyData key, WebCore::IDBValue value, unsigned overwriteMode);
</span><span class="cx">     GetRecord(WebCore::IDBRequestData requestData, struct WebCore::IDBGetRecordData getRecordData);
</span><ins>+    GetAllRecords(WebCore::IDBRequestData requestData, struct WebCore::IDBGetAllRecordsData getAllRecordsData);
</ins><span class="cx">     GetCount(WebCore::IDBRequestData requestData, struct WebCore::IDBKeyRangeData range);
</span><span class="cx">     DeleteRecord(WebCore::IDBRequestData requestData, struct WebCore::IDBKeyRangeData range);
</span><span class="cx">     OpenCursor(WebCore::IDBRequestData requestData, WebCore::IDBCursorInfo info);
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformIPCArgumentCodersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Platform/IPC/ArgumentCoders.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/IPC/ArgumentCoders.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebKit2/Platform/IPC/ArgumentCoders.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> #include &lt;wtf/OptionSet.h&gt;
</span><span class="cx"> #include &lt;wtf/Optional.h&gt;
</span><ins>+#include &lt;wtf/Variant.h&gt;
</ins><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace IPC {
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCoreArgumentCodersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ArgumentCoders.h&quot;
</span><span class="cx"> #include &lt;WebCore/FrameLoaderTypes.h&gt;
</span><ins>+#include &lt;WebCore/IndexedDB.h&gt;
</ins><span class="cx"> #include &lt;WebCore/PaymentHeaders.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -574,4 +575,14 @@
</span><span class="cx">     &gt;;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+template&lt;&gt; struct EnumTraits&lt;WebCore::IndexedDB::GetAllType&gt; {
+    using values = EnumValues&lt;
+        WebCore::IndexedDB::GetAllType,
+        WebCore::IndexedDB::GetAllType::Keys,
+        WebCore::IndexedDB::GetAllType::Values
+    &gt;;
+};
+#endif
+
</ins><span class="cx"> } // namespace WTF
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -154,6 +154,11 @@
</span><span class="cx">     send(Messages::WebIDBConnectionToClient::GetRecord(requestData, getRecordData));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebIDBConnectionToServer::getAllRecords(const IDBRequestData&amp; requestData, const IDBGetAllRecordsData&amp; getAllRecordsData)
+{
+    send(Messages::WebIDBConnectionToClient::GetAllRecords(requestData, getAllRecordsData));
+}
+
</ins><span class="cx"> void WebIDBConnectionToServer::getCount(const IDBRequestData&amp; requestData, const IDBKeyRangeData&amp; range)
</span><span class="cx"> {
</span><span class="cx">     send(Messages::WebIDBConnectionToClient::GetCount(requestData, range));
</span><span class="lines">@@ -272,12 +277,12 @@
</span><span class="cx"> static void preregisterSandboxExtensionsIfNecessary(const WebIDBResult&amp; result)
</span><span class="cx"> {
</span><span class="cx">     auto resultType = result.resultData().type();
</span><del>-    if (resultType != IDBResultType::GetRecordSuccess &amp;&amp; resultType != IDBResultType::OpenCursorSuccess &amp;&amp; resultType != IDBResultType::IterateCursorSuccess) {
</del><ins>+    if (resultType != IDBResultType::GetRecordSuccess &amp;&amp; resultType != IDBResultType::OpenCursorSuccess &amp;&amp; resultType != IDBResultType::IterateCursorSuccess &amp;&amp; resultType != IDBResultType::GetAllRecordsSuccess) {
</ins><span class="cx">         ASSERT(resultType == IDBResultType::Error);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    const auto&amp; filePaths = result.resultData().getResult().value().blobFilePaths();
</del><ins>+    const auto filePaths = resultType == IDBResultType::GetAllRecordsSuccess ? result.resultData().getAllResult().allBlobFilePaths() : result.resultData().getResult().value().blobFilePaths();
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(SANDBOX_EXTENSIONS)
</span><span class="cx">     ASSERT(filePaths.size() == result.handles().size());
</span><span class="lines">@@ -293,6 +298,13 @@
</span><span class="cx">     m_connectionToServer-&gt;didGetRecord(result.resultData());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebIDBConnectionToServer::didGetAllRecords(const WebIDBResult&amp; result)
+{
+    if (result.resultData().getAllResult().type() == IndexedDB::GetAllType::Values)
+        preregisterSandboxExtensionsIfNecessary(result);
+    m_connectionToServer-&gt;didGetAllRecords(result.resultData());
+}
+
</ins><span class="cx"> void WebIDBConnectionToServer::didGetCount(const IDBResultData&amp; result)
</span><span class="cx"> {
</span><span class="cx">     m_connectionToServer-&gt;didGetCount(result);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx">     void renameIndex(const WebCore::IDBRequestData&amp;, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName) final;
</span><span class="cx">     void putOrAdd(const WebCore::IDBRequestData&amp;, const WebCore::IDBKeyData&amp;, const WebCore::IDBValue&amp;, const WebCore::IndexedDB::ObjectStoreOverwriteMode) final;
</span><span class="cx">     void getRecord(const WebCore::IDBRequestData&amp;, const WebCore::IDBGetRecordData&amp;) final;
</span><ins>+    void getAllRecords(const WebCore::IDBRequestData&amp;, const WebCore::IDBGetAllRecordsData&amp;) final;
</ins><span class="cx">     void getCount(const WebCore::IDBRequestData&amp;, const WebCore::IDBKeyRangeData&amp;) final;
</span><span class="cx">     void deleteRecord(const WebCore::IDBRequestData&amp;, const WebCore::IDBKeyRangeData&amp;) final;
</span><span class="cx">     void openCursor(const WebCore::IDBRequestData&amp;, const WebCore::IDBCursorInfo&amp;) final;
</span><span class="lines">@@ -90,6 +91,7 @@
</span><span class="cx">     void didRenameIndex(const WebCore::IDBResultData&amp;);
</span><span class="cx">     void didPutOrAdd(const WebCore::IDBResultData&amp;);
</span><span class="cx">     void didGetRecord(const WebIDBResult&amp;);
</span><ins>+    void didGetAllRecords(const WebIDBResult&amp;);
</ins><span class="cx">     void didGetCount(const WebCore::IDBResultData&amp;);
</span><span class="cx">     void didDeleteRecord(const WebCore::IDBResultData&amp;);
</span><span class="cx">     void didOpenCursor(const WebIDBResult&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServermessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in (208193 => 208194)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in        2016-10-31 23:37:55 UTC (rev 208193)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in        2016-10-31 23:43:50 UTC (rev 208194)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx">     DidRenameIndex(WebCore::IDBResultData result)
</span><span class="cx">     DidPutOrAdd(WebCore::IDBResultData result)
</span><span class="cx">     DidGetRecord(WebKit::WebIDBResult result)
</span><ins>+    DidGetAllRecords(WebKit::WebIDBResult result)
</ins><span class="cx">     DidGetCount(WebCore::IDBResultData result)
</span><span class="cx">     DidDeleteRecord(WebCore::IDBResultData result)
</span><span class="cx">     DidOpenCursor(WebKit::WebIDBResult result)
</span></span></pre>
</div>
</div>

</body>
</html>