<!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.
<rdar://problem/28806934> 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 "IDBGetAllRequestData" and "IDBGetAllResult" to represent these
new requests and responses.
- Add lots of boilerplate code to move these new objects around in the IDB machinery.
- Update "GetRecord" code to be shared with "GetAll" 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 "Get All" 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 <beidson@apple.com>
+
+ IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
+ <rdar://problem/28806934> 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 <ryanhaddad@apple.com>
</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 <beidson@apple.com>
+
+ IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
+ <rdar://problem/28806934> 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 <rniwa@webkit.org>
</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 "PASS" messages, followed by "TEST COMPLETE".
+
+
+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 "PASS" messages, followed by "TEST COMPLETE".
+
+
+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>+<html>
+<head>
+<script>
+enablePrivateBrowsing = true;
+</script>
+<script src="../../../resources/js-test.js"></script>
+<script src="../resources/shared.js"></script>
+</head>
+<body>
+
+<script src="resources/idbobjectstore-getall-1.js"></script>
+</body>
+</html>
</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>+<html>
+<head>
+<script src="../../../resources/js-test.js"></script>
+<script src="../resources/shared.js"></script>
+</head>
+<body>
+
+<script src="resources/idbobjectstore-getall-1.js"></script>
+</body>
+</html>
</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 "PASS" messages, followed by "TEST COMPLETE".
+
+
+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 "PASS" messages, followed by "TEST COMPLETE".
+
+
+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>+<html>
+<head>
+<script>
+enablePrivateBrowsing = true;
+</script>
+<script src="../../../resources/js-test.js"></script>
+<script src="../resources/shared.js"></script>
+</head>
+<body>
+
+<script src="resources/idbobjectstore-getallkeys-1.js"></script>
+</body>
+</html>
</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>+<html>
+<head>
+<script src="../../../resources/js-test.js"></script>
+<script src="../resources/shared.js"></script>
+</head>
+<body>
+
+<script src="resources/idbobjectstore-getallkeys-1.js"></script>
+</body>
+</html>
</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("Test IDBObjectStore.getAll()");
+
+indexedDBTest(prepareDatabase);
+
+function done()
+{
+ finishJSTest();
+}
+
+function log(message)
+{
+ debug(message);
+}
+
+var testGenerator;
+
+function continueWithEvent(event)
+{
+ testGenerator.next(event);
+}
+
+function asyncContinue()
+{
+ setTimeout("testGenerator.next();", 0);
+}
+
+function idbRequest(request)
+{
+ request.onerror = continueWithEvent;
+ request.onsuccess = continueWithEvent;
+        return request;
+}
+
+var db;
+
+function prepareDatabase(event)
+{
+ debug("Initial upgrade needed: Old version - " + event.oldVersion + " New version - " + event.newVersion);
+
+ db = event.target.result;
+ os = db.createObjectStore("foo");
+        os.add(false, 1);
+        os.add(-10, 2);
+        os.add(10, 3);
+        os.add("hello", 4);
+        os.add("hellothere", 5);
+
+ event.target.transaction.oncomplete = function() {
+ testGenerator = testSteps();
+ testGenerator.next();
+ };
+}
+
+function dumpArray(array)
+{
+        if (!array) {
+                debug("Undefined array");
+                return;
+        }
+
+        var string = "[ ";
+        for (var i = 0; i < array.length; ++i)
+                string += "'" + array[i] + "' ";
+        string += "]";
+        
+        debug(string);
+}
+
+function is(a, b, message) {
+ result = a == b ? "true" : "false";
+ debug(message + ": " + result);
+}
+
+function* testSteps()
+{
+ objectStore = db.transaction("foo").objectStore("foo");
+
+        // Get everything
+ req = idbRequest(objectStore.getAll());
+ event = yield;
+        debug("getAll() result is:");
+        dumpArray(req.result);
+
+        // Get everything, limit to 4
+ req = idbRequest(objectStore.getAll(undefined, 4));
+ event = yield;
+        debug("getAll(undefined, 4) result is:");
+        dumpArray(req.result);
+        
+        // Non-existent key
+ req = idbRequest(objectStore.getAll(6));
+ event = yield;
+        debug("getAll(6) result is:");
+        dumpArray(req.result);
+
+        // Existent key
+ req = idbRequest(objectStore.getAll(3));
+ event = yield;
+        debug("getAll(3) result is:");
+        dumpArray(req.result);
+        
+        // Key range only
+ req = idbRequest(objectStore.getAll(IDBKeyRange.only(5)));
+ event = yield;
+        debug("getAll(IDBKeyRange.only(5)) result is:");
+        dumpArray(req.result);
+
+        // Key range lower bound
+ req = idbRequest(objectStore.getAll(IDBKeyRange.lowerBound(2)));
+ event = yield;
+        debug("getAll(IDBKeyRange.lowerBound(2)) result is:");
+        dumpArray(req.result);
+
+        // Key range upper bound
+ req = idbRequest(objectStore.getAll(IDBKeyRange.upperBound(2)));
+ event = yield;
+        debug("getAll(IDBKeyRange.upperBound(2)) result is:");
+        dumpArray(req.result);
+
+        // Key range bound
+ req = idbRequest(objectStore.getAll(IDBKeyRange.bound(2, 4)));
+ event = yield;
+        debug("getAll(IDBKeyRange.bound(2, 4)) result is:");
+        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("Test IDBObjectStore.getAllKeys()");
+
+indexedDBTest(prepareDatabase);
+
+function done()
+{
+ finishJSTest();
+}
+
+function log(message)
+{
+ debug(message);
+}
+
+var testGenerator;
+
+function continueWithEvent(event)
+{
+ testGenerator.next(event);
+}
+
+function asyncContinue()
+{
+ setTimeout("testGenerator.next();", 0);
+}
+
+function idbRequest(request)
+{
+ request.onerror = continueWithEvent;
+ request.onsuccess = continueWithEvent;
+        return request;
+}
+
+var db;
+
+function prepareDatabase(event)
+{
+ debug("Initial upgrade needed: Old version - " + event.oldVersion + " New version - " + event.newVersion);
+
+ db = event.target.result;
+ os = db.createObjectStore("foo");
+        os.add(false, 1);
+        os.add(-10, 2);
+        os.add(10, 3);
+        os.add("hello", 4);
+        os.add("hellothere", 5);
+
+ event.target.transaction.oncomplete = function() {
+ testGenerator = testSteps();
+ testGenerator.next();
+ };
+}
+
+function dumpArray(array)
+{
+        if (!array) {
+                debug("Undefined array");
+                return;
+        }
+
+        var string = "[ ";
+        for (var i = 0; i < array.length; ++i)
+                string += "'" + array[i] + "' ";
+        string += "]";
+        
+        debug(string);
+}
+
+function is(a, b, message) {
+ result = a == b ? "true" : "false";
+ debug(message + ": " + result);
+}
+
+function* testSteps()
+{
+ objectStore = db.transaction("foo").objectStore("foo");
+
+        // Get everything
+ req = idbRequest(objectStore.getAllKeys());
+ event = yield;
+        debug("getAllKeys() result is:");
+        dumpArray(req.result);
+
+        // Get everything, limit to 4
+ req = idbRequest(objectStore.getAllKeys(undefined, 4));
+ event = yield;
+        debug("getAllKeys(undefined, 4) result is:");
+        dumpArray(req.result);
+        
+        // Non-existent key
+ req = idbRequest(objectStore.getAllKeys(6));
+ event = yield;
+        debug("getAllKeys(6) result is:");
+        dumpArray(req.result);
+
+        // Existent key
+ req = idbRequest(objectStore.getAllKeys(3));
+ event = yield;
+        debug("getAllKeys(3) result is:");
+        dumpArray(req.result);
+        
+        // Key range only
+ req = idbRequest(objectStore.getAllKeys(IDBKeyRange.only(5)));
+ event = yield;
+        debug("getAllKeys(IDBKeyRange.only(5)) result is:");
+        dumpArray(req.result);
+
+        // Key range lower bound
+ req = idbRequest(objectStore.getAllKeys(IDBKeyRange.lowerBound(2)));
+ event = yield;
+        debug("getAllKeys(IDBKeyRange.lowerBound(2)) result is:");
+        dumpArray(req.result);
+
+        // Key range upper bound
+ req = idbRequest(objectStore.getAllKeys(IDBKeyRange.upperBound(2)));
+ event = yield;
+        debug("getAllKeys(IDBKeyRange.upperBound(2)) result is:");
+        dumpArray(req.result);
+
+        // Key range bound
+ req = idbRequest(objectStore.getAllKeys(IDBKeyRange.bound(2, 4)));
+ event = yield;
+        debug("getAllKeys(IDBKeyRange.bound(2, 4)) result is:");
+        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 <beidson@apple.com>
+
+ IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
+ <rdar://problem/28806934> 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 "IDBGetAllRequestData" and "IDBGetAllResult" to represent these
+ new requests and responses.
+ - Add lots of boilerplate code to move these new objects around in the IDB machinery.
+ - Update "GetRecord" code to be shared with "GetAll" 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 <rniwa@webkit.org>
</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 "config.h"
+#include "IDBGetAllResult.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include <wtf/HashSet.h>
+
+namespace WebCore {
+
+template<typename T> void isolatedCopyOfVariant(const WTF::Variant<Vector<IDBKeyData>, Vector<IDBValue>, std::nullptr_t>& source, WTF::Variant<Vector<IDBKeyData>, Vector<IDBValue>, std::nullptr_t>& target)
+{
+ target = Vector<T>();
+ auto& sourceVector = WTF::get<Vector<T>>(source);
+ auto& targetVector = WTF::get<Vector<T>>(target);
+ targetVector.reserveInitialCapacity(sourceVector.size());
+ for (auto& element : sourceVector)
+ targetVector.uncheckedAppend(element.isolatedCopy());
+}
+
+IDBGetAllResult IDBGetAllResult::isolatedCopy() const
+{
+ IDBGetAllResult result;
+ result.m_type = m_type;
+
+ if (WTF::holds_alternative<std::nullptr_t>(m_results))
+ return result;
+
+ switch (m_type) {
+ case IndexedDB::GetAllType::Keys:
+ isolatedCopyOfVariant<IDBKeyData>(m_results, result.m_results);
+ break;
+ case IndexedDB::GetAllType::Values:
+ isolatedCopyOfVariant<IDBValue>(m_results, result.m_results);
+ break;
+ }
+
+ return result;
+}
+
+void IDBGetAllResult::addKey(IDBKeyData&& key)
+{
+ ASSERT(m_type == IndexedDB::GetAllType::Keys);
+ ASSERT(WTF::holds_alternative<Vector<IDBKeyData>>(m_results));
+ WTF::get<Vector<IDBKeyData>>(m_results).append(WTFMove(key));
+}
+
+void IDBGetAllResult::addValue(IDBValue&& value)
+{
+ ASSERT(m_type == IndexedDB::GetAllType::Values);
+ ASSERT(WTF::holds_alternative<Vector<IDBValue>>(m_results));
+ WTF::get<Vector<IDBValue>>(m_results).append(WTFMove(value));
+}
+
+const Vector<IDBKeyData>& IDBGetAllResult::keys() const
+{
+ ASSERT(m_type == IndexedDB::GetAllType::Keys);
+ ASSERT(WTF::holds_alternative<Vector<IDBKeyData>>(m_results));
+ return WTF::get<Vector<IDBKeyData>>(m_results);
+}
+
+const Vector<IDBValue>& IDBGetAllResult::values() const
+{
+ ASSERT(m_type == IndexedDB::GetAllType::Values);
+ ASSERT(WTF::holds_alternative<Vector<IDBValue>>(m_results));
+ return WTF::get<Vector<IDBValue>>(m_results);
+}
+
+Vector<String> IDBGetAllResult::allBlobFilePaths() const
+{
+ ASSERT(m_type == IndexedDB::GetAllType::Values);
+
+ HashSet<String> pathSet;
+ for (auto& value : WTF::get<Vector<IDBValue>>(m_results)) {
+ for (auto& path : value.blobFilePaths())
+ pathSet.add(path);
+ }
+
+ Vector<String> 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 "IDBKeyData.h"
+#include "IDBValue.h"
+#include "IndexedDB.h"
+
+#include <wtf/Variant.h>
+
+namespace WebCore {
+
+class IDBGetAllResult {
+public:
+ IDBGetAllResult()
+ {
+ }
+
+ IDBGetAllResult(IndexedDB::GetAllType type)
+ : m_type(type)
+ {
+ switch (m_type) {
+ case IndexedDB::GetAllType::Keys:
+ m_results = Vector<IDBKeyData>();
+ break;
+ case IndexedDB::GetAllType::Values:
+ m_results = Vector<IDBValue>();
+ break;
+ }
+ }
+
+ IDBGetAllResult isolatedCopy() const;
+
+ IndexedDB::GetAllType type() const { return m_type; }
+ const Vector<IDBKeyData>& keys() const;
+ const Vector<IDBValue>& values() const;
+
+ void addKey(IDBKeyData&&);
+ void addValue(IDBValue&&);
+
+ template<class Encoder> void encode(Encoder&) const;
+ template<class Decoder> static bool decode(Decoder&, IDBGetAllResult&);
+
+ WEBCORE_EXPORT Vector<String> allBlobFilePaths() const;
+
+private:
+ IndexedDB::GetAllType m_type { IndexedDB::GetAllType::Keys };
+ WTF::Variant<Vector<IDBKeyData>, Vector<IDBValue>, std::nullptr_t> m_results { nullptr };
+};
+
+template<class Encoder>
+void IDBGetAllResult::encode(Encoder& encoder) const
+{
+ encoder << m_type << static_cast<uint64_t>(m_results.index());
+
+ switch (m_results.index()) {
+ case 0:
+ encoder << WTF::get<Vector<IDBKeyData>>(m_results);
+ break;
+ case 1:
+ encoder << WTF::get<Vector<IDBValue>>(m_results);
+ break;
+ case 2:
+ break;
+ default:
+ RELEASE_ASSERT_NOT_REACHED();
+ }
+}
+
+template<class Decoder>
+bool IDBGetAllResult::decode(Decoder& decoder, IDBGetAllResult& 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<IDBKeyData>();
+ if (!decoder.decode(WTF::get<Vector<IDBKeyData>>(result.m_results)))
+ return false;
+ break;
+ case 1:
+ result.m_results = Vector<IDBValue>();
+ if (!decoder.decode(WTF::get<Vector<IDBValue>>(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->requestCount(execState, *this, range);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAll(ExecState& execState, RefPtr<IDBKeyRange> range, Optional<uint32_t> count)
+{
+ LOG(IndexedDB, "IDBObjectStore::getAll");
+ ASSERT(currentThread() == m_transaction->database().originThreadID());
+
+ if (m_deleted)
+ return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'getAll' on 'IDBObjectStore': The object store has been deleted.") };
+
+ if (!m_transaction->isActive())
+ return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral("Failed to execute 'getAll' on 'IDBObjectStore': The transaction is inactive or finished.") };
+
+ return m_transaction->requestGetAllObjectStoreRecords(execState, *this, range.get(), IndexedDB::GetAllType::Values, count);
+}
+
+ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAll(ExecState& execState, JSValue key, Optional<uint32_t> count)
+{
+ auto onlyResult = IDBKeyRange::only(execState, key);
+ if (onlyResult.hasException())
+ return Exception { IDBDatabaseException::DataError, ASCIILiteral("Failed to execute 'getAll' on 'IDBObjectStore': The parameter is not a valid key.") };
+
+ return getAll(execState, onlyResult.releaseReturnValue(), count);
+}
+
+ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAllKeys(ExecState& execState, RefPtr<IDBKeyRange> range, Optional<uint32_t> count)
+{
+ LOG(IndexedDB, "IDBObjectStore::getAllKeys");
+ ASSERT(currentThread() == m_transaction->database().originThreadID());
+
+ if (m_deleted)
+ return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'getAllKeys' on 'IDBObjectStore': The object store has been deleted.") };
+
+ if (!m_transaction->isActive())
+ return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral("Failed to execute 'getAllKeys' on 'IDBObjectStore': The transaction is inactive or finished.") };
+
+ return m_transaction->requestGetAllObjectStoreRecords(execState, *this, range.get(), IndexedDB::GetAllType::Keys, count);
+}
+
+ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAllKeys(ExecState& execState, JSValue key, Optional<uint32_t> count)
+{
+ auto onlyResult = IDBKeyRange::only(execState, key);
+ if (onlyResult.hasException())
+ return Exception { IDBDatabaseException::DataError, ASCIILiteral("Failed to execute 'getAllKeys' on 'IDBObjectStore': The parameter is not a valid key.") };
+
+ 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->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<void> deleteIndex(const String& name);
</span><span class="cx"> ExceptionOr<Ref<IDBRequest>> count(JSC::ExecState&, IDBKeyRange*);
</span><span class="cx"> ExceptionOr<Ref<IDBRequest>> count(JSC::ExecState&, JSC::JSValue key);
</span><ins>+ ExceptionOr<Ref<IDBRequest>> getAll(JSC::ExecState&, RefPtr<IDBKeyRange>, Optional<uint32_t> count);
+ ExceptionOr<Ref<IDBRequest>> getAll(JSC::ExecState&, JSC::JSValue key, Optional<uint32_t> count);
+ ExceptionOr<Ref<IDBRequest>> getAllKeys(JSC::ExecState&, RefPtr<IDBKeyRange>, Optional<uint32_t> count);
+ ExceptionOr<Ref<IDBRequest>> getAllKeys(JSC::ExecState&, JSC::JSValue key, Optional<uint32_t> count);
</ins><span class="cx">
</span><span class="cx"> ExceptionOr<Ref<IDBRequest>> putForCursorUpdate(JSC::ExecState&, 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 = "next");
</span><span class="cx"> [CallWith=ScriptState, MayThrowException] IDBRequest openKeyCursor(optional IDBKeyRange? range = null, optional DOMString direction = "next");
</span><span class="cx"> [CallWith=ScriptState, MayThrowException] IDBRequest openKeyCursor(any key, optional DOMString direction = "next");
</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<DOMString>) 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 "IDBKeyData.h"
</span><span class="cx"> #include "IDBObjectStore.h"
</span><span class="cx"> #include "IDBResultData.h"
</span><ins>+#include "JSDOMConvert.h"
</ins><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "ScopeGuard.h"
</span><span class="cx"> #include "ScriptExecutionContext.h"
</span><span class="lines">@@ -48,6 +49,8 @@
</span><span class="cx"> #include "ThreadSafeDataBuffer.h"
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="cx">
</span><ins>+using namespace JSC;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> Ref<IDBRequest> IDBRequest::create(ScriptExecutionContext& context, IDBObjectStore& objectStore, IDBTransaction& transaction)
</span><span class="lines">@@ -330,6 +333,42 @@
</span><span class="cx"> m_scriptResult = { context->vm(), idbKeyDataToScriptValue(*exec, keyData) };
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBRequest::setResult(const Vector<IDBKeyData>& keyDatas)
+{
+ ASSERT(currentThread() == originThreadID());
+
+ auto* context = scriptExecutionContext();
+ if (!context)
+ return;
+
+ auto* state = context->execState();
+ if (!state)
+ return;
+
+ clearResult();
+
+ Locker<JSLock> locker(context->vm().apiLock());
+ m_scriptResult = { context->vm(), toJS(state, jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), keyDatas) };
+}
+
+void IDBRequest::setResult(const Vector<IDBValue>& values)
+{
+ ASSERT(currentThread() == originThreadID());
+
+ auto* context = scriptExecutionContext();
+ if (!context)
+ return;
+
+ auto* exec = context->execState();
+ if (!exec)
+ return;
+
+ clearResult();
+
+ Locker<JSLock> locker(context->vm().apiLock());
+ m_scriptResult = { context->vm(), toJS(exec, jsCast<JSDOMGlobalObject*>(exec->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&);
</span><span class="cx">
</span><span class="cx"> void setResult(const IDBKeyData&);
</span><ins>+ void setResult(const Vector<IDBKeyData>&);
+ void setResult(const Vector<IDBValue>&);
</ins><span class="cx"> void setResult(uint64_t);
</span><span class="cx"> void setResultToStructuredClone(const IDBValue&);
</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<IDBRequest> IDBTransaction::requestGetAllObjectStoreRecords(JSC::ExecState& state, IDBObjectStore& objectStore, const IDBKeyRangeData& keyRangeData, IndexedDB::GetAllType getAllType, Optional<uint32_t> count)
+{
+ LOG(IndexedDB, "IDBTransaction::requestGetAllObjectStoreRecords");
+ ASSERT(isActive());
+ ASSERT(currentThread() == m_database->originThreadID());
+
+ ASSERT_UNUSED(state, scriptExecutionContext() == scriptExecutionContextFromExecState(&state));
+
+ Ref<IDBRequest> 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(), &IDBTransaction::didGetAllRecordsOnServer, &IDBTransaction::getAllRecordsOnServer, getAllRecordsData);
+ scheduleOperation(WTFMove(operation));
+
+ return request;
+}
+
+void IDBTransaction::getAllRecordsOnServer(IDBClient::TransactionOperation& operation, const IDBGetAllRecordsData& getAllRecordsData)
+{
+ LOG(IndexedDB, "IDBTransaction::getAllRecordsOnServer");
+ ASSERT(currentThread() == m_database->originThreadID());
+
+ m_database->connectionProxy().getAllRecords(operation, getAllRecordsData);
+}
+
+void IDBTransaction::didGetAllRecordsOnServer(IDBRequest& request, const IDBResultData& resultData)
+{
+ LOG(IndexedDB, "IDBTransaction::didGetAllRecordsOnServer");
+ ASSERT(currentThread() == m_database->originThreadID());
+
+ if (resultData.type() == IDBResultType::Error) {
+ request.requestCompleted(resultData);
+ return;
+ }
+
+ ASSERT(resultData.type() == IDBResultType::GetAllRecordsSuccess);
+
+ auto& 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<IDBRequest> IDBTransaction::requestGetRecord(ExecState& execState, IDBObjectStore& objectStore, const IDBGetRecordData& getRecordData)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::requestGetRecord");
</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 "EventTarget.h"
</span><span class="cx"> #include "IDBActiveDOMObject.h"
</span><span class="cx"> #include "IDBError.h"
</span><ins>+#include "IDBGetAllRecordsData.h"
</ins><span class="cx"> #include "IDBGetRecordData.h"
</span><span class="cx"> #include "IDBKeyRangeData.h"
</span><span class="cx"> #include "IDBOpenDBRequest.h"
</span><span class="lines">@@ -113,6 +114,7 @@
</span><span class="cx">
</span><span class="cx"> Ref<IDBRequest> requestPutOrAdd(JSC::ExecState&, IDBObjectStore&, IDBKey*, SerializedScriptValue&, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx"> Ref<IDBRequest> requestGetRecord(JSC::ExecState&, IDBObjectStore&, const IDBGetRecordData&);
</span><ins>+ Ref<IDBRequest> requestGetAllObjectStoreRecords(JSC::ExecState&, IDBObjectStore&, const IDBKeyRangeData&, IndexedDB::GetAllType, Optional<uint32_t> count);
</ins><span class="cx"> Ref<IDBRequest> requestDeleteRecord(JSC::ExecState&, IDBObjectStore&, const IDBKeyRangeData&);
</span><span class="cx"> Ref<IDBRequest> requestClearObjectStore(JSC::ExecState&, IDBObjectStore&);
</span><span class="cx"> Ref<IDBRequest> requestCount(JSC::ExecState&, IDBObjectStore&, const IDBKeyRangeData&);
</span><span class="lines">@@ -185,6 +187,9 @@
</span><span class="cx"> void getRecordOnServer(IDBClient::TransactionOperation&, const IDBGetRecordData&);
</span><span class="cx"> void didGetRecordOnServer(IDBRequest&, const IDBResultData&);
</span><span class="cx">
</span><ins>+ void getAllRecordsOnServer(IDBClient::TransactionOperation&, const IDBGetAllRecordsData&);
+ void didGetAllRecordsOnServer(IDBRequest&, const IDBResultData&);
+
</ins><span class="cx"> void getCountOnServer(IDBClient::TransactionOperation&, const IDBKeyRangeData&);
</span><span class="cx"> void didGetCountOnServer(IDBRequest&, const IDBResultData&);
</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(&IDBConnectionToServer::getRecord, requestData, getRecordData);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBConnectionProxy::getAllRecords(TransactionOperation& operation, const IDBGetAllRecordsData& getAllRecordsData)
+{
+ const IDBRequestData requestData(operation);
+ saveOperation(operation);
+
+ callConnectionOnMainThread(&IDBConnectionToServer::getAllRecords, requestData, getAllRecordsData);
+}
+
</ins><span class="cx"> void IDBConnectionProxy::getCount(TransactionOperation& operation, const IDBKeyRangeData& 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&, uint64_t objectStoreIdentifier, const String& indexName);
</span><span class="cx"> void putOrAdd(TransactionOperation&, IDBKeyData&&, const IDBValue&, const IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx"> void getRecord(TransactionOperation&, const IDBGetRecordData&);
</span><ins>+ void getAllRecords(TransactionOperation&, const IDBGetAllRecordsData&);
</ins><span class="cx"> void getCount(TransactionOperation&, const IDBKeyRangeData&);
</span><span class="cx"> void deleteRecord(TransactionOperation&, const IDBKeyRangeData&);
</span><span class="cx"> void openCursor(TransactionOperation&, const IDBCursorInfo&);
</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->completeOperation(resultData);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBConnectionToServer::getAllRecords(const IDBRequestData& requestData, const IDBGetAllRecordsData& getAllRecordsData)
+{
+ LOG(IndexedDB, "IDBConnectionToServer::getAllRecords");
+ ASSERT(isMainThread());
+
+ m_delegate->getAllRecords(requestData, getAllRecordsData);
+}
+
+void IDBConnectionToServer::didGetAllRecords(const IDBResultData& resultData)
+{
+ LOG(IndexedDB, "IDBConnectionToServer::didGetAllRecords");
+ m_proxy->completeOperation(resultData);
+}
+
</ins><span class="cx"> void IDBConnectionToServer::getCount(const IDBRequestData& requestData, const IDBKeyRangeData& keyRangeData)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBConnectionToServer::getCount");
</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&, const IDBGetRecordData&);
</span><span class="cx"> WEBCORE_EXPORT void didGetRecord(const IDBResultData&);
</span><span class="cx">
</span><ins>+ void getAllRecords(const IDBRequestData&, const IDBGetAllRecordsData&);
+ WEBCORE_EXPORT void didGetAllRecords(const IDBResultData&);
+
</ins><span class="cx"> void getCount(const IDBRequestData&, const IDBKeyRangeData&);
</span><span class="cx"> WEBCORE_EXPORT void didGetCount(const IDBResultData&);
</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&, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String& newName) = 0;
</span><span class="cx"> virtual void putOrAdd(const IDBRequestData&, const IDBKeyData&, const IDBValue&, const IndexedDB::ObjectStoreOverwriteMode) = 0;
</span><span class="cx"> virtual void getRecord(const IDBRequestData&, const IDBGetRecordData&) = 0;
</span><ins>+ virtual void getAllRecords(const IDBRequestData&, const IDBGetAllRecordsData&) = 0;
</ins><span class="cx"> virtual void getCount(const IDBRequestData&, const IDBKeyRangeData&) = 0;
</span><span class="cx"> virtual void deleteRecord(const IDBRequestData&, const IDBKeyRangeData&) = 0;
</span><span class="cx"> virtual void openCursor(const IDBRequestData&, const IDBCursorInfo&) = 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& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&) = 0;
</span><span class="cx"> virtual IDBError addRecord(const IDBResourceIdentifier& transactionIdentifier, const IDBObjectStoreInfo&, const IDBKeyData&, const IDBValue&) = 0;
</span><span class="cx"> virtual IDBError getRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&, IDBGetResult& outValue) = 0;
</span><ins>+ virtual IDBError getAllRecords(const IDBResourceIdentifier& transactionIdentifier, const IDBGetAllRecordsData&, IDBGetAllResult& outValue) = 0;
</ins><span class="cx"> virtual IDBError getIndexRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&, IDBGetResult& outValue) = 0;
</span><span class="cx"> virtual IDBError getCount(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData&, uint64_t& outCount) = 0;
</span><span class="cx"> virtual IDBError generateKeyNumber(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t& keyNumber) = 0;
</span></span></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->didGetRecord(result);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBConnectionToClient::didGetAllRecords(const IDBResultData& result)
+{
+ m_delegate->didGetAllRecords(result);
+}
+
</ins><span class="cx"> void IDBConnectionToClient::didGetCount(const IDBResultData& result)
</span><span class="cx"> {
</span><span class="cx"> m_delegate->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&);
</span><span class="cx"> void didPutOrAdd(const IDBResultData&);
</span><span class="cx"> void didGetRecord(const IDBResultData&);
</span><ins>+ void didGetAllRecords(const IDBResultData&);
</ins><span class="cx"> void didGetCount(const IDBResultData&);
</span><span class="cx"> void didDeleteRecord(const IDBResultData&);
</span><span class="cx"> void didOpenCursor(const IDBResultData&);
</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&) = 0;
</span><span class="cx"> virtual void didPutOrAdd(const IDBResultData&) = 0;
</span><span class="cx"> virtual void didGetRecord(const IDBResultData&) = 0;
</span><ins>+ virtual void didGetAllRecords(const IDBResultData&) = 0;
</ins><span class="cx"> virtual void didGetCount(const IDBResultData&) = 0;
</span><span class="cx"> virtual void didDeleteRecord(const IDBResultData&) = 0;
</span><span class="cx"> virtual void didOpenCursor(const IDBResultData&) = 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->getRecord(requestData, getRecordData);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBServer::getAllRecords(const IDBRequestData& requestData, const IDBGetAllRecordsData& getAllRecordsData)
+{
+ LOG(IndexedDB, "IDBServer::getAllRecords");
+
+ auto transaction = m_transactions.get(requestData.transactionIdentifier());
+ if (!transaction)
+ return;
+
+ transaction->getAllRecords(requestData, getAllRecordsData);
+}
+
</ins><span class="cx"> void IDBServer::getCount(const IDBRequestData& requestData, const IDBKeyRangeData& keyRangeData)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBServer::getCount");
</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&, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String& newName);
</span><span class="cx"> WEBCORE_EXPORT void putOrAdd(const IDBRequestData&, const IDBKeyData&, const IDBValue&, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx"> WEBCORE_EXPORT void getRecord(const IDBRequestData&, const IDBGetRecordData&);
</span><ins>+ WEBCORE_EXPORT void getAllRecords(const IDBRequestData&, const IDBGetAllRecordsData&);
</ins><span class="cx"> WEBCORE_EXPORT void getCount(const IDBRequestData&, const IDBKeyRangeData&);
</span><span class="cx"> WEBCORE_EXPORT void deleteRecord(const IDBRequestData&, const IDBKeyRangeData&);
</span><span class="cx"> WEBCORE_EXPORT void openCursor(const IDBRequestData&, const IDBCursorInfo&);
</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 "IDBCursorInfo.h"
</span><ins>+#include "IDBGetAllRecordsData.h"
</ins><span class="cx"> #include "IDBGetResult.h"
</span><span class="cx"> #include "IDBIndexInfo.h"
</span><span class="cx"> #include "IDBKeyRangeData.h"
</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& transactionIdentifier, const IDBGetAllRecordsData& getAllRecordsData, IDBGetAllResult& result)
+{
+ LOG(IndexedDB, "MemoryIDBBackingStore::getAllRecords");
+
+ ASSERT(getAllRecordsData.objectStoreIdentifier);
+
+ if (!m_transactions.contains(transactionIdentifier))
+ return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store transaction found to get all records"));
+
+ MemoryObjectStore* objectStore = m_objectStoresByIdentifier.get(getAllRecordsData.objectStoreIdentifier);
+ if (!objectStore)
+ return IDBError(IDBDatabaseException::UnknownError, ASCIILiteral("No backing store object store found"));
+
+ objectStore->getAllRecords(getAllRecordsData.keyRangeData, getAllRecordsData.count, getAllRecordsData.getAllType, result);
+ return { };
+}
+
</ins><span class="cx"> IDBError MemoryIDBBackingStore::getIndexRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType recordType, const IDBKeyRangeData& range, IDBGetResult& outValue)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "MemoryIDBBackingStore::getIndexRecord");
</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& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&) final;
</span><span class="cx"> IDBError addRecord(const IDBResourceIdentifier& transactionIdentifier, const IDBObjectStoreInfo&, const IDBKeyData&, const IDBValue&) final;
</span><span class="cx"> IDBError getRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&, IDBGetResult& outValue) final;
</span><ins>+ IDBError getAllRecords(const IDBResourceIdentifier& transactionIdentifier, const IDBGetAllRecordsData&, IDBGetAllResult& outValue) final;
</ins><span class="cx"> IDBError getIndexRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&, IDBGetResult& outValue) final;
</span><span class="cx"> IDBError getCount(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData&, uint64_t& outCount) final;
</span><span class="cx"> IDBError generateKeyNumber(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t& 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 "IDBBindingUtilities.h"
</span><span class="cx"> #include "IDBDatabaseException.h"
</span><span class="cx"> #include "IDBError.h"
</span><ins>+#include "IDBGetAllResult.h"
</ins><span class="cx"> #include "IDBKeyRangeData.h"
</span><span class="cx"> #include "IDBValue.h"
</span><span class="cx"> #include "IndexKey.h"
</span><span class="lines">@@ -407,6 +408,35 @@
</span><span class="cx"> return m_keyValueStore->get(key);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void MemoryObjectStore::getAllRecords(const IDBKeyRangeData& keyRangeData, Optional<uint32_t> count, IndexedDB::GetAllType type, IDBGetAllResult& result) const
+{
+ result = { type };
+
+ uint32_t targetCount;
+ if (count && count.value())
+ targetCount = count.value();
+ else
+ targetCount = std::numeric_limits<uint32_t>::max();
+
+ IDBKeyRangeData range = keyRangeData;
+ uint32_t currentCount = 0;
+ while (currentCount < 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& range) const
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "MemoryObjectStore::indexValueForKeyRange");
</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&) const;
</span><span class="cx"> uint64_t countForKeyRange(uint64_t indexIdentifier, const IDBKeyRangeData&) const;
</span><span class="cx">
</span><ins>+ void getAllRecords(const IDBKeyRangeData&, Optional<uint32_t> count, IndexedDB::GetAllType, IDBGetAllResult&) const;
+
</ins><span class="cx"> const IDBObjectStoreInfo& info() const { return m_info; }
</span><span class="cx">
</span><span class="cx"> MemoryObjectStoreCursor* maybeOpenCursor(const IDBCursorInfo&);
</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 "FileSystem.h"
</span><span class="cx"> #include "IDBBindingUtilities.h"
</span><span class="cx"> #include "IDBDatabaseException.h"
</span><ins>+#include "IDBGetAllRecordsData.h"
+#include "IDBGetAllResult.h"
</ins><span class="cx"> #include "IDBGetResult.h"
</span><span class="cx"> #include "IDBKeyData.h"
</span><span class="cx"> #include "IDBObjectStoreInfo.h"
</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& queryForGetAllRecords(const IDBGetAllRecordsData& getAllRecordsData)
+{
+ static NeverDestroyed<const ASCIILiteral> lowerOpenUpperOpenKey("SELECT key FROM Records WHERE objectStoreID = ? AND key > CAST(? AS TEXT) AND key < CAST(? AS TEXT) ORDER BY key;");
+ static NeverDestroyed<const ASCIILiteral> lowerOpenUpperClosedKey("SELECT key FROM Records WHERE objectStoreID = ? AND key > CAST(? AS TEXT) AND key <= CAST(? AS TEXT) ORDER BY key;");
+ static NeverDestroyed<const ASCIILiteral> lowerClosedUpperOpenKey("SELECT key FROM Records WHERE objectStoreID = ? AND key >= CAST(? AS TEXT) AND key < CAST(? AS TEXT) ORDER BY key;");
+ static NeverDestroyed<const ASCIILiteral> lowerClosedUpperClosedKey("SELECT key FROM Records WHERE objectStoreID = ? AND key >= CAST(? AS TEXT) AND key <= CAST(? AS TEXT) ORDER BY key;");
+ static NeverDestroyed<const ASCIILiteral> lowerOpenUpperOpenValue("SELECT value, ROWID FROM Records WHERE objectStoreID = ? AND key > CAST(? AS TEXT) AND key < CAST(? AS TEXT) ORDER BY key;");
+ static NeverDestroyed<const ASCIILiteral> lowerOpenUpperClosedValue("SELECT value, ROWID FROM Records WHERE objectStoreID = ? AND key > CAST(? AS TEXT) AND key <= CAST(? AS TEXT) ORDER BY key;");
+ static NeverDestroyed<const ASCIILiteral> lowerClosedUpperOpenValue("SELECT value, ROWID FROM Records WHERE objectStoreID = ? AND key >= CAST(? AS TEXT) AND key < CAST(? AS TEXT) ORDER BY key;");
+ static NeverDestroyed<const ASCIILiteral> lowerClosedUpperClosedValue("SELECT value, ROWID FROM Records WHERE objectStoreID = ? AND key >= CAST(? AS TEXT) AND key <= CAST(? AS TEXT) ORDER BY key;");
+
+ 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& transactionIdentifier, const IDBGetAllRecordsData& getAllRecordsData, IDBGetAllResult& result)
+{
+ LOG(IndexedDB, "SQLiteIDBBackingStore::getAllRecords");
+
+ ASSERT(m_sqliteDB);
+ ASSERT(m_sqliteDB->isOpen());
+
+ auto* transaction = m_transactions.get(transactionIdentifier);
+ if (!transaction || !transaction->inProgress()) {
+ LOG_ERROR("Attempt to get records from database without an in-progress transaction");
+ return { IDBDatabaseException::UnknownError, ASCIILiteral("Attempt to get records from database without an in-progress transaction") };
+ }
+
+ auto key = getAllRecordsData.keyRangeData.lowerKey;
+ if (key.isNull())
+ key = IDBKeyData::minimum();
+ auto lowerBuffer = serializeIDBKeyData(key);
+ if (!lowerBuffer) {
+ LOG_ERROR("Unable to serialize lower IDBKey in lookup range");
+ return { IDBDatabaseException::UnknownError, ASCIILiteral("Unable to serialize lower IDBKey in lookup range") };
+ }
+
+ key = getAllRecordsData.keyRangeData.upperKey;
+ if (key.isNull())
+ key = IDBKeyData::maximum();
+ auto upperBuffer = serializeIDBKeyData(key);
+ if (!upperBuffer) {
+ LOG_ERROR("Unable to serialize upper IDBKey in lookup range");
+ return { IDBDatabaseException::UnknownError, ASCIILiteral("Unable to serialize upper IDBKey in lookup range") };
+ }
+
+ SQLiteStatement sql(*m_sqliteDB, queryForGetAllRecords(getAllRecordsData));
+ if (sql.prepare() != SQLITE_OK
+ || sql.bindInt64(1, getAllRecordsData.objectStoreIdentifier) != SQLITE_OK
+ || sql.bindBlob(2, lowerBuffer->data(), lowerBuffer->size()) != SQLITE_OK
+ || sql.bindBlob(3, upperBuffer->data(), upperBuffer->size()) != SQLITE_OK) {
+ LOG_ERROR("Could not get key range record from object store %" PRIi64 " from Records table (%i) - %s", getAllRecordsData.objectStoreIdentifier, m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg());
+ return { IDBDatabaseException::UnknownError, ASCIILiteral("Failed to look up record in object store by key range") };
+ }
+
+ 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<uint32_t>::max();
+
+ while (sqlResult == SQLITE_ROW && returnedResults < targetResults) {
+ if (getAllRecordsData.getAllType == IndexedDB::GetAllType::Values) {
+ Vector<uint8_t> buffer;
+ sql.getColumnBlobAsVector(0, buffer);
+ ThreadSafeDataBuffer resultBuffer = ThreadSafeDataBuffer::adoptVector(buffer);
+
+ auto recordID = sql.getColumnInt64(1);
+
+ ASSERT(recordID);
+ Vector<String> 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<uint8_t> keyData;
+ IDBKeyData key;
+ sql.getColumnBlobAsVector(0, keyData);
+
+ if (!deserializeIDBKeyData(keyData.data(), keyData.size(), key)) {
+ LOG_ERROR("Unable to deserialize key data from database while getting all key records");
+ return { IDBDatabaseException::UnknownError, ASCIILiteral("Unable to deserialize key data while getting all key records") };
+ }
+
+ 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("Could not get record from object store %" PRIi64 " from Records table (%i) - %s", getAllRecordsData.objectStoreIdentifier, m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg());
+ return { IDBDatabaseException::UnknownError, ASCIILiteral("Error looking up record in object store by key range") };
+}
+
</ins><span class="cx"> IDBError SQLiteIDBBackingStore::getIndexRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreID, uint64_t indexID, IndexedDB::IndexRecordType type, const IDBKeyRangeData& range, IDBGetResult& getResult)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "SQLiteIDBBackingStore::getIndexRecord - %s", 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& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&) final;
</span><span class="cx"> IDBError addRecord(const IDBResourceIdentifier& transactionIdentifier, const IDBObjectStoreInfo&, const IDBKeyData&, const IDBValue&) final;
</span><span class="cx"> IDBError getRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&, IDBGetResult& outValue) final;
</span><ins>+ IDBError getAllRecords(const IDBResourceIdentifier& transactionIdentifier, const IDBGetAllRecordsData&, IDBGetAllResult& outValue) final;
</ins><span class="cx"> IDBError getIndexRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&, IDBGetResult& outValue) final;
</span><span class="cx"> IDBError getCount(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData&, uint64_t& outCount) final;
</span><span class="cx"> IDBError generateKeyNumber(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t& 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 "IDBCursorInfo.h"
</span><ins>+#include "IDBGetAllRecordsData.h"
+#include "IDBGetAllResult.h"
</ins><span class="cx"> #include "IDBGetRecordData.h"
</span><span class="cx"> #include "IDBKeyRangeData.h"
</span><span class="cx"> #include "IDBResultData.h"
</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, &UniqueIDBDatabase::performGetRecord, callbackID, requestData.transactionIdentifier(), requestData.objectStoreIdentifier(), getRecordData.keyRangeData));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void UniqueIDBDatabase::getAllRecords(const IDBRequestData& requestData, const IDBGetAllRecordsData& getAllRecordsData, GetAllResultsCallback callback)
+{
+ ASSERT(isMainThread());
+ LOG(IndexedDB, "(main) UniqueIDBDatabase::getAllRecords");
+
+ uint64_t callbackID = storeCallbackOrFireError(callback);
+ if (!callbackID)
+ return;
+
+ postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::performGetAllRecords, callbackID, requestData.transactionIdentifier(), getAllRecordsData));
+}
+
</ins><span class="cx"> void UniqueIDBDatabase::performGetRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData& 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& transactionIdentifier, const IDBGetAllRecordsData& getAllRecordsData)
+{
+ ASSERT(!isMainThread());
+ LOG(IndexedDB, "(db) UniqueIDBDatabase::performGetAllRecords");
+
+ ASSERT(m_backingStore);
+
+ IDBGetAllResult result;
+ IDBError error = m_backingStore->getAllRecords(transactionIdentifier, getAllRecordsData, result);
+
+ postDatabaseTaskReply(createCrossThreadTask(*this, &UniqueIDBDatabase::didPerformGetAllRecords, callbackIdentifier, error, WTFMove(result)));
+}
+
+void UniqueIDBDatabase::didPerformGetAllRecords(uint64_t callbackIdentifier, const IDBError& error, const IDBGetAllResult& result)
+{
+ ASSERT(isMainThread());
+ LOG(IndexedDB, "(main) UniqueIDBDatabase::didPerformGetAllRecords");
+
+ performGetAllResultsCallback(callbackIdentifier, error, result);
+}
+
</ins><span class="cx"> void UniqueIDBDatabase::getCount(const IDBRequestData& requestData, const IDBKeyRangeData& 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& error, const IDBGetAllResult& 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& 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<void(const IDBError&)> ErrorCallback;
</span><span class="cx"> typedef std::function<void(const IDBError&, const IDBKeyData&)> KeyDataCallback;
</span><span class="cx"> typedef std::function<void(const IDBError&, const IDBGetResult&)> GetResultCallback;
</span><ins>+typedef std::function<void(const IDBError&, const IDBGetAllResult&)> GetAllResultsCallback;
</ins><span class="cx"> typedef std::function<void(const IDBError&, uint64_t)> CountCallback;
</span><span class="cx">
</span><span class="cx"> class UniqueIDBDatabase : public ThreadSafeRefCounted<UniqueIDBDatabase> {
</span><span class="lines">@@ -94,6 +96,7 @@
</span><span class="cx"> void renameIndex(UniqueIDBDatabaseTransaction&, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String& newName, ErrorCallback);
</span><span class="cx"> void putOrAdd(const IDBRequestData&, const IDBKeyData&, const IDBValue&, IndexedDB::ObjectStoreOverwriteMode, KeyDataCallback);
</span><span class="cx"> void getRecord(const IDBRequestData&, const IDBGetRecordData&, GetResultCallback);
</span><ins>+ void getAllRecords(const IDBRequestData&, const IDBGetAllRecordsData&, GetAllResultsCallback);
</ins><span class="cx"> void getCount(const IDBRequestData&, const IDBKeyRangeData&, CountCallback);
</span><span class="cx"> void deleteRecord(const IDBRequestData&, const IDBKeyRangeData&, ErrorCallback);
</span><span class="cx"> void openCursor(const IDBRequestData&, const IDBCursorInfo&, GetResultCallback);
</span><span class="lines">@@ -153,6 +156,7 @@
</span><span class="cx"> void performRenameIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String& newName);
</span><span class="cx"> void performPutOrAdd(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, const IDBValue&, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx"> void performGetRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&);
</span><ins>+ void performGetAllRecords(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, const IDBGetAllRecordsData&);
</ins><span class="cx"> void performGetIndexRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&);
</span><span class="cx"> void performGetCount(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData&);
</span><span class="cx"> void performDeleteRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&);
</span><span class="lines">@@ -173,6 +177,7 @@
</span><span class="cx"> void didPerformRenameIndex(uint64_t callbackIdentifier, const IDBError&, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String& newName);
</span><span class="cx"> void didPerformPutOrAdd(uint64_t callbackIdentifier, const IDBError&, const IDBKeyData&);
</span><span class="cx"> void didPerformGetRecord(uint64_t callbackIdentifier, const IDBError&, const IDBGetResult&);
</span><ins>+ void didPerformGetAllRecords(uint64_t callbackIdentifier, const IDBError&, const IDBGetAllResult&);
</ins><span class="cx"> void didPerformGetCount(uint64_t callbackIdentifier, const IDBError&, uint64_t);
</span><span class="cx"> void didPerformDeleteRecord(uint64_t callbackIdentifier, const IDBError&);
</span><span class="cx"> void didPerformOpenCursor(uint64_t callbackIdentifier, const IDBError&, const IDBGetResult&);
</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&);
</span><span class="cx"> void performKeyDataCallback(uint64_t callbackIdentifier, const IDBError&, const IDBKeyData&);
</span><span class="cx"> void performGetResultCallback(uint64_t callbackIdentifier, const IDBError&, const IDBGetResult&);
</span><ins>+ void performGetAllResultsCallback(uint64_t callbackIdentifier, const IDBError&, const IDBGetAllResult&);
</ins><span class="cx"> void performCountCallback(uint64_t callbackIdentifier, const IDBError&, 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<uint64_t, ErrorCallback> m_errorCallbacks;
</span><span class="cx"> HashMap<uint64_t, KeyDataCallback> m_keyDataCallbacks;
</span><span class="cx"> HashMap<uint64_t, GetResultCallback> m_getResultCallbacks;
</span><ins>+ HashMap<uint64_t, GetAllResultsCallback> m_getAllResultsCallbacks;
</ins><span class="cx"> HashMap<uint64_t, CountCallback> 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& requestData, const IDBGetAllRecordsData& getAllRecordsData)
+{
+ LOG(IndexedDB, "UniqueIDBDatabaseTransaction::getAllRecords");
+
+ ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
+
+ RefPtr<UniqueIDBDatabaseTransaction> protectedThis(this);
+ m_databaseConnection->database().getAllRecords(requestData, getAllRecordsData, [this, protectedThis, requestData](const IDBError& error, const IDBGetAllResult& result) {
+ LOG(IndexedDB, "UniqueIDBDatabaseTransaction::getAllRecords (callback)");
+
+ if (error.isNull())
+ m_databaseConnection->connectionToClient().didGetAllRecords(IDBResultData::getAllRecordsSuccess(requestData.requestIdentifier(), result));
+ else
+ m_databaseConnection->connectionToClient().didGetAllRecords(IDBResultData::error(requestData.requestIdentifier(), error));
+ });
+}
+
</ins><span class="cx"> void UniqueIDBDatabaseTransaction::getCount(const IDBRequestData& requestData, const IDBKeyRangeData& keyRangeData)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "UniqueIDBDatabaseTransaction::getCount");
</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&, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String& newName);
</span><span class="cx"> void putOrAdd(const IDBRequestData&, const IDBKeyData&, const IDBValue&, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx"> void getRecord(const IDBRequestData&, const IDBGetRecordData&);
</span><ins>+ void getAllRecords(const IDBRequestData&, const IDBGetAllRecordsData&);
</ins><span class="cx"> void getCount(const IDBRequestData&, const IDBKeyRangeData&);
</span><span class="cx"> void deleteRecord(const IDBRequestData&, const IDBKeyRangeData&);
</span><span class="cx"> void openCursor(const IDBRequestData&, const IDBCursorInfo&);
</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 "config.h"
+#include "IDBGetAllRecordsData.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBKeyRangeData.h"
+
+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 "IDBKeyRangeData.h"
+#include <wtf/Optional.h>
+
+namespace WebCore {
+
+namespace IndexedDB {
+enum class DataSource;
+enum class GetAllType;
+}
+
+struct IDBGetAllRecordsData {
+ IDBKeyRangeData keyRangeData;
+ IndexedDB::GetAllType getAllType;
+ Optional<uint32_t> count;
+ uint64_t objectStoreIdentifier;
+ uint64_t indexIdentifier;
+
+ IDBGetAllRecordsData isolatedCopy() const;
+
+ template<class Encoder> void encode(Encoder&) const;
+ template<class Decoder> static bool decode(Decoder&, IDBGetAllRecordsData&);
+};
+
+template<class Encoder>
+void IDBGetAllRecordsData::encode(Encoder& encoder) const
+{
+ encoder << keyRangeData;
+ encoder.encodeEnum(getAllType);
+ encoder << count << objectStoreIdentifier << indexIdentifier;
+}
+
+template<class Decoder>
+bool IDBGetAllRecordsData::decode(Decoder& decoder, IDBGetAllRecordsData& 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<IDBKeyData>(*other.m_resultKey);
</span><span class="cx"> if (other.m_getResult)
</span><span class="cx"> m_getResult = std::make_unique<IDBGetResult>(*other.m_getResult);
</span><ins>+ if (other.m_getAllResult)
+ m_getAllResult = std::make_unique<IDBGetAllResult>(*other.m_getAllResult);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> IDBResultData::IDBResultData(const IDBResultData& 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& requestIdentifier, const IDBGetAllResult& getAllResult)
+{
+ IDBResultData result(IDBResultType::GetAllRecordsSuccess, requestIdentifier);
+ result.m_getAllResult = std::make_unique<IDBGetAllResult>(getAllResult);
+ return result;
+}
+
</ins><span class="cx"> IDBResultData IDBResultData::getCountSuccess(const IDBResourceIdentifier& 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& 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 "IDBDatabaseInfo.h"
</span><span class="cx"> #include "IDBError.h"
</span><ins>+#include "IDBGetAllResult.h"
</ins><span class="cx"> #include "IDBGetResult.h"
</span><span class="cx"> #include "IDBKeyData.h"
</span><span class="cx"> #include "IDBResourceIdentifier.h"
</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&);
</span><span class="cx"> static IDBResultData putOrAddSuccess(const IDBResourceIdentifier&, const IDBKeyData&);
</span><span class="cx"> static IDBResultData getRecordSuccess(const IDBResourceIdentifier&, const IDBGetResult&);
</span><ins>+ static IDBResultData getAllRecordsSuccess(const IDBResourceIdentifier&, const IDBGetAllResult&);
</ins><span class="cx"> static IDBResultData getCountSuccess(const IDBResourceIdentifier&, uint64_t count);
</span><span class="cx"> static IDBResultData deleteRecordSuccess(const IDBResourceIdentifier&);
</span><span class="cx"> static IDBResultData openCursorSuccess(const IDBResourceIdentifier&, const IDBGetResult&);
</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& getResult() const;
</span><ins>+ WEBCORE_EXPORT const IDBGetAllResult& getAllResult() const;
</ins><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT IDBResultData();
</span><span class="cx"> template<class Encoder> void encode(Encoder&) const;
</span><span class="lines">@@ -125,6 +129,7 @@
</span><span class="cx"> std::unique_ptr<IDBTransactionInfo> m_transactionInfo;
</span><span class="cx"> std::unique_ptr<IDBKeyData> m_resultKey;
</span><span class="cx"> std::unique_ptr<IDBGetResult> m_getResult;
</span><ins>+ std::unique_ptr<IDBGetAllResult> 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 << !!m_getResult;
</span><span class="cx"> if (m_getResult)
</span><span class="cx"> encoder << *m_getResult;
</span><ins>+
+ encoder << !!m_getAllResult;
+ if (m_getAllResult)
+ encoder << *m_getAllResult;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template<class Decoder> bool IDBResultData::decode(Decoder& decoder, IDBResultData& 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<IDBDatabaseInfo> object = std::make_unique<IDBDatabaseInfo>();
</del><ins>+ auto object = std::make_unique<IDBDatabaseInfo>();
</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<IDBTransactionInfo> object = std::make_unique<IDBTransactionInfo>();
</del><ins>+ auto object = std::make_unique<IDBTransactionInfo>();
</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<IDBKeyData> object = std::make_unique<IDBKeyData>();
</del><ins>+ auto object = std::make_unique<IDBKeyData>();
</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<IDBGetResult> object = std::make_unique<IDBGetResult>();
</del><ins>+ auto object = std::make_unique<IDBGetResult>();
</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<IDBGetAllResult>();
+ 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& resultData)
+{
+ RunLoop::current().dispatch([this, protectedThis = makeRef(*this), resultData] {
+ m_connectionToServer->didGetAllRecords(resultData);
+ });
+}
+
</ins><span class="cx"> void InProcessIDBServer::didGetCount(const IDBResultData& 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& requestData, const IDBGetAllRecordsData& getAllRecordsData)
+{
+ RunLoop::current().dispatch([this, protectedThis = makeRef(*this), requestData, getAllRecordsData] {
+ m_server->getAllRecords(requestData, getAllRecordsData);
+ });
+}
+
</ins><span class="cx"> void InProcessIDBServer::getCount(const IDBRequestData& requestData, const IDBKeyRangeData& 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&, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String& newName) final;
</span><span class="cx"> void putOrAdd(const IDBRequestData&, const IDBKeyData&, const IDBValue&, const IndexedDB::ObjectStoreOverwriteMode) final;
</span><span class="cx"> void getRecord(const IDBRequestData&, const IDBGetRecordData&) final;
</span><ins>+ void getAllRecords(const IDBRequestData&, const IDBGetAllRecordsData&) final;
</ins><span class="cx"> void getCount(const IDBRequestData&, const IDBKeyRangeData&) final;
</span><span class="cx"> void deleteRecord(const IDBRequestData&, const IDBKeyRangeData&) final;
</span><span class="cx"> void openCursor(const IDBRequestData&, const IDBCursorInfo&) final;
</span><span class="lines">@@ -98,6 +99,7 @@
</span><span class="cx"> void didRenameIndex(const IDBResultData&) final;
</span><span class="cx"> void didPutOrAdd(const IDBResultData&) final;
</span><span class="cx"> void didGetRecord(const IDBResultData&) final;
</span><ins>+ void didGetAllRecords(const IDBResultData&) final;
</ins><span class="cx"> void didGetCount(const IDBResultData&) final;
</span><span class="cx"> void didDeleteRecord(const IDBResultData&) final;
</span><span class="cx"> void didOpenCursor(const IDBResultData&) 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 = "<group>"; };
</span><span class="cx">                 5198F7AA1BBDD3E300E2CC5F /* IDBTransactionInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBTransactionInfo.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 5198F7AB1BBDD3E300E2CC5F /* IDBTransactionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBTransactionInfo.h; sourceTree = "<group>"; };
</span><ins>+                519DBC6C1DC00FA000329BF5 /* IDBGetAllRecordsData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBGetAllRecordsData.h; sourceTree = "<group>"; };
+                519DBC6D1DC00FB900329BF5 /* IDBGetAllRecordsData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBGetAllRecordsData.cpp; sourceTree = "<group>"; };
+                519DBC701DC10D3300329BF5 /* IDBGetAllResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBGetAllResult.cpp; sourceTree = "<group>"; };
+                519DBC711DC10D3300329BF5 /* IDBGetAllResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBGetAllResult.h; sourceTree = "<group>"; };
</ins><span class="cx">                 519FE0A10DAD446E00A08F21 /* HTMLAttributeNames.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLAttributeNames.in; sourceTree = "<group>"; };
</span><span class="cx">                 519FE0A20DAD446E00A08F21 /* HTMLTagNames.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLTagNames.in; sourceTree = "<group>"; };
</span><span class="cx">                 51A052311058774F00CC9E95 /* CredentialStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CredentialStorage.h; sourceTree = "<group>"; };
</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& exec, const IDBValue& value)
</del><ins>+static JSValue deserializeIDBValueToJSValue(ExecState& state, JSC::JSGlobalObject& globalObject, const IDBValue& value)
</ins><span class="cx"> {
</span><span class="cx"> // FIXME: I think it's peculiar to use undefined to mean "null data" and null to mean "empty data".
</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<uint8_t>(data));
</span><span class="cx">
</span><del>- exec.vm().apiLock().lock();
</del><ins>+ state.vm().apiLock().lock();
</ins><span class="cx"> Vector<RefPtr<MessagePort>> messagePorts;
</span><del>- JSValue result = serializedValue->deserialize(exec, exec.lexicalGlobalObject(), messagePorts, value.blobURLs(), value.blobFilePaths(), NonThrowing);
- exec.vm().apiLock().unlock();
</del><ins>+ JSValue result = serializedValue->deserialize(state, &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& state, const IDBValue& value)
+{
+ return deserializeIDBValueToJSValue(state, *state.lexicalGlobalObject(), value);
+}
+
+JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, const IDBValue& value)
+{
+ ASSERT(state);
+ return deserializeIDBValueToJSValue(*state, *globalObject, value);
+}
+
</ins><span class="cx"> Ref<IDBKey> scriptValueToIDBKey(ExecState& exec, const JSValue& 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& keyData)
+{
+ ASSERT(state);
+ ASSERT(globalObject);
+
+ return toJS(*state, *globalObject, keyData.maybeCreateIDBKey().get());
+}
+
</ins><span class="cx"> static Vector<IDBKeyData> createKeyPathArray(ExecState& exec, JSValue value, const IDBIndexInfo& info)
</span><span class="cx"> {
</span><span class="cx"> auto visitor = WTF::makeVisitor([&](const String& string) -> Vector<IDBKeyData> {
</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<IDBKey> scriptValueToIDBKey(JSC::ExecState&, const JSC::JSValue&);
</span><span class="cx">
</span><ins>+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, const IDBKeyData&);
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, const IDBValue&);
+
</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 <beidson@apple.com>
+
+ IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
+ <rdar://problem/28806934> and https://bugs.webkit.org/show_bug.cgi?id=164097
+
+ Reviewed by Darin Adler.
+
+ - Handle moving "Get All" 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 <wenson_hsieh@apple.com>
</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& blobFilePaths = resultData.getResult().value().blobFilePaths();
</del><ins>+ if (resultData.type() == IDBResultType::GetAllRecordsSuccess && 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<Messages::WebIDBConnectionToServer::DidGetRecord>(resultData);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebIDBConnectionToClient::didGetAllRecords(const WebCore::IDBResultData& resultData)
+{
+ handleGetResult<Messages::WebIDBConnectionToServer::DidGetAllRecords>(resultData);
+}
+
</ins><span class="cx"> void WebIDBConnectionToClient::didGetCount(const WebCore::IDBResultData& 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& request, const IDBGetAllRecordsData& getAllRecordsData)
+{
+ DatabaseProcess::singleton().idbServer().getAllRecords(request, getAllRecordsData);
+}
+
</ins><span class="cx"> void WebIDBConnectionToClient::getCount(const IDBRequestData& request, const IDBKeyRangeData& 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&) final;
</span><span class="cx"> void didPutOrAdd(const WebCore::IDBResultData&) final;
</span><span class="cx"> void didGetRecord(const WebCore::IDBResultData&) final;
</span><ins>+ void didGetAllRecords(const WebCore::IDBResultData&) final;
</ins><span class="cx"> void didGetCount(const WebCore::IDBResultData&) final;
</span><span class="cx"> void didDeleteRecord(const WebCore::IDBResultData&) final;
</span><span class="cx"> void didOpenCursor(const WebCore::IDBResultData&) final;
</span><span class="lines">@@ -101,6 +103,7 @@
</span><span class="cx"> void renameIndex(const WebCore::IDBRequestData&, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String& newName);
</span><span class="cx"> void putOrAdd(const WebCore::IDBRequestData&, const WebCore::IDBKeyData&, const WebCore::IDBValue&, unsigned overwriteMode);
</span><span class="cx"> void getRecord(const WebCore::IDBRequestData&, const WebCore::IDBGetRecordData&);
</span><ins>+ void getAllRecords(const WebCore::IDBRequestData&, const WebCore::IDBGetAllRecordsData&);
</ins><span class="cx"> void getCount(const WebCore::IDBRequestData&, const WebCore::IDBKeyRangeData&);
</span><span class="cx"> void deleteRecord(const WebCore::IDBRequestData&, const WebCore::IDBKeyRangeData&);
</span><span class="cx"> void openCursor(const WebCore::IDBRequestData&, const WebCore::IDBCursorInfo&);
</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 <wtf/HashSet.h>
</span><span class="cx"> #include <wtf/OptionSet.h>
</span><span class="cx"> #include <wtf/Optional.h>
</span><ins>+#include <wtf/Variant.h>
</ins><span class="cx"> #include <wtf/Vector.h>
</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 "ArgumentCoders.h"
</span><span class="cx"> #include <WebCore/FrameLoaderTypes.h>
</span><ins>+#include <WebCore/IndexedDB.h>
</ins><span class="cx"> #include <WebCore/PaymentHeaders.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -574,4 +575,14 @@
</span><span class="cx"> >;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+template<> struct EnumTraits<WebCore::IndexedDB::GetAllType> {
+ using values = EnumValues<
+ WebCore::IndexedDB::GetAllType,
+ WebCore::IndexedDB::GetAllType::Keys,
+ WebCore::IndexedDB::GetAllType::Values
+ >;
+};
+#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& requestData, const IDBGetAllRecordsData& getAllRecordsData)
+{
+ send(Messages::WebIDBConnectionToClient::GetAllRecords(requestData, getAllRecordsData));
+}
+
</ins><span class="cx"> void WebIDBConnectionToServer::getCount(const IDBRequestData& requestData, const IDBKeyRangeData& 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& result)
</span><span class="cx"> {
</span><span class="cx"> auto resultType = result.resultData().type();
</span><del>- if (resultType != IDBResultType::GetRecordSuccess && resultType != IDBResultType::OpenCursorSuccess && resultType != IDBResultType::IterateCursorSuccess) {
</del><ins>+ if (resultType != IDBResultType::GetRecordSuccess && resultType != IDBResultType::OpenCursorSuccess && resultType != IDBResultType::IterateCursorSuccess && 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& 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->didGetRecord(result.resultData());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebIDBConnectionToServer::didGetAllRecords(const WebIDBResult& result)
+{
+ if (result.resultData().getAllResult().type() == IndexedDB::GetAllType::Values)
+ preregisterSandboxExtensionsIfNecessary(result);
+ m_connectionToServer->didGetAllRecords(result.resultData());
+}
+
</ins><span class="cx"> void WebIDBConnectionToServer::didGetCount(const IDBResultData& result)
</span><span class="cx"> {
</span><span class="cx"> m_connectionToServer->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&, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String& newName) final;
</span><span class="cx"> void putOrAdd(const WebCore::IDBRequestData&, const WebCore::IDBKeyData&, const WebCore::IDBValue&, const WebCore::IndexedDB::ObjectStoreOverwriteMode) final;
</span><span class="cx"> void getRecord(const WebCore::IDBRequestData&, const WebCore::IDBGetRecordData&) final;
</span><ins>+ void getAllRecords(const WebCore::IDBRequestData&, const WebCore::IDBGetAllRecordsData&) final;
</ins><span class="cx"> void getCount(const WebCore::IDBRequestData&, const WebCore::IDBKeyRangeData&) final;
</span><span class="cx"> void deleteRecord(const WebCore::IDBRequestData&, const WebCore::IDBKeyRangeData&) final;
</span><span class="cx"> void openCursor(const WebCore::IDBRequestData&, const WebCore::IDBCursorInfo&) final;
</span><span class="lines">@@ -90,6 +91,7 @@
</span><span class="cx"> void didRenameIndex(const WebCore::IDBResultData&);
</span><span class="cx"> void didPutOrAdd(const WebCore::IDBResultData&);
</span><span class="cx"> void didGetRecord(const WebIDBResult&);
</span><ins>+ void didGetAllRecords(const WebIDBResult&);
</ins><span class="cx"> void didGetCount(const WebCore::IDBResultData&);
</span><span class="cx"> void didDeleteRecord(const WebCore::IDBResultData&);
</span><span class="cx"> void didOpenCursor(const WebIDBResult&);
</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>