<!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>[192014] 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/192014">192014</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2015-11-03 23:16:30 -0800 (Tue, 03 Nov 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Modern IDB: Fill out IDBIndex, create MemoryIndex in backing store.
https://bugs.webkit.org/show_bug.cgi?id=150868
Reviewed by Alex Christensen.
Source/WebCore:
Tests: storage/indexeddb/modern/create-index-failures.html
storage/indexeddb/modern/get-index-failures.html
storage/indexeddb/modern/idbindex-properties-basic.html
Note: The MemoryIndex in the backing store doesn't actually do anything yet.
That's coming next.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::createIndex):
(WebCore::IDBClient::IDBConnectionToServer::didCreateIndex):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
* Modules/indexeddb/client/IDBCursorWithValueImpl.h:
* Modules/indexeddb/client/IDBDatabaseImpl.cpp:
(WebCore::IDBClient::IDBDatabase::didCreateIndexInfo):
* Modules/indexeddb/client/IDBDatabaseImpl.h:
* Modules/indexeddb/client/IDBIndexImpl.cpp:
(WebCore::IDBClient::IDBIndex::create):
(WebCore::IDBClient::IDBIndex::IDBIndex):
(WebCore::IDBClient::IDBIndex::objectStore):
(WebCore::IDBClient::IDBIndex::keyPathAny):
(WebCore::IDBClient::IDBIndex::openCursor):
(WebCore::IDBClient::IDBIndex::count):
(WebCore::IDBClient::IDBIndex::openKeyCursor):
(WebCore::IDBClient::IDBIndex::get):
(WebCore::IDBClient::IDBIndex::getKey):
* Modules/indexeddb/client/IDBIndexImpl.h:
* Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
(WebCore::IDBClient::IDBObjectStore::createIndex):
(WebCore::IDBClient::IDBObjectStore::index):
* Modules/indexeddb/client/IDBObjectStoreImpl.h:
* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::createObjectStore):
(WebCore::IDBClient::IDBTransaction::createIndex):
(WebCore::IDBClient::IDBTransaction::createIndexOnServer):
(WebCore::IDBClient::IDBTransaction::didCreateIndexOnServer):
* Modules/indexeddb/client/IDBTransactionImpl.h:
* Modules/indexeddb/legacy/LegacyIndex.h:
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::didCreateIndex):
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::createIndex):
* Modules/indexeddb/server/IDBServer.h:
* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::addNewIndex):
(WebCore::IDBServer::MemoryBackingStoreTransaction::addExistingIndex):
* Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/MemoryIndex.cpp: Added.
(WebCore::IDBServer::MemoryIndex::create):
(WebCore::IDBServer::MemoryIndex::MemoryIndex):
(WebCore::IDBServer::MemoryIndex::~MemoryIndex):
* Modules/indexeddb/server/MemoryIndex.h: Added.
(WebCore::IDBServer::MemoryIndex::info):
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::createIndex):
(WebCore::IDBServer::MemoryObjectStore::registerIndex):
(WebCore::IDBServer::MemoryObjectStore::unregisterIndex):
* Modules/indexeddb/server/MemoryObjectStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::createIndex):
(WebCore::IDBServer::UniqueIDBDatabase::performCreateIndex):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformCreateIndex):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didCreateIndex):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::createIndex):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
* Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
(WebCore::IDBDatabaseInfo::getInfoForExistingObjectStore):
(WebCore::IDBDatabaseInfo::infoForExistingObjectStore):
* Modules/indexeddb/shared/IDBDatabaseInfo.h:
* Modules/indexeddb/shared/IDBIndexInfo.cpp:
(WebCore::IDBIndexInfo::IDBIndexInfo):
(WebCore::IDBIndexInfo::isolatedCopy):
* Modules/indexeddb/shared/IDBIndexInfo.h:
(WebCore::IDBIndexInfo::identifier):
(WebCore::IDBIndexInfo::objectStoreIdentifier):
* Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
(WebCore::IDBObjectStoreInfo::createNewIndex):
(WebCore::IDBObjectStoreInfo::addExistingIndex):
(WebCore::IDBObjectStoreInfo::hasIndex):
(WebCore::IDBObjectStoreInfo::infoForExistingIndex):
(WebCore::IDBObjectStoreInfo::isolatedCopy):
* Modules/indexeddb/shared/IDBObjectStoreInfo.h:
* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::createIndexSuccess):
* Modules/indexeddb/shared/IDBResultData.h:
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::didCreateIndex):
(WebCore::InProcessIDBServer::createIndex):
* Modules/indexeddb/shared/InProcessIDBServer.h:
* bindings/js/JSIDBObjectStoreCustom.cpp:
(WebCore::JSIDBObjectStore::createIndex):
* platform/CrossThreadCopier.cpp:
(WebCore::IDBIndexInfo>::copy):
* platform/CrossThreadCopier.h:
LayoutTests:
* platform/mac-wk2/TestExpectations:
* storage/indexeddb/modern/create-index-failures-expected.txt: Added.
* storage/indexeddb/modern/create-index-failures.html: Added.
* storage/indexeddb/modern/get-index-failures-expected.txt: Added.
* storage/indexeddb/modern/get-index-failures.html: Added.
* storage/indexeddb/modern/idbindex-properties-basic-expected.txt: Added.
* storage/indexeddb/modern/idbindex-properties-basic.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2TestExpectations">trunk/LayoutTests/platform/mac-wk2/TestExpectations</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="#trunkSourceWebCoreModulesindexeddbIDBIndexh">trunk/Source/WebCore/Modules/indexeddb/IDBIndex.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="#trunkSourceWebCoreModulesindexeddbclientIDBCursorWithValueImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorWithValueImpl.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBDatabaseImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBDatabaseImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBIndexImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBIndexImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBObjectStoreImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBObjectStoreImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddblegacyLegacyIndexh">trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyIndex.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="#trunkSourceWebCoreModulesindexeddbserverMemoryBackingStoreTransactioncpp">trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryBackingStoreTransactionh">trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.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="#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="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseConnectioncpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseConnectionh">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.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="#trunkSourceWebCoreModulesindexeddbsharedIDBDatabaseInfocpp">trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBDatabaseInfoh">trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBIndexInfocpp">trunk/Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBIndexInfoh">trunk/Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBObjectStoreInfocpp">trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBObjectStoreInfoh">trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.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="#trunkSourceWebCorebindingsjsJSIDBObjectStoreCustomcpp">trunk/Source/WebCore/bindings/js/JSIDBObjectStoreCustom.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformCrossThreadCopiercpp">trunk/Source/WebCore/platform/CrossThreadCopier.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformCrossThreadCopierh">trunk/Source/WebCore/platform/CrossThreadCopier.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsstorageindexeddbmoderncreateindexfailuresexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/create-index-failures-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmoderncreateindexfailureshtml">trunk/LayoutTests/storage/indexeddb/modern/create-index-failures.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmoderngetindexfailuresexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/get-index-failures-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmoderngetindexfailureshtml">trunk/LayoutTests/storage/indexeddb/modern/get-index-failures.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbindexpropertiesbasicexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/idbindex-properties-basic-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbindexpropertiesbasichtml">trunk/LayoutTests/storage/indexeddb/modern/idbindex-properties-basic.html</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryIndexcpp">trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryIndexh">trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/LayoutTests/ChangeLog        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-11-03 Brady Eidson <beidson@apple.com>
+
+ Modern IDB: Fill out IDBIndex, create MemoryIndex in backing store.
+ https://bugs.webkit.org/show_bug.cgi?id=150868
+
+ Reviewed by Alex Christensen.
+
+ * platform/mac-wk2/TestExpectations:
+ * storage/indexeddb/modern/create-index-failures-expected.txt: Added.
+ * storage/indexeddb/modern/create-index-failures.html: Added.
+ * storage/indexeddb/modern/get-index-failures-expected.txt: Added.
+ * storage/indexeddb/modern/get-index-failures.html: Added.
+ * storage/indexeddb/modern/idbindex-properties-basic-expected.txt: Added.
+ * storage/indexeddb/modern/idbindex-properties-basic.html: Added.
+
</ins><span class="cx"> 2015-11-03 Jiewen Tan <jiewen_tan@apple.com>
</span><span class="cx">
</span><span class="cx"> [WK1] Null dereference loading Blink layout test editing/input/text-input-controller-no-editable-no-crash.html
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/TestExpectations        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -486,6 +486,9 @@
</span><span class="cx"> http/tests/security/cross-origin-worker-indexeddb-allowed.html [ Skip ]
</span><span class="cx"> http/tests/security/cross-origin-worker-indexeddb.html [ Skip ]
</span><span class="cx">
</span><ins>+# Bindings changes in https://bugs.webkit.org/show_bug.cgi?id=150868 cause this to fail, but this test is probably wrong
+storage/indexeddb/keypath-basics.html [ Skip ]
+
</ins><span class="cx"> ### END OF (5) IndexedDB related failures
</span><span class="cx"> ########################################
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmoderncreateindexfailuresexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/create-index-failures-expected.txt (0 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/create-index-failures-expected.txt         (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/create-index-failures-expected.txt        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+This tests some obvious failures that can happen while calling IDBObjectStore.createIndex().
+Initial upgrade needed: Old version - 0 New version - 1
+Failed to create index with null name
+Failed to create index with invalid key path
+Failed to create index on a deleted object store
+Failed to create multi-entry index with an array key path
+Failed to create index that already exists
+Failed to create index while the transaction is inactive
+Initial upgrade versionchange transaction complete
+Failed to create index outside of a version change transaction
+readonly transaction complete
+Done
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmoderncreateindexfailureshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/create-index-failures.html (0 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/create-index-failures.html         (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/create-index-failures.html        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -0,0 +1,130 @@
</span><ins>+This tests some obvious failures that can happen while calling IDBObjectStore.createIndex().<br>
+<div id="logger"></div>
+<script>
+
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
+
+function done()
+{
+ log("Done");
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+function log(message)
+{
+ document.getElementById("logger").innerHTML += message + "<br>";
+}
+
+var createRequest = window.indexedDB.open("IDBObjectStoreCreateIndexFailuresDatabase", 1);
+var database;
+
+createRequest.onupgradeneeded = function(event) {
+ log("Initial upgrade needed: Old version - " + event.oldVersion + " New version - " + event.newVersion);
+
+ var versionTransaction = createRequest.transaction;
+ database = event.target.result;
+ var objectStore = database.createObjectStore("TestObjectStore");
+
+ try {
+ objectStore.createIndex(null, "foo");
+ } catch(e) {
+ log("Failed to create index with null name");
+ }
+
+ try {
+ objectStore.createIndex("TestIndex1", null);
+ } catch(e) {
+ log("Failed to create index with invalid key path");
+ }
+
+ database.deleteObjectStore("TestObjectStore");
+ try {
+ objectStore.createIndex("TestIndex2", "foo");
+ } catch(e) {
+ log("Failed to create index on a deleted object store");
+ }
+
+ objectStore = database.createObjectStore("TestObjectStore");
+
+ try {
+ objectStore.createIndex("TestIndex3", ["foo", "bar"], { multiEntry: true });
+ } catch(e) {
+ log("Failed to create multi-entry index with an array key path");
+ }
+
+ objectStore.createIndex("TestIndex4", "foo");
+ try {
+ objectStore.createIndex("TestIndex4", "foo");
+ } catch(e) {
+ log("Failed to create index that already exists");
+ }
+
+ // Spin the transaction with get requests to keep it alive long enough for the setTimeout to fire.
+ var canFinish = false;
+ var spinGet = function() {
+ objectStore.get("foo").onsuccess = function() {
+ if (!canFinish)
+ spinGet();
+ }
+ }
+ spinGet();
+
+ var createWhileInactive = function() {
+ try {
+ objectStore.createIndex("TestIndex5", "foo");
+ } catch(e) {
+ log("Failed to create index while the transaction is inactive");
+ }
+ canFinish = true;
+ }
+
+ setTimeout(createWhileInactive, 0);
+
+ versionTransaction.onabort = function(event) {
+ log("Initial upgrade versionchange transaction unexpected aborted");
+ done();
+ }
+
+ versionTransaction.oncomplete = function(event) {
+ log("Initial upgrade versionchange transaction complete");
+ continueTest1();
+ }
+
+ versionTransaction.onerror = function(event) {
+ log("Initial upgrade versionchange transaction unexpected error" + event);
+ done();
+ }
+}
+
+function continueTest1()
+{
+ var transaction = database.transaction("TestObjectStore", "readwrite");
+ var objectStore = transaction.objectStore("TestObjectStore");
+
+ try {
+ objectStore.createIndex("TestIndex6", "foo");
+ } catch(e) {
+ log("Failed to create index outside of a version change transaction");
+ }
+
+ transaction.onabort = function(event) {
+ log("readonly transaction unexpected abort" + event);
+ done();
+ }
+
+ transaction.oncomplete = function(event) {
+ log("readonly transaction complete");
+ done();
+ }
+
+ transaction.onerror = function(event) {
+ log("readonly transaction unexpected error" + event);
+ done();
+ }
+}
+
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmoderngetindexfailuresexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/get-index-failures-expected.txt (0 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/get-index-failures-expected.txt         (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/get-index-failures-expected.txt        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+This tests some obvious failures that can happen while calling IDBObjectStore.index().
+Initial upgrade needed: Old version - 0 New version - 1
+Initial upgrade versionchange transaction complete
+Got an index as expected: [object IDBIndex]
+Failed to get an index with a null name
+Failed to get an index that doesn't exist
+readonly transaction complete
+Second upgrade needed: Old version - 1 New version - 2
+Failed to get an index from a deleted object store
+Second versionchange transaction complete
+Done
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmoderngetindexfailureshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/get-index-failures.html (0 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/get-index-failures.html         (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/get-index-failures.html        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -0,0 +1,120 @@
</span><ins>+This tests some obvious failures that can happen while calling IDBObjectStore.index().<br>
+<div id="logger"></div>
+<script>
+
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
+
+function done()
+{
+ log("Done");
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+function log(message)
+{
+ document.getElementById("logger").innerHTML += message + "<br>";
+}
+
+var createRequest = window.indexedDB.open("IDBObjectStoreGetIndexFailuresDatabase", 1);
+var database;
+
+createRequest.onupgradeneeded = function(event) {
+ log("Initial upgrade needed: Old version - " + event.oldVersion + " New version - " + event.newVersion);
+
+ var versionTransaction = createRequest.transaction;
+ database = event.target.result;
+ var objectStore = database.createObjectStore("TestObjectStore");
+ objectStore.createIndex("TestIndex", "foo");
+
+ versionTransaction.onabort = function(event) {
+ log("Initial upgrade versionchange transaction unexpected aborted");
+ done();
+ }
+
+ versionTransaction.oncomplete = function(event) {
+ log("Initial upgrade versionchange transaction complete");
+ continueTest1();
+ }
+
+ versionTransaction.onerror = function(event) {
+ log("Initial upgrade versionchange transaction unexpected error" + event);
+ done();
+ }
+}
+
+function continueTest1()
+{
+ var transaction = database.transaction("TestObjectStore", "readonly");
+ var objectStore = transaction.objectStore("TestObjectStore");
+
+ var index = objectStore.index("TestIndex");
+ log("Got an index as expected: " + index);
+
+ try {
+ objectStore.index(null);
+ } catch(e) {
+ log("Failed to get an index with a null name");
+ }
+
+ try {
+ objectStore.index("DoesNotExistdex");
+ } catch(e) {
+ log("Failed to get an index that doesn't exist");
+ }
+
+ transaction.onabort = function(event) {
+ log("readonly transaction unexpected abort" + event);
+ done();
+ }
+
+ transaction.oncomplete = function(event) {
+ log("readonly transaction complete");
+ continueTest2();
+ database.close();
+ }
+
+ transaction.onerror = function(event) {
+ log("readonly transaction unexpected error" + event);
+ done();
+ }
+}
+
+function continueTest2()
+{
+ var createRequest = window.indexedDB.open("IDBObjectStoreGetIndexFailuresDatabase", 2);
+ createRequest.onupgradeneeded = function(event) {
+ log("Second upgrade needed: Old version - " + event.oldVersion + " New version - " + event.newVersion);
+
+ var versionTransaction = createRequest.transaction;
+ var database = event.target.result;
+ var objectStore = versionTransaction.objectStore("TestObjectStore");
+ database.deleteObjectStore("TestObjectStore");
+
+ try {
+ objectStore.index("TestIndex");
+ } catch(e) {
+ log("Failed to get an index from a deleted object store");
+ }
+
+ versionTransaction.onabort = function(event) {
+ log("Second versionchange transaction unexpected aborted");
+ done();
+ }
+
+ versionTransaction.oncomplete = function(event) {
+ log("Second versionchange transaction complete");
+ done();
+ }
+
+ versionTransaction.onerror = function(event) {
+ log("Second versionchange transaction unexpected error" + event);
+ done();
+ }
+ }
+}
+
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbindexpropertiesbasicexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbindex-properties-basic-expected.txt (0 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbindex-properties-basic-expected.txt         (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbindex-properties-basic-expected.txt        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -0,0 +1,90 @@
</span><ins>+ALERT: Initial upgrade needed: Old version - 0 New version - 1
+ALERT: TestIndex1
+ALERT: [object IDBObjectStore]
+ALERT: TestObjectStore
+ALERT: foo
+ALERT: false
+ALERT: false
+ALERT: TestIndex2
+ALERT: [object IDBObjectStore]
+ALERT: TestObjectStore
+ALERT: foo
+ALERT: false
+ALERT: false
+ALERT: TestIndex3
+ALERT: [object IDBObjectStore]
+ALERT: TestObjectStore
+ALERT: foo
+ALERT: false
+ALERT: true
+ALERT: TestIndex4
+ALERT: [object IDBObjectStore]
+ALERT: TestObjectStore
+ALERT: foo
+ALERT: true
+ALERT: false
+ALERT: TestIndex5
+ALERT: [object IDBObjectStore]
+ALERT: TestObjectStore
+ALERT: foo
+ALERT: true
+ALERT: true
+ALERT: TestIndex6
+ALERT: [object IDBObjectStore]
+ALERT: TestObjectStore
+ALERT: [object DOMStringList]
+ALERT: false
+ALERT: false
+ALERT: TestIndex7
+ALERT: [object IDBObjectStore]
+ALERT: TestObjectStore
+ALERT: [object DOMStringList]
+ALERT: false
+ALERT: false
+ALERT: Initial upgrade versionchange transaction complete
+ALERT: TestIndex1
+ALERT: [object IDBObjectStore]
+ALERT: TestObjectStore
+ALERT: foo
+ALERT: false
+ALERT: false
+ALERT: TestIndex2
+ALERT: [object IDBObjectStore]
+ALERT: TestObjectStore
+ALERT: foo
+ALERT: false
+ALERT: false
+ALERT: TestIndex3
+ALERT: [object IDBObjectStore]
+ALERT: TestObjectStore
+ALERT: foo
+ALERT: false
+ALERT: true
+ALERT: TestIndex4
+ALERT: [object IDBObjectStore]
+ALERT: TestObjectStore
+ALERT: foo
+ALERT: true
+ALERT: false
+ALERT: TestIndex5
+ALERT: [object IDBObjectStore]
+ALERT: TestObjectStore
+ALERT: foo
+ALERT: true
+ALERT: true
+ALERT: TestIndex6
+ALERT: [object IDBObjectStore]
+ALERT: TestObjectStore
+ALERT: [object DOMStringList]
+ALERT: false
+ALERT: false
+ALERT: TestIndex7
+ALERT: [object IDBObjectStore]
+ALERT: TestObjectStore
+ALERT: [object DOMStringList]
+ALERT: false
+ALERT: false
+ALERT: readonly transaction complete
+ALERT: Done
+This tests getting basic properties on an IDBIndex.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbindexpropertiesbasichtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbindex-properties-basic.html (0 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbindex-properties-basic.html         (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbindex-properties-basic.html        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -0,0 +1,100 @@
</span><ins>+This tests getting basic properties on an IDBIndex.<br>
+<div id="logger"></div>
+<script>
+
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
+
+function done()
+{
+ alert("Done");
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+function gol(message)
+{
+ document.getElementById("logger").innerHTML += message + "<br>";
+}
+
+function logIndex(index)
+{
+ alert(index.name);
+ alert(index.objectStore);
+ alert(index.objectStore.name);
+ alert(index.keyPath);
+ alert(index.multiEntry);
+ alert(index.unique);
+}
+
+var createRequest = window.indexedDB.open("IDBIndexPropertiesBasicDatabase", 1);
+var database;
+
+var indexes = new Array();
+
+createRequest.onupgradeneeded = function(event) {
+ alert("Initial upgrade needed: Old version - " + event.oldVersion + " New version - " + event.newVersion);
+
+ var versionTransaction = createRequest.transaction;
+ database = event.target.result;
+ var objectStore = database.createObjectStore("TestObjectStore");
+
+ indexes.push(objectStore.createIndex("TestIndex1", "foo"));
+ indexes.push(objectStore.createIndex("TestIndex2", "foo", { unique: false, multiEntry: false }));
+ indexes.push(objectStore.createIndex("TestIndex3", "foo", { unique: true, multiEntry: false }));
+ indexes.push(objectStore.createIndex("TestIndex4", "foo", { unique: false, multiEntry: true }));
+ indexes.push(objectStore.createIndex("TestIndex5", "foo", { unique: true, multiEntry: true }));
+ indexes.push(objectStore.createIndex("TestIndex6", [ "foo" ]));
+ indexes.push(objectStore.createIndex("TestIndex7", [ "foo", "bar" ]));
+
+ for (index in indexes)
+ logIndex(indexes[index]);
+
+ versionTransaction.onabort = function(event) {
+ alert("Initial upgrade versionchange transaction unexpected aborted");
+ done();
+ }
+
+ versionTransaction.oncomplete = function(event) {
+ alert("Initial upgrade versionchange transaction complete");
+ continueTest1();
+ }
+
+ versionTransaction.onerror = function(event) {
+ alert("Initial upgrade versionchange transaction unexpected error" + event);
+ done();
+ }
+}
+
+function continueTest1()
+{
+ var transaction = database.transaction("TestObjectStore", "readonly");
+ var objectStore = transaction.objectStore("TestObjectStore");
+
+ logIndex(objectStore.index("TestIndex1"));
+ logIndex(objectStore.index("TestIndex2"));
+ logIndex(objectStore.index("TestIndex3"));
+ logIndex(objectStore.index("TestIndex4"));
+ logIndex(objectStore.index("TestIndex5"));
+ logIndex(objectStore.index("TestIndex6"));
+ logIndex(objectStore.index("TestIndex7"));
+
+ transaction.onabort = function(event) {
+ alert("readonly transaction unexpected abort" + event);
+ done();
+ }
+
+ transaction.oncomplete = function(event) {
+ alert("readonly transaction complete");
+ done();
+ }
+
+ transaction.onerror = function(event) {
+ alert("readonly transaction unexpected error" + event);
+ done();
+ }
+}
+
+</script>
</ins></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -904,6 +904,7 @@
</span><span class="cx"> Modules/indexeddb/server/IDBServerOperation.cpp
</span><span class="cx"> Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp
</span><span class="cx"> Modules/indexeddb/server/MemoryIDBBackingStore.cpp
</span><ins>+ Modules/indexeddb/server/MemoryIndex.cpp
</ins><span class="cx"> Modules/indexeddb/server/MemoryObjectStore.cpp
</span><span class="cx"> Modules/indexeddb/server/UniqueIDBDatabase.cpp
</span><span class="cx"> Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/ChangeLog        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -1,3 +1,144 @@
</span><ins>+2015-11-03 Brady Eidson <beidson@apple.com>
+
+ Modern IDB: Fill out IDBIndex, create MemoryIndex in backing store.
+ https://bugs.webkit.org/show_bug.cgi?id=150868
+
+ Reviewed by Alex Christensen.
+
+ Tests: storage/indexeddb/modern/create-index-failures.html
+ storage/indexeddb/modern/get-index-failures.html
+ storage/indexeddb/modern/idbindex-properties-basic.html
+
+ Note: The MemoryIndex in the backing store doesn't actually do anything yet.
+
+ That's coming next.
+
+ * CMakeLists.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+
+ * Modules/indexeddb/IDBIndex.h:
+
+ * Modules/indexeddb/client/IDBConnectionToServer.cpp:
+ (WebCore::IDBClient::IDBConnectionToServer::createIndex):
+ (WebCore::IDBClient::IDBConnectionToServer::didCreateIndex):
+ * Modules/indexeddb/client/IDBConnectionToServer.h:
+ * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
+
+ * Modules/indexeddb/client/IDBCursorWithValueImpl.h:
+
+ * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
+ (WebCore::IDBClient::IDBDatabase::didCreateIndexInfo):
+ * Modules/indexeddb/client/IDBDatabaseImpl.h:
+
+ * Modules/indexeddb/client/IDBIndexImpl.cpp:
+ (WebCore::IDBClient::IDBIndex::create):
+ (WebCore::IDBClient::IDBIndex::IDBIndex):
+ (WebCore::IDBClient::IDBIndex::objectStore):
+ (WebCore::IDBClient::IDBIndex::keyPathAny):
+ (WebCore::IDBClient::IDBIndex::openCursor):
+ (WebCore::IDBClient::IDBIndex::count):
+ (WebCore::IDBClient::IDBIndex::openKeyCursor):
+ (WebCore::IDBClient::IDBIndex::get):
+ (WebCore::IDBClient::IDBIndex::getKey):
+ * Modules/indexeddb/client/IDBIndexImpl.h:
+
+ * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
+ (WebCore::IDBClient::IDBObjectStore::createIndex):
+ (WebCore::IDBClient::IDBObjectStore::index):
+ * Modules/indexeddb/client/IDBObjectStoreImpl.h:
+
+ * Modules/indexeddb/client/IDBTransactionImpl.cpp:
+ (WebCore::IDBClient::IDBTransaction::createObjectStore):
+ (WebCore::IDBClient::IDBTransaction::createIndex):
+ (WebCore::IDBClient::IDBTransaction::createIndexOnServer):
+ (WebCore::IDBClient::IDBTransaction::didCreateIndexOnServer):
+ * Modules/indexeddb/client/IDBTransactionImpl.h:
+
+ * Modules/indexeddb/legacy/LegacyIndex.h:
+
+ * Modules/indexeddb/server/IDBBackingStore.h:
+
+ * Modules/indexeddb/server/IDBConnectionToClient.cpp:
+ (WebCore::IDBServer::IDBConnectionToClient::didCreateIndex):
+ * Modules/indexeddb/server/IDBConnectionToClient.h:
+ * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
+
+ * Modules/indexeddb/server/IDBServer.cpp:
+ (WebCore::IDBServer::IDBServer::createIndex):
+ * Modules/indexeddb/server/IDBServer.h:
+
+ * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
+ (WebCore::IDBServer::MemoryBackingStoreTransaction::addNewIndex):
+ (WebCore::IDBServer::MemoryBackingStoreTransaction::addExistingIndex):
+ * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
+
+ * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
+ (WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
+ * Modules/indexeddb/server/MemoryIDBBackingStore.h:
+
+ * Modules/indexeddb/server/MemoryIndex.cpp: Added.
+ (WebCore::IDBServer::MemoryIndex::create):
+ (WebCore::IDBServer::MemoryIndex::MemoryIndex):
+ (WebCore::IDBServer::MemoryIndex::~MemoryIndex):
+ * Modules/indexeddb/server/MemoryIndex.h: Added.
+ (WebCore::IDBServer::MemoryIndex::info):
+
+ * Modules/indexeddb/server/MemoryObjectStore.cpp:
+ (WebCore::IDBServer::MemoryObjectStore::createIndex):
+ (WebCore::IDBServer::MemoryObjectStore::registerIndex):
+ (WebCore::IDBServer::MemoryObjectStore::unregisterIndex):
+ * Modules/indexeddb/server/MemoryObjectStore.h:
+
+ * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+ (WebCore::IDBServer::UniqueIDBDatabase::createIndex):
+ (WebCore::IDBServer::UniqueIDBDatabase::performCreateIndex):
+ (WebCore::IDBServer::UniqueIDBDatabase::didPerformCreateIndex):
+ * Modules/indexeddb/server/UniqueIDBDatabase.h:
+
+ * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
+ (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCreateIndex):
+ * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
+
+ * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
+ (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createIndex):
+ * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
+
+ * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
+ (WebCore::IDBDatabaseInfo::getInfoForExistingObjectStore):
+ (WebCore::IDBDatabaseInfo::infoForExistingObjectStore):
+ * Modules/indexeddb/shared/IDBDatabaseInfo.h:
+
+ * Modules/indexeddb/shared/IDBIndexInfo.cpp:
+ (WebCore::IDBIndexInfo::IDBIndexInfo):
+ (WebCore::IDBIndexInfo::isolatedCopy):
+ * Modules/indexeddb/shared/IDBIndexInfo.h:
+ (WebCore::IDBIndexInfo::identifier):
+ (WebCore::IDBIndexInfo::objectStoreIdentifier):
+
+ * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
+ (WebCore::IDBObjectStoreInfo::createNewIndex):
+ (WebCore::IDBObjectStoreInfo::addExistingIndex):
+ (WebCore::IDBObjectStoreInfo::hasIndex):
+ (WebCore::IDBObjectStoreInfo::infoForExistingIndex):
+ (WebCore::IDBObjectStoreInfo::isolatedCopy):
+ * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
+
+ * Modules/indexeddb/shared/IDBResultData.cpp:
+ (WebCore::IDBResultData::createIndexSuccess):
+ * Modules/indexeddb/shared/IDBResultData.h:
+
+ * Modules/indexeddb/shared/InProcessIDBServer.cpp:
+ (WebCore::InProcessIDBServer::didCreateIndex):
+ (WebCore::InProcessIDBServer::createIndex):
+ * Modules/indexeddb/shared/InProcessIDBServer.h:
+
+ * bindings/js/JSIDBObjectStoreCustom.cpp:
+ (WebCore::JSIDBObjectStore::createIndex):
+
+ * platform/CrossThreadCopier.cpp:
+ (WebCore::IDBIndexInfo>::copy):
+ * platform/CrossThreadCopier.h:
+
</ins><span class="cx"> 2015-11-03 Andy Estes <aestes@apple.com>
</span><span class="cx">
</span><span class="cx"> [Cocoa] Only query for kMGQDeviceName on iOS
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBIndexh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx">
</span><span class="cx"> // Implement the IDL
</span><span class="cx"> virtual const String& name() const = 0;
</span><del>- virtual RefPtr<IDBObjectStore> objectStore() const = 0;
</del><ins>+ virtual RefPtr<IDBObjectStore> objectStore() = 0;
</ins><span class="cx"> virtual RefPtr<IDBAny> keyPathAny() const = 0;
</span><span class="cx"> virtual const IDBKeyPath& keyPath() const = 0;
</span><span class="cx"> virtual bool unique() const = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -140,6 +140,21 @@
</span><span class="cx"> completeOperation(resultData);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBConnectionToServer::createIndex(TransactionOperation& operation, const IDBIndexInfo& info)
+{
+ LOG(IndexedDB, "IDBConnectionToServer::createIndex");
+
+ saveOperation(operation);
+
+ m_delegate->createIndex(IDBRequestData(operation), info);
+}
+
+void IDBConnectionToServer::didCreateIndex(const IDBResultData& resultData)
+{
+ LOG(IndexedDB, "IDBConnectionToServer::didCreateIndex");
+ completeOperation(resultData);
+}
+
</ins><span class="cx"> void IDBConnectionToServer::putOrAdd(TransactionOperation& operation, RefPtr<IDBKey>& key, RefPtr<SerializedScriptValue>& value, const IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBConnectionToServer::putOrAdd");
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -70,6 +70,9 @@
</span><span class="cx"> void clearObjectStore(TransactionOperation&, uint64_t objectStoreIdentifier);
</span><span class="cx"> void didClearObjectStore(const IDBResultData&);
</span><span class="cx">
</span><ins>+ void createIndex(TransactionOperation&, const IDBIndexInfo&);
+ void didCreateIndex(const IDBResultData&);
+
</ins><span class="cx"> void putOrAdd(TransactionOperation&, RefPtr<IDBKey>&, RefPtr<SerializedScriptValue>&, const IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx"> void didPutOrAdd(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 (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+class IDBIndexInfo;
</ins><span class="cx"> class IDBKey;
</span><span class="cx"> class IDBObjectStoreInfo;
</span><span class="cx"> class IDBRequestData;
</span><span class="lines">@@ -59,6 +60,7 @@
</span><span class="cx"> virtual void createObjectStore(const IDBRequestData&, const IDBObjectStoreInfo&) = 0;
</span><span class="cx"> virtual void deleteObjectStore(const IDBRequestData&, const String& objectStoreName) = 0;
</span><span class="cx"> virtual void clearObjectStore(const IDBRequestData&, uint64_t objectStoreIdentifier) = 0;
</span><ins>+ virtual void createIndex(const IDBRequestData&, const IDBIndexInfo&) = 0;
</ins><span class="cx"> virtual void putOrAdd(const IDBRequestData&, IDBKey*, SerializedScriptValue&, const IndexedDB::ObjectStoreOverwriteMode) = 0;
</span><span class="cx"> virtual void getRecord(const IDBRequestData&, const IDBKeyRangeData&) = 0;
</span><span class="cx"> virtual void getCount(const IDBRequestData&, const IDBKeyRangeData&) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBCursorWithValueImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorWithValueImpl.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorWithValueImpl.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorWithValueImpl.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx">
</span><del>-#include "IDBCursorWithValue.h"
</del><ins>+#include "IDBCursorImpl.h"
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> namespace IDBClient {
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBDatabaseImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -334,6 +334,13 @@
</span><span class="cx"> scriptExecutionContext()->eventQueue().enqueueEvent(adoptRef(&event.leakRef()));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBDatabase::didCreateIndexInfo(const IDBIndexInfo& info)
+{
+ auto* objectStore = m_info.infoForExistingObjectStore(info.objectStoreIdentifier());
+ ASSERT(objectStore);
+ objectStore->addExistingIndex(info);
+}
+
</ins><span class="cx"> } // namespace IDBClient
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBDatabaseImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -84,6 +84,8 @@
</span><span class="cx">
</span><span class="cx"> IDBConnectionToServer& serverConnection() { return m_serverConnection.get(); }
</span><span class="cx">
</span><ins>+ void didCreateIndexInfo(const IDBIndexInfo&);
+
</ins><span class="cx"> private:
</span><span class="cx"> IDBDatabase(ScriptExecutionContext&, IDBConnectionToServer&, const IDBResultData&);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBIndexImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.cpp (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.cpp        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -28,9 +28,23 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx">
</span><ins>+#include "IDBAnyImpl.h"
+#include "IDBObjectStoreImpl.h"
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> namespace IDBClient {
</span><span class="cx">
</span><ins>+Ref<IDBIndex> IDBIndex::create(const IDBIndexInfo& info, IDBObjectStore& objectStore)
+{
+ return adoptRef(*new IDBIndex(info, objectStore));
+}
+
+IDBIndex::IDBIndex(const IDBIndexInfo& info, IDBObjectStore& objectStore)
+ : m_info(info)
+ , m_objectStore(objectStore)
+{
+}
+
</ins><span class="cx"> IDBIndex::~IDBIndex()
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -40,14 +54,14 @@
</span><span class="cx"> return m_info.name();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<IDBObjectStore> IDBIndex::objectStore() const
</del><ins>+RefPtr<WebCore::IDBObjectStore> IDBIndex::objectStore()
</ins><span class="cx"> {
</span><del>- RELEASE_ASSERT_NOT_REACHED();
</del><ins>+ return &m_objectStore.get();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<IDBAny> IDBIndex::keyPathAny() const
</del><ins>+RefPtr<WebCore::IDBAny> IDBIndex::keyPathAny() const
</ins><span class="cx"> {
</span><del>- RELEASE_ASSERT_NOT_REACHED();
</del><ins>+ return IDBAny::create(m_info.keyPath());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const IDBKeyPath& IDBIndex::keyPath() const
</span><span class="lines">@@ -65,56 +79,61 @@
</span><span class="cx"> return m_info.multiEntry();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext*, IDBKeyRange*, const String&, ExceptionCode&)
</del><ins>+RefPtr<WebCore::IDBRequest> IDBIndex::openCursor(ScriptExecutionContext*, IDBKeyRange*, const String&, ExceptionCode&)
</ins><span class="cx"> {
</span><span class="cx"> RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue&, const String&, ExceptionCode&)
</del><ins>+RefPtr<WebCore::IDBRequest> IDBIndex::openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue&, const String&, ExceptionCode&)
</ins><span class="cx"> {
</span><span class="cx"> RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<IDBRequest> IDBIndex::count(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&)
</del><ins>+RefPtr<WebCore::IDBRequest> IDBIndex::count(ScriptExecutionContext*, ExceptionCode&)
</ins><span class="cx"> {
</span><span class="cx"> RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<IDBRequest> IDBIndex::count(ScriptExecutionContext*, const Deprecated::ScriptValue&, ExceptionCode&)
</del><ins>+RefPtr<WebCore::IDBRequest> IDBIndex::count(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&)
</ins><span class="cx"> {
</span><span class="cx"> RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext*, IDBKeyRange*, const String&, ExceptionCode&)
</del><ins>+RefPtr<WebCore::IDBRequest> IDBIndex::count(ScriptExecutionContext*, const Deprecated::ScriptValue&, ExceptionCode&)
</ins><span class="cx"> {
</span><span class="cx"> RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext*, const Deprecated::ScriptValue&, const String&, ExceptionCode&)
</del><ins>+RefPtr<WebCore::IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext*, IDBKeyRange*, const String&, ExceptionCode&)
</ins><span class="cx"> {
</span><span class="cx"> RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<IDBRequest> IDBIndex::get(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&)
</del><ins>+RefPtr<WebCore::IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext*, const Deprecated::ScriptValue&, const String&, ExceptionCode&)
</ins><span class="cx"> {
</span><span class="cx"> RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<IDBRequest> IDBIndex::get(ScriptExecutionContext*, const Deprecated::ScriptValue&, ExceptionCode&)
</del><ins>+RefPtr<WebCore::IDBRequest> IDBIndex::get(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&)
</ins><span class="cx"> {
</span><span class="cx"> RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<IDBRequest> IDBIndex::getKey(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&)
</del><ins>+RefPtr<WebCore::IDBRequest> IDBIndex::get(ScriptExecutionContext*, const Deprecated::ScriptValue&, ExceptionCode&)
</ins><span class="cx"> {
</span><span class="cx"> RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<IDBRequest> IDBIndex::getKey(ScriptExecutionContext*, const Deprecated::ScriptValue&, ExceptionCode&)
</del><ins>+RefPtr<WebCore::IDBRequest> IDBIndex::getKey(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&)
</ins><span class="cx"> {
</span><span class="cx"> RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+RefPtr<WebCore::IDBRequest> IDBIndex::getKey(ScriptExecutionContext*, const Deprecated::ScriptValue&, ExceptionCode&)
+{
+ RELEASE_ASSERT_NOT_REACHED();
+}
+
</ins><span class="cx"> } // namespace IDBClient
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBIndexImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -35,33 +35,48 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> namespace IDBClient {
</span><span class="cx">
</span><ins>+class IDBObjectStore;
+
</ins><span class="cx"> class IDBIndex : public WebCore::IDBIndex {
</span><span class="cx"> public:
</span><ins>+ static Ref<IDBIndex> create(const IDBIndexInfo&, IDBObjectStore&);
+
</ins><span class="cx"> virtual ~IDBIndex();
</span><span class="cx">
</span><span class="cx"> // Implement the IDL
</span><span class="cx"> virtual const String& name() const override final;
</span><del>- virtual RefPtr<IDBObjectStore> objectStore() const override final;
- virtual RefPtr<IDBAny> keyPathAny() const override final;
</del><ins>+ virtual RefPtr<WebCore::IDBObjectStore> objectStore() override final;
+ virtual RefPtr<WebCore::IDBAny> keyPathAny() const override final;
</ins><span class="cx"> virtual const IDBKeyPath& keyPath() const override final;
</span><span class="cx"> virtual bool unique() const override final;
</span><span class="cx"> virtual bool multiEntry() const override final;
</span><span class="cx">
</span><del>- virtual RefPtr<IDBRequest> openCursor(ScriptExecutionContext*, IDBKeyRange*, const String& direction, ExceptionCode&) override final;
- virtual RefPtr<IDBRequest> openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, const String& direction, ExceptionCode&) override final;
- virtual RefPtr<IDBRequest> count(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&) override final;
- virtual RefPtr<IDBRequest> count(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) override final;
</del><ins>+ virtual RefPtr<WebCore::IDBRequest> openCursor(ScriptExecutionContext* context, ExceptionCode& ec) override final { return openCursor(context, static_cast<IDBKeyRange*>(nullptr), ec); }
+ virtual RefPtr<WebCore::IDBRequest> openCursor(ScriptExecutionContext* context, IDBKeyRange* keyRange, ExceptionCode& ec) override final { return openCursor(context, keyRange, IDBCursor::directionNext(), ec); }
+ virtual RefPtr<WebCore::IDBRequest> openCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec) override final { return openCursor(context, key, IDBCursor::directionNext(), ec); }
+ virtual RefPtr<WebCore::IDBRequest> openCursor(ScriptExecutionContext*, IDBKeyRange*, const String& direction, ExceptionCode&) override final;
+ virtual RefPtr<WebCore::IDBRequest> openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, const String& direction, ExceptionCode&) override final;
</ins><span class="cx">
</span><del>- virtual RefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, IDBKeyRange*, const String& direction, ExceptionCode&) override final;
- virtual RefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, const String& direction, ExceptionCode&) override final;
</del><ins>+ virtual RefPtr<WebCore::IDBRequest> count(ScriptExecutionContext*, ExceptionCode&) override final;
+ virtual RefPtr<WebCore::IDBRequest> count(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&) override final;
+ virtual RefPtr<WebCore::IDBRequest> count(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) override final;
</ins><span class="cx">
</span><del>- virtual RefPtr<IDBRequest> get(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&) override final;
- virtual RefPtr<IDBRequest> get(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) override final;
- virtual RefPtr<IDBRequest> getKey(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&) override final;
- virtual RefPtr<IDBRequest> getKey(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) override final;
</del><ins>+ virtual RefPtr<WebCore::IDBRequest> openKeyCursor(ScriptExecutionContext* context, ExceptionCode& ec) override final { return openKeyCursor(context, static_cast<IDBKeyRange*>(nullptr), ec); }
+ virtual RefPtr<WebCore::IDBRequest> openKeyCursor(ScriptExecutionContext* context, IDBKeyRange* keyRange, ExceptionCode& ec) override final { return openKeyCursor(context, keyRange, IDBCursor::directionNext(), ec); }
+ virtual RefPtr<WebCore::IDBRequest> openKeyCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec) override final { return openKeyCursor(context, key, IDBCursor::directionNext(), ec); }
+ virtual RefPtr<WebCore::IDBRequest> openKeyCursor(ScriptExecutionContext*, IDBKeyRange*, const String& direction, ExceptionCode&) override final;
+ virtual RefPtr<WebCore::IDBRequest> openKeyCursor(ScriptExecutionContext*, const Deprecated::ScriptValue& key, const String& direction, ExceptionCode&) override final;
</ins><span class="cx">
</span><ins>+ virtual RefPtr<WebCore::IDBRequest> get(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&) override final;
+ virtual RefPtr<WebCore::IDBRequest> get(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) override final;
+ virtual RefPtr<WebCore::IDBRequest> getKey(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&) override final;
+ virtual RefPtr<WebCore::IDBRequest> getKey(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) override final;
+
</ins><span class="cx"> private:
</span><ins>+ IDBIndex(const IDBIndexInfo&, IDBObjectStore&);
+
</ins><span class="cx"> IDBIndexInfo m_info;
</span><ins>+ Ref<IDBObjectStore> m_objectStore;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace IDBClient
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBObjectStoreImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -30,7 +30,9 @@
</span><span class="cx">
</span><span class="cx"> #include "DOMRequestState.h"
</span><span class="cx"> #include "IDBBindingUtilities.h"
</span><ins>+#include "IDBDatabaseException.h"
</ins><span class="cx"> #include "IDBError.h"
</span><ins>+#include "IDBIndexImpl.h"
</ins><span class="cx"> #include "IDBKey.h"
</span><span class="cx"> #include "IDBKeyRangeData.h"
</span><span class="cx"> #include "IDBRequestImpl.h"
</span><span class="lines">@@ -339,14 +341,87 @@
</span><span class="cx"> return adoptRef(request.leakRef());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<WebCore::IDBIndex> IDBObjectStore::createIndex(ScriptExecutionContext*, const String&, const IDBKeyPath&, bool, bool, ExceptionCode&)
</del><ins>+RefPtr<WebCore::IDBIndex> IDBObjectStore::createIndex(ScriptExecutionContext* context, const String& name, const IDBKeyPath& keyPath, bool unique, bool multiEntry, ExceptionCode& ec)
</ins><span class="cx"> {
</span><del>- RELEASE_ASSERT_NOT_REACHED();
</del><ins>+ LOG(IndexedDB, "IDBObjectStore::createIndex %s", name.utf8().data());
+
+ if (!context) {
+ ec = INVALID_STATE_ERR;
+ return nullptr;
+ }
+
+ if (m_deleted) {
+ ec = static_cast<ExceptionCode>(IDBExceptionCode::InvalidStateError);
+ return nullptr;
+ }
+
+ if (!m_transaction->isVersionChange()) {
+ ec = static_cast<ExceptionCode>(IDBExceptionCode::InvalidStateError);
+ return nullptr;
+ }
+
+ if (!m_transaction->isActive()) {
+ ec = static_cast<ExceptionCode>(IDBExceptionCode::TransactionInactiveError);
+ return nullptr;
+ }
+
+ if (!keyPath.isValid()) {
+ ec = IDBDatabaseException::SyntaxError;
+ return nullptr;
+ }
+
+ if (name.isNull()) {
+ ec = TypeError;
+ return nullptr;
+ }
+
+ if (m_info.hasIndex(name)) {
+ ec = IDBDatabaseException::ConstraintError;
+ return nullptr;
+ }
+
+ if (keyPath.type() == IndexedDB::KeyPathType::Array && multiEntry) {
+ ec = IDBDatabaseException::InvalidAccessError;
+ return nullptr;
+ }
+
+ // Install the new Index into the ObjectStore's info.
+ IDBIndexInfo info = m_info.createNewIndex(name, keyPath, unique, multiEntry);
+ m_transaction->database().didCreateIndexInfo(info);
+
+ // Create the actual IDBObjectStore from the transaction, which also schedules the operation server side.
+ Ref<IDBIndex> index = m_transaction->createIndex(*this, info);
+ return WTF::move(index);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<WebCore::IDBIndex> IDBObjectStore::index(const String&, ExceptionCode&)
</del><ins>+RefPtr<WebCore::IDBIndex> IDBObjectStore::index(const String& indexName, ExceptionCode& ec)
</ins><span class="cx"> {
</span><del>- RELEASE_ASSERT_NOT_REACHED();
</del><ins>+ LOG(IndexedDB, "IDBObjectStore::index");
+
+ if (indexName.isEmpty()) {
+ ec = NOT_FOUND_ERR;
+ return nullptr;
+ }
+
+ if (m_deleted) {
+ ec = INVALID_STATE_ERR;
+ return nullptr;
+ }
+
+ auto iterator = m_referencedIndexes.find(indexName);
+ if (iterator != m_referencedIndexes.end())
+ return iterator->value;
+
+ auto* info = m_info.infoForExistingIndex(indexName);
+ if (!info) {
+ ec = NOT_FOUND_ERR;
+ return nullptr;
+ }
+
+ auto index = IDBIndex::create(*info, *this);
+ m_referencedIndexes.set(indexName, &index.get());
+
+ return WTF::move(index);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBObjectStore::deleteIndex(const String&, ExceptionCode&)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBObjectStoreImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx">
</span><ins>+#include "IDBIndexImpl.h"
</ins><span class="cx"> #include "IDBObjectStore.h"
</span><span class="cx"> #include "IDBObjectStoreInfo.h"
</span><span class="cx"> #include "IndexedDB.h"
</span><span class="lines">@@ -91,6 +92,8 @@
</span><span class="cx"> Ref<IDBTransaction> m_transaction;
</span><span class="cx">
</span><span class="cx"> bool m_deleted { false };
</span><ins>+
+ HashMap<String, RefPtr<IDBIndex>> m_referencedIndexes;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace IDBClient
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -378,6 +378,7 @@
</span><span class="cx"> ASSERT(isVersionChange());
</span><span class="cx">
</span><span class="cx"> Ref<IDBObjectStore> objectStore = IDBObjectStore::create(info, *this);
</span><ins>+ m_referencedObjectStores.set(info.name(), &objectStore.get());
</ins><span class="cx">
</span><span class="cx"> auto operation = createTransactionOperation(*this, &IDBTransaction::didCreateObjectStoreOnServer, &IDBTransaction::createObjectStoreOnServer, info);
</span><span class="cx"> scheduleOperation(WTF::move(operation));
</span><span class="lines">@@ -401,6 +402,35 @@
</span><span class="cx"> ASSERT_UNUSED(resultData, resultData.type() == IDBResultType::CreateObjectStoreSuccess);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+Ref<IDBIndex> IDBTransaction::createIndex(IDBObjectStore& objectStore, const IDBIndexInfo& info)
+{
+ LOG(IndexedDB, "IDBTransaction::createIndex");
+ ASSERT(isVersionChange());
+
+ Ref<IDBIndex> index = IDBIndex::create(info, objectStore);
+
+ auto operation = createTransactionOperation(*this, &IDBTransaction::didCreateIndexOnServer, &IDBTransaction::createIndexOnServer, info);
+ scheduleOperation(WTF::move(operation));
+
+ return WTF::move(index);
+}
+
+void IDBTransaction::createIndexOnServer(TransactionOperation& operation, const IDBIndexInfo& info)
+{
+ LOG(IndexedDB, "IDBTransaction::createIndexOnServer");
+
+ ASSERT(isVersionChange());
+
+ m_database->serverConnection().createIndex(operation, info);
+}
+
+void IDBTransaction::didCreateIndexOnServer(const IDBResultData& resultData)
+{
+ LOG(IndexedDB, "IDBTransaction::didCreateIndexOnServer");
+
+ ASSERT_UNUSED(resultData, resultData.type() == IDBResultType::CreateIndexSuccess);
+}
+
</ins><span class="cx"> Ref<IDBRequest> IDBTransaction::requestGetRecord(ScriptExecutionContext& context, IDBObjectStore& objectStore, const IDBKeyRangeData& keyRangeData)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::requestGetRecord");
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h        2015-11-04 07:16:30 UTC (rev 192014)
</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 "IDBIndexImpl.h"
</ins><span class="cx"> #include "IDBObjectStoreImpl.h"
</span><span class="cx"> #include "IDBTransaction.h"
</span><span class="cx"> #include "IDBTransactionInfo.h"
</span><span class="lines">@@ -40,6 +41,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+class IDBIndexInfo;
</ins><span class="cx"> class IDBObjectStoreInfo;
</span><span class="cx"> class IDBResultData;
</span><span class="cx">
</span><span class="lines">@@ -88,6 +90,7 @@
</span><span class="cx"> bool isActive() const;
</span><span class="cx">
</span><span class="cx"> Ref<IDBObjectStore> createObjectStore(const IDBObjectStoreInfo&);
</span><ins>+ Ref<IDBIndex> createIndex(IDBObjectStore&, const IDBIndexInfo&);
</ins><span class="cx">
</span><span class="cx"> Ref<IDBRequest> requestPutOrAdd(ScriptExecutionContext&, IDBObjectStore&, IDBKey*, SerializedScriptValue&, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx"> Ref<IDBRequest> requestGetRecord(ScriptExecutionContext&, IDBObjectStore&, const IDBKeyRangeData&);
</span><span class="lines">@@ -129,6 +132,9 @@
</span><span class="cx"> void createObjectStoreOnServer(TransactionOperation&, const IDBObjectStoreInfo&);
</span><span class="cx"> void didCreateObjectStoreOnServer(const IDBResultData&);
</span><span class="cx">
</span><ins>+ void createIndexOnServer(TransactionOperation&, const IDBIndexInfo&);
+ void didCreateIndexOnServer(const IDBResultData&);
+
</ins><span class="cx"> void clearObjectStoreOnServer(TransactionOperation&, const uint64_t& objectStoreIdentifier);
</span><span class="cx"> void didClearObjectStoreOnServer(IDBRequest&, const IDBResultData&);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddblegacyLegacyIndexh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyIndex.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyIndex.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/legacy/LegacyIndex.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">
</span><span class="cx"> // Implement the IDL
</span><span class="cx"> virtual const String& name() const override final { return m_metadata.name; }
</span><del>- virtual RefPtr<IDBObjectStore> objectStore() const override final { return m_objectStore; }
</del><ins>+ virtual RefPtr<IDBObjectStore> objectStore() override final { return m_objectStore; }
</ins><span class="cx"> LegacyObjectStore* legacyObjectStore() const { return m_objectStore.get(); }
</span><span class="cx"> virtual RefPtr<IDBAny> keyPathAny() const override final { return LegacyAny::create(m_metadata.keyPath); }
</span><span class="cx"> virtual const IDBKeyPath& keyPath() const override final { return m_metadata.keyPath; }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+class IDBIndexInfo;
</ins><span class="cx"> class IDBKeyData;
</span><span class="cx"> class IDBObjectStoreInfo;
</span><span class="cx"> class IDBResourceIdentifier;
</span><span class="lines">@@ -56,6 +57,7 @@
</span><span class="cx"> virtual IDBError createObjectStore(const IDBResourceIdentifier& transactionIdentifier, const IDBObjectStoreInfo&) = 0;
</span><span class="cx"> virtual IDBError deleteObjectStore(const IDBResourceIdentifier& transactionIdentifier, const String& objectStoreName) = 0;
</span><span class="cx"> virtual IDBError clearObjectStore(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier) = 0;
</span><ins>+ virtual IDBError createIndex(const IDBResourceIdentifier& transactionIdentifier, const IDBIndexInfo&) = 0;
</ins><span class="cx"> virtual IDBError keyExistsInObjectStore(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, bool& keyExists) = 0;
</span><span class="cx"> virtual IDBError deleteRange(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&) = 0;
</span><span class="cx"> virtual IDBError putRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, const ThreadSafeDataBuffer& value) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -78,6 +78,11 @@
</span><span class="cx"> m_delegate->didClearObjectStore(result);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBConnectionToClient::didCreateIndex(const IDBResultData& result)
+{
+ m_delegate->didCreateIndex(result);
+}
+
</ins><span class="cx"> void IDBConnectionToClient::didPutOrAdd(const IDBResultData& result)
</span><span class="cx"> {
</span><span class="cx"> m_delegate->didPutOrAdd(result);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -55,6 +55,7 @@
</span><span class="cx"> void didCreateObjectStore(const IDBResultData&);
</span><span class="cx"> void didDeleteObjectStore(const IDBResultData&);
</span><span class="cx"> void didClearObjectStore(const IDBResultData&);
</span><ins>+ void didCreateIndex(const IDBResultData&);
</ins><span class="cx"> void didPutOrAdd(const IDBResultData&);
</span><span class="cx"> void didGetRecord(const IDBResultData&);
</span><span class="cx"> void didGetCount(const IDBResultData&);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClientDelegateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -51,6 +51,7 @@
</span><span class="cx"> virtual void didCreateObjectStore(const IDBResultData&) = 0;
</span><span class="cx"> virtual void didDeleteObjectStore(const IDBResultData&) = 0;
</span><span class="cx"> virtual void didClearObjectStore(const IDBResultData&) = 0;
</span><ins>+ virtual void didCreateIndex(const IDBResultData&) = 0;
</ins><span class="cx"> virtual void didPutOrAdd(const IDBResultData&) = 0;
</span><span class="cx"> virtual void didGetRecord(const IDBResultData&) = 0;
</span><span class="cx"> virtual void didGetCount(const IDBResultData&) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -191,6 +191,18 @@
</span><span class="cx"> transaction->clearObjectStore(requestData, objectStoreIdentifier);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBServer::createIndex(const IDBRequestData& requestData, const IDBIndexInfo& info)
+{
+ LOG(IndexedDB, "IDBServer::createIndex");
+
+ auto transaction = m_transactions.get(requestData.transactionIdentifier());
+ if (!transaction)
+ return;
+
+ ASSERT(transaction->isVersionChange());
+ transaction->createIndex(requestData, info);
+}
+
</ins><span class="cx"> void IDBServer::putOrAdd(const IDBRequestData& requestData, const IDBKeyData& keyData, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBServer::putOrAdd");
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -62,6 +62,7 @@
</span><span class="cx"> void createObjectStore(const IDBRequestData&, const IDBObjectStoreInfo&);
</span><span class="cx"> void deleteObjectStore(const IDBRequestData&, const String& objectStoreName);
</span><span class="cx"> void clearObjectStore(const IDBRequestData&, uint64_t objectStoreIdentifier);
</span><ins>+ void createIndex(const IDBRequestData&, const IDBIndexInfo&);
</ins><span class="cx"> void putOrAdd(const IDBRequestData&, const IDBKeyData&, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx"> void getRecord(const IDBRequestData&, const IDBKeyRangeData&);
</span><span class="cx"> void getCount(const IDBRequestData&, const IDBKeyRangeData&);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryBackingStoreTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -66,6 +66,26 @@
</span><span class="cx"> addExistingObjectStore(objectStore);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void MemoryBackingStoreTransaction::addNewIndex(MemoryIndex& index)
+{
+ LOG(IndexedDB, "MemoryBackingStoreTransaction::addNewIndex()");
+
+ ASSERT(isVersionChange());
+ m_versionChangeAddedIndexes.add(&index);
+
+ addExistingIndex(index);
+}
+
+void MemoryBackingStoreTransaction::addExistingIndex(MemoryIndex& index)
+{
+ LOG(IndexedDB, "MemoryBackingStoreTransaction::addExistingIndex");
+
+ ASSERT(isWriting());
+
+ ASSERT(!m_indexes.contains(&index));
+ m_indexes.add(&index);
+}
+
</ins><span class="cx"> void MemoryBackingStoreTransaction::addExistingObjectStore(MemoryObjectStore& objectStore)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "MemoryBackingStoreTransaction::addExistingObjectStore");
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryBackingStoreTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> namespace IDBServer {
</span><span class="cx">
</span><span class="cx"> class MemoryIDBBackingStore;
</span><ins>+class MemoryIndex;
</ins><span class="cx"> class MemoryObjectStore;
</span><span class="cx">
</span><span class="cx"> typedef HashMap<IDBKeyData, ThreadSafeDataBuffer, IDBKeyDataHash, IDBKeyDataHashTraits> KeyValueMap;
</span><span class="lines">@@ -62,6 +63,9 @@
</span><span class="cx"> void objectStoreDeleted(std::unique_ptr<MemoryObjectStore>);
</span><span class="cx"> void objectStoreCleared(MemoryObjectStore&, std::unique_ptr<KeyValueMap>&&);
</span><span class="cx">
</span><ins>+ void addNewIndex(MemoryIndex&);
+ void addExistingIndex(MemoryIndex&);
+
</ins><span class="cx"> void abort();
</span><span class="cx"> void commit();
</span><span class="cx">
</span><span class="lines">@@ -80,6 +84,8 @@
</span><span class="cx">
</span><span class="cx"> HashSet<MemoryObjectStore*> m_objectStores;
</span><span class="cx"> HashSet<MemoryObjectStore*> m_versionChangeAddedObjectStores;
</span><ins>+ HashSet<MemoryIndex*> m_indexes;
+ HashSet<MemoryIndex*> m_versionChangeAddedIndexes;
</ins><span class="cx">
</span><span class="cx"> HashMap<MemoryObjectStore*, uint64_t> m_originalKeyGenerators;
</span><span class="cx"> HashMap<String, std::unique_ptr<MemoryObjectStore>> m_deletedObjectStores;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx">
</span><ins>+#include "IDBIndexInfo.h"
</ins><span class="cx"> #include "IDBKeyRangeData.h"
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "MemoryObjectStore.h"
</span><span class="lines">@@ -183,6 +184,21 @@
</span><span class="cx"> return IDBError();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+IDBError MemoryIDBBackingStore::createIndex(const IDBResourceIdentifier& transactionIdentifier, const IDBIndexInfo& info)
+{
+ LOG(IndexedDB, "MemoryIDBBackingStore::createIndex");
+
+ auto rawTransaction = m_transactions.get(transactionIdentifier);
+ ASSERT(rawTransaction);
+ ASSERT(rawTransaction->isVersionChange());
+
+ auto* objectStore = m_objectStoresByIdentifier.get(info.objectStoreIdentifier());
+ if (!objectStore)
+ return IDBError(IDBExceptionCode::ConstraintError);
+
+ return objectStore->createIndex(*rawTransaction, info);
+}
+
</ins><span class="cx"> void MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort(MemoryObjectStore& objectStore)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort");
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -55,6 +55,7 @@
</span><span class="cx"> virtual IDBError createObjectStore(const IDBResourceIdentifier& transactionIdentifier, const IDBObjectStoreInfo&) override final;
</span><span class="cx"> virtual IDBError deleteObjectStore(const IDBResourceIdentifier& transactionIdentifier, const String& objectStoreName) override final;
</span><span class="cx"> virtual IDBError clearObjectStore(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier) override final;
</span><ins>+ virtual IDBError createIndex(const IDBResourceIdentifier& transactionIdentifier, const IDBIndexInfo&) override final;
</ins><span class="cx"> virtual IDBError keyExistsInObjectStore(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, bool& keyExists) override final;
</span><span class="cx"> virtual IDBError deleteRange(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&) override final;
</span><span class="cx"> virtual IDBError putRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, const ThreadSafeDataBuffer& value) override final;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIndexcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp (0 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp         (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * Copyright (C) 2015 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. ``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
+ * 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 "MemoryIndex.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+namespace IDBServer {
+
+std::unique_ptr<MemoryIndex> MemoryIndex::create(const IDBIndexInfo& info)
+{
+ return std::make_unique<MemoryIndex>(info);
+}
+
+MemoryIndex::MemoryIndex(const IDBIndexInfo& info)
+ : m_info(info)
+{
+}
+
+MemoryIndex::~MemoryIndex()
+{
+}
+
+} // namespace IDBServer
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIndexh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h (0 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h         (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+/*
+ * Copyright (C) 2015 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. ``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
+ * 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.
+ */
+
+#ifndef MemoryIndex_h
+#define MemoryIndex_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBIndexInfo.h"
+
+namespace WebCore {
+namespace IDBServer {
+
+class MemoryIndex {
+ friend std::unique_ptr<MemoryIndex> std::make_unique<MemoryIndex>(const WebCore::IDBIndexInfo&);
+public:
+ static std::unique_ptr<MemoryIndex> create(const IDBIndexInfo&);
+
+ ~MemoryIndex();
+
+ const IDBIndexInfo& info() const { return m_info; }
+
+private:
+ MemoryIndex(const IDBIndexInfo&);
+
+ IDBIndexInfo m_info;
+};
+
+} // namespace IDBServer
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+#endif // MemoryIndex_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -28,6 +28,8 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx">
</span><ins>+#include "IDBDatabaseException.h"
+#include "IDBError.h"
</ins><span class="cx"> #include "IDBKeyRangeData.h"
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "MemoryBackingStoreTransaction.h"
</span><span class="lines">@@ -66,6 +68,24 @@
</span><span class="cx"> m_writeTransaction = nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+IDBError MemoryObjectStore::createIndex(MemoryBackingStoreTransaction& transaction, const IDBIndexInfo& info)
+{
+ LOG(IndexedDB, "MemoryObjectStore::createIndex");
+
+ if (!m_writeTransaction || m_writeTransaction->isVersionChange() || m_writeTransaction != &transaction)
+ return IDBError(IDBExceptionCode::ConstraintError);
+
+ ASSERT(!m_indexesByIdentifier.contains(info.identifier()));
+ auto index = MemoryIndex::create(info);
+
+ m_info.addExistingIndex(info);
+
+ transaction.addNewIndex(*index);
+ registerIndex(WTF::move(index));
+
+ return { };
+}
+
</ins><span class="cx"> bool MemoryObjectStore::containsRecord(const IDBKeyData& key)
</span><span class="cx"> {
</span><span class="cx"> if (!m_keyValueStore)
</span><span class="lines">@@ -220,6 +240,25 @@
</span><span class="cx"> return *lowestInRange;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void MemoryObjectStore::registerIndex(std::unique_ptr<MemoryIndex>&& index)
+{
+ ASSERT(index);
+ ASSERT(!m_indexesByIdentifier.contains(index->info().identifier()));
+ ASSERT(!m_indexesByName.contains(index->info().name()));
+
+ m_indexesByName.set(index->info().name(), index.get());
+ m_indexesByIdentifier.set(index->info().identifier(), WTF::move(index));
+}
+
+void MemoryObjectStore::unregisterIndex(MemoryIndex& index)
+{
+ ASSERT(m_indexesByIdentifier.contains(index.info().identifier()));
+ ASSERT(m_indexesByName.contains(index.info().name()));
+
+ m_indexesByName.remove(index.info().name());
+ m_indexesByIdentifier.remove(index.info().identifier());
+}
+
</ins><span class="cx"> } // namespace IDBServer
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryObjectStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -30,12 +30,14 @@
</span><span class="cx">
</span><span class="cx"> #include "IDBKeyData.h"
</span><span class="cx"> #include "IDBObjectStoreInfo.h"
</span><ins>+#include "MemoryIndex.h"
</ins><span class="cx"> #include "ThreadSafeDataBuffer.h"
</span><span class="cx"> #include <set>
</span><span class="cx"> #include <wtf/HashMap.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+class IDBError;
</ins><span class="cx"> class IDBKeyData;
</span><span class="cx">
</span><span class="cx"> struct IDBKeyRangeData;
</span><span class="lines">@@ -56,6 +58,8 @@
</span><span class="cx"> void writeTransactionStarted(MemoryBackingStoreTransaction&);
</span><span class="cx"> void writeTransactionFinished(MemoryBackingStoreTransaction&);
</span><span class="cx">
</span><ins>+ IDBError createIndex(MemoryBackingStoreTransaction&, const IDBIndexInfo&);
+
</ins><span class="cx"> bool containsRecord(const IDBKeyData&);
</span><span class="cx"> void deleteRecord(const IDBKeyData&);
</span><span class="cx"> void deleteRange(const IDBKeyRangeData&);
</span><span class="lines">@@ -86,6 +90,11 @@
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<KeyValueMap> m_keyValueStore;
</span><span class="cx"> std::unique_ptr<std::set<IDBKeyData>> m_orderedKeys;
</span><ins>+
+ void registerIndex(std::unique_ptr<MemoryIndex>&&);
+ void unregisterIndex(MemoryIndex&);
+ HashMap<uint64_t, std::unique_ptr<MemoryIndex>> m_indexesByIdentifier;
+ HashMap<String, MemoryIndex*> m_indexesByName;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace IDBServer
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -337,6 +337,42 @@
</span><span class="cx"> performErrorCallback(callbackIdentifier, error);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void UniqueIDBDatabase::createIndex(UniqueIDBDatabaseTransaction& transaction, const IDBIndexInfo& info, ErrorCallback callback)
+{
+ ASSERT(isMainThread());
+ LOG(IndexedDB, "(main) UniqueIDBDatabase::createIndex");
+
+ uint64_t callbackID = storeCallback(callback);
+ m_server.postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::performCreateIndex, callbackID, transaction.info().identifier(), info));
+}
+
+void UniqueIDBDatabase::performCreateIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, const IDBIndexInfo& info)
+{
+ ASSERT(!isMainThread());
+ LOG(IndexedDB, "(db) UniqueIDBDatabase::performCreateIndex");
+
+ ASSERT(m_backingStore);
+ m_backingStore->createIndex(transactionIdentifier, info);
+
+ IDBError error;
+ m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &UniqueIDBDatabase::didPerformCreateIndex, callbackIdentifier, error, info));
+}
+
+void UniqueIDBDatabase::didPerformCreateIndex(uint64_t callbackIdentifier, const IDBError& error, const IDBIndexInfo& info)
+{
+ ASSERT(isMainThread());
+ LOG(IndexedDB, "(main) UniqueIDBDatabase::didPerformCreateIndex");
+
+ if (error.isNull()) {
+ ASSERT(m_databaseInfo);
+ auto* objectStoreInfo = m_databaseInfo->infoForExistingObjectStore(info.objectStoreIdentifier());
+ ASSERT(objectStoreInfo);
+ objectStoreInfo->addExistingIndex(info);
+ }
+
+ performErrorCallback(callbackIdentifier, error);
+}
+
</ins><span class="cx"> void UniqueIDBDatabase::putOrAdd(const IDBRequestData& requestData, const IDBKeyData& keyData, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode overwriteMode, KeyDataCallback callback)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(isMainThread());
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -73,6 +73,7 @@
</span><span class="cx"> void createObjectStore(UniqueIDBDatabaseTransaction&, const IDBObjectStoreInfo&, ErrorCallback);
</span><span class="cx"> void deleteObjectStore(UniqueIDBDatabaseTransaction&, const String& objectStoreName, ErrorCallback);
</span><span class="cx"> void clearObjectStore(UniqueIDBDatabaseTransaction&, uint64_t objectStoreIdentifier, ErrorCallback);
</span><ins>+ void createIndex(UniqueIDBDatabaseTransaction&, const IDBIndexInfo&, ErrorCallback);
</ins><span class="cx"> void putOrAdd(const IDBRequestData&, const IDBKeyData&, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode, KeyDataCallback);
</span><span class="cx"> void getRecord(const IDBRequestData&, const IDBKeyRangeData&, ValueDataCallback);
</span><span class="cx"> void getCount(const IDBRequestData&, const IDBKeyRangeData&, CountCallback);
</span><span class="lines">@@ -105,6 +106,7 @@
</span><span class="cx"> void performCreateObjectStore(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, const IDBObjectStoreInfo&);
</span><span class="cx"> void performDeleteObjectStore(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, const String& objectStoreName);
</span><span class="cx"> void performClearObjectStore(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier);
</span><ins>+ void performCreateIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, const IDBIndexInfo&);
</ins><span class="cx"> void performPutOrAdd(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx"> void performGetRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&);
</span><span class="cx"> void performGetCount(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&);
</span><span class="lines">@@ -116,6 +118,7 @@
</span><span class="cx"> void didPerformCreateObjectStore(uint64_t callbackIdentifier, const IDBError&, const IDBObjectStoreInfo&);
</span><span class="cx"> void didPerformDeleteObjectStore(uint64_t callbackIdentifier, const IDBError&, const String& objectStoreName);
</span><span class="cx"> void didPerformClearObjectStore(uint64_t callbackIdentifier, const IDBError&);
</span><ins>+ void didPerformCreateIndex(uint64_t callbackIdentifier, const IDBError&, const IDBIndexInfo&);
</ins><span class="cx"> void didPerformPutOrAdd(uint64_t callbackIdentifier, const IDBError&, const IDBKeyData&);
</span><span class="cx"> void didPerformGetRecord(uint64_t callbackIdentifier, const IDBError&, const ThreadSafeDataBuffer&);
</span><span class="cx"> void didPerformGetCount(uint64_t callbackIdentifier, const IDBError&, uint64_t);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -153,6 +153,13 @@
</span><span class="cx"> m_connectionToClient.didClearObjectStore(resultData);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void UniqueIDBDatabaseConnection::didCreateIndex(const IDBResultData& resultData)
+{
+ LOG(IndexedDB, "UniqueIDBDatabaseConnection::didCreateIndex");
+
+ m_connectionToClient.didCreateIndex(resultData);
+}
+
</ins><span class="cx"> } // namespace IDBServer
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -69,6 +69,7 @@
</span><span class="cx"> void didCreateObjectStore(const IDBResultData&);
</span><span class="cx"> void didDeleteObjectStore(const IDBResultData&);
</span><span class="cx"> void didClearObjectStore(const IDBResultData&);
</span><ins>+ void didCreateIndex(const IDBResultData&);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> UniqueIDBDatabaseConnection(UniqueIDBDatabase&, IDBConnectionToClient&);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -146,6 +146,23 @@
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void UniqueIDBDatabaseTransaction::createIndex(const IDBRequestData& requestData, const IDBIndexInfo& info)
+{
+ LOG(IndexedDB, "UniqueIDBDatabaseTransaction::createIndex");
+
+ ASSERT(isVersionChange());
+ ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
+
+ RefPtr<UniqueIDBDatabaseTransaction> self(this);
+ m_databaseConnection->database().createIndex(*this, info, [this, self, requestData](const IDBError& error) {
+ LOG(IndexedDB, "UniqueIDBDatabaseTransaction::createIndex (callback)");
+ if (error.isNull())
+ m_databaseConnection->didCreateIndex(IDBResultData::createIndexSuccess(requestData.requestIdentifier()));
+ else
+ m_databaseConnection->didCreateIndex(IDBResultData::error(requestData.requestIdentifier(), error));
+ });
+}
+
</ins><span class="cx"> void UniqueIDBDatabaseTransaction::putOrAdd(const IDBRequestData& requestData, const IDBKeyData& keyData, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "UniqueIDBDatabaseTransaction::putOrAdd");
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx">
</span><span class="cx"> class IDBDatabaseInfo;
</span><span class="cx"> class IDBError;
</span><ins>+class IDBIndexInfo;
</ins><span class="cx"> class IDBKeyData;
</span><span class="cx"> class IDBObjectStoreInfo;
</span><span class="cx"> class IDBRequestData;
</span><span class="lines">@@ -67,6 +68,7 @@
</span><span class="cx"> void createObjectStore(const IDBRequestData&, const IDBObjectStoreInfo&);
</span><span class="cx"> void deleteObjectStore(const IDBRequestData&, const String& objectStoreName);
</span><span class="cx"> void clearObjectStore(const IDBRequestData&, uint64_t objectStoreIdentifier);
</span><ins>+ void createIndex(const IDBRequestData&, const IDBIndexInfo&);
</ins><span class="cx"> void putOrAdd(const IDBRequestData&, const IDBKeyData&, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx"> void getRecord(const IDBRequestData&, const IDBKeyRangeData&);
</span><span class="cx"> void getCount(const IDBRequestData&, const IDBKeyRangeData&);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBDatabaseInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx"> m_objectStoreMap.set(info.identifier(), info);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-const IDBObjectStoreInfo* IDBDatabaseInfo::infoForExistingObjectStore(uint64_t objectStoreIdentifier) const
</del><ins>+IDBObjectStoreInfo* IDBDatabaseInfo::getInfoForExistingObjectStore(uint64_t objectStoreIdentifier)
</ins><span class="cx"> {
</span><span class="cx"> auto iterator = m_objectStoreMap.find(objectStoreIdentifier);
</span><span class="cx"> if (iterator == m_objectStoreMap.end())
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx"> return &iterator->value;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-const IDBObjectStoreInfo* IDBDatabaseInfo::infoForExistingObjectStore(const String& name) const
</del><ins>+IDBObjectStoreInfo* IDBDatabaseInfo::getInfoForExistingObjectStore(const String& name)
</ins><span class="cx"> {
</span><span class="cx"> for (auto& objectStore : m_objectStoreMap.values()) {
</span><span class="cx"> if (objectStore.name() == name)
</span><span class="lines">@@ -96,6 +96,26 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+const IDBObjectStoreInfo* IDBDatabaseInfo::infoForExistingObjectStore(uint64_t objectStoreIdentifier) const
+{
+ return const_cast<IDBDatabaseInfo*>(this)->getInfoForExistingObjectStore(objectStoreIdentifier);
+}
+
+IDBObjectStoreInfo* IDBDatabaseInfo::infoForExistingObjectStore(uint64_t objectStoreIdentifier)
+{
+ return getInfoForExistingObjectStore(objectStoreIdentifier);
+}
+
+const IDBObjectStoreInfo* IDBDatabaseInfo::infoForExistingObjectStore(const String& name) const
+{
+ return const_cast<IDBDatabaseInfo*>(this)->getInfoForExistingObjectStore(name);
+}
+
+IDBObjectStoreInfo* IDBDatabaseInfo::infoForExistingObjectStore(const String& name)
+{
+ return getInfoForExistingObjectStore(name);
+}
+
</ins><span class="cx"> Vector<String> IDBDatabaseInfo::objectStoreNames() const
</span><span class="cx"> {
</span><span class="cx"> Vector<String> names;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBDatabaseInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -49,6 +49,8 @@
</span><span class="cx"> bool hasObjectStore(const String& name) const;
</span><span class="cx"> IDBObjectStoreInfo createNewObjectStore(const String& name, const IDBKeyPath&, bool autoIncrement);
</span><span class="cx"> void addExistingObjectStore(const IDBObjectStoreInfo&);
</span><ins>+ IDBObjectStoreInfo* infoForExistingObjectStore(uint64_t objectStoreIdentifier);
+ IDBObjectStoreInfo* infoForExistingObjectStore(const String& objectStoreName);
</ins><span class="cx"> const IDBObjectStoreInfo* infoForExistingObjectStore(uint64_t objectStoreIdentifier) const;
</span><span class="cx"> const IDBObjectStoreInfo* infoForExistingObjectStore(const String& objectStoreName) const;
</span><span class="cx">
</span><span class="lines">@@ -59,6 +61,9 @@
</span><span class="cx"> private:
</span><span class="cx"> IDBDatabaseInfo();
</span><span class="cx">
</span><ins>+ IDBObjectStoreInfo* getInfoForExistingObjectStore(const String& objectStoreName);
+ IDBObjectStoreInfo* getInfoForExistingObjectStore(uint64_t objectStoreIdentifier);
+
</ins><span class="cx"> String m_name;
</span><span class="cx"> uint64_t m_version { 0 };
</span><span class="cx"> uint64_t m_maxObjectStoreID { 0 };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBIndexInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.cpp (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.cpp        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -30,6 +30,25 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+IDBIndexInfo::IDBIndexInfo()
+{
+}
+
+IDBIndexInfo::IDBIndexInfo(uint64_t identifier, uint64_t objectStoreIdentifier, const String& name, const IDBKeyPath& keyPath, bool unique, bool multiEntry)
+ : m_identifier(identifier)
+ , m_objectStoreIdentifier(objectStoreIdentifier)
+ , m_name(name)
+ , m_keyPath(keyPath)
+ , m_unique(unique)
+ , m_multiEntry(multiEntry)
+{
+}
+
+IDBIndexInfo IDBIndexInfo::isolatedCopy() const
+{
+ return { m_identifier, m_objectStoreIdentifier, m_name.isolatedCopy(), m_keyPath.isolatedCopy(), m_unique, m_multiEntry };
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBIndexInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -35,14 +35,21 @@
</span><span class="cx">
</span><span class="cx"> class IDBIndexInfo {
</span><span class="cx"> public:
</span><ins>+ IDBIndexInfo();
+ IDBIndexInfo(uint64_t identifier, uint64_t objectStoreIdentifier, const String& name, const IDBKeyPath&, bool unique, bool multiEntry);
+
+ IDBIndexInfo isolatedCopy() const;
+
+ uint64_t identifier() const { return m_identifier; }
+ uint64_t objectStoreIdentifier() const { return m_objectStoreIdentifier; }
</ins><span class="cx"> const String& name() const { return m_name; }
</span><span class="cx"> const IDBKeyPath& keyPath() const { return m_keyPath; }
</span><span class="cx"> bool unique() const { return m_unique; }
</span><span class="cx"> bool multiEntry() const { return m_multiEntry; }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- IDBIndexInfo();
-
</del><ins>+ uint64_t m_identifier { 0 };
+ uint64_t m_objectStoreIdentifier { 0 };
</ins><span class="cx"> String m_name;
</span><span class="cx"> IDBKeyPath m_keyPath;
</span><span class="cx"> bool m_unique { true };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBObjectStoreInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -42,9 +42,51 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+IDBIndexInfo IDBObjectStoreInfo::createNewIndex(const String& name, const IDBKeyPath& keyPath, bool unique, bool multiEntry)
+{
+ IDBIndexInfo info(++m_maxIndexID, m_identifier, name, keyPath, unique, multiEntry);
+ m_indexMap.set(info.identifier(), info);
+ return info;
+}
+
+void IDBObjectStoreInfo::addExistingIndex(const IDBIndexInfo& info)
+{
+ ASSERT(!m_indexMap.contains(info.identifier()));
+
+ if (info.identifier() > m_maxIndexID)
+ m_maxIndexID = info.identifier();
+
+ m_indexMap.set(info.identifier(), info);
+}
+
+bool IDBObjectStoreInfo::hasIndex(const String& name) const
+{
+ for (auto& index : m_indexMap.values()) {
+ if (index.name() == name)
+ return true;
+ }
+
+ return false;
+}
+
+IDBIndexInfo* IDBObjectStoreInfo::infoForExistingIndex(const String& name)
+{
+ for (auto& index : m_indexMap.values()) {
+ if (index.name() == name)
+ return &index;
+ }
+
+ return nullptr;
+}
+
</ins><span class="cx"> IDBObjectStoreInfo IDBObjectStoreInfo::isolatedCopy() const
</span><span class="cx"> {
</span><del>- return { m_identifier, m_name.isolatedCopy(), m_keyPath.isolatedCopy(), m_autoIncrement };
</del><ins>+ IDBObjectStoreInfo result = { m_identifier, m_name.isolatedCopy(), m_keyPath.isolatedCopy(), m_autoIncrement };
+
+ for (auto& iterator : m_indexMap)
+ result.m_indexMap.set(iterator.key, iterator.value.isolatedCopy());
+
+ return result;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBObjectStoreInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -28,7 +28,9 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx">
</span><ins>+#include "IDBIndexInfo.h"
</ins><span class="cx"> #include "IDBKeyPath.h"
</span><ins>+#include <wtf/HashMap.h>
</ins><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -47,11 +49,20 @@
</span><span class="cx">
</span><span class="cx"> IDBObjectStoreInfo isolatedCopy() const;
</span><span class="cx">
</span><ins>+ IDBIndexInfo createNewIndex(const String& name, const IDBKeyPath&, bool unique, bool multiEntry);
+ void addExistingIndex(const IDBIndexInfo&);
+ bool hasIndex(const String& name) const;
+ IDBIndexInfo* infoForExistingIndex(const String& name);
+
</ins><span class="cx"> private:
</span><span class="cx"> uint64_t m_identifier { 0 };
</span><span class="cx"> String m_name;
</span><span class="cx"> IDBKeyPath m_keyPath;
</span><span class="cx"> bool m_autoIncrement { false };
</span><ins>+ uint64_t m_maxIndexID { 0 };
+
+ HashMap<uint64_t, IDBIndexInfo> m_indexMap;
+
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBResultDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -104,6 +104,11 @@
</span><span class="cx"> return { IDBResultType::ClearObjectStoreSuccess, requestIdentifier };
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+IDBResultData IDBResultData::createIndexSuccess(const IDBResourceIdentifier& requestIdentifier)
+{
+ return { IDBResultType::CreateIndexSuccess, requestIdentifier };
+}
+
</ins><span class="cx"> IDBResultData IDBResultData::putOrAddSuccess(const IDBResourceIdentifier& requestIdentifier, const IDBKeyData& resultKey)
</span><span class="cx"> {
</span><span class="cx"> IDBResultData result(IDBResultType::PutOrAddSuccess, requestIdentifier);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBResultDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -51,6 +51,7 @@
</span><span class="cx"> GetRecordSuccess,
</span><span class="cx"> GetCountSuccess,
</span><span class="cx"> DeleteRecordSuccess,
</span><ins>+ CreateIndexSuccess,
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> namespace IDBServer {
</span><span class="lines">@@ -66,6 +67,7 @@
</span><span class="cx"> static IDBResultData createObjectStoreSuccess(const IDBResourceIdentifier&);
</span><span class="cx"> static IDBResultData deleteObjectStoreSuccess(const IDBResourceIdentifier&);
</span><span class="cx"> static IDBResultData clearObjectStoreSuccess(const IDBResourceIdentifier&);
</span><ins>+ static IDBResultData createIndexSuccess(const IDBResourceIdentifier&);
</ins><span class="cx"> static IDBResultData putOrAddSuccess(const IDBResourceIdentifier&, const IDBKeyData&);
</span><span class="cx"> static IDBResultData getRecordSuccess(const IDBResourceIdentifier&, const ThreadSafeDataBuffer& valueData);
</span><span class="cx"> static IDBResultData getCountSuccess(const IDBResourceIdentifier&, uint64_t count);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -143,6 +143,14 @@
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void InProcessIDBServer::didCreateIndex(const IDBResultData& resultData)
+{
+ RefPtr<InProcessIDBServer> self(this);
+ RunLoop::current().dispatch([this, self, resultData] {
+ m_connectionToServer->didCreateIndex(resultData);
+ });
+}
+
</ins><span class="cx"> void InProcessIDBServer::didPutOrAdd(const IDBResultData& resultData)
</span><span class="cx"> {
</span><span class="cx"> RefPtr<InProcessIDBServer> self(this);
</span><span class="lines">@@ -215,6 +223,14 @@
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void InProcessIDBServer::createIndex(const IDBRequestData& resultData, const IDBIndexInfo& info)
+{
+ RefPtr<InProcessIDBServer> self(this);
+ RunLoop::current().dispatch([this, self, resultData, info] {
+ m_server->createIndex(resultData, info);
+ });
+}
+
</ins><span class="cx"> void InProcessIDBServer::putOrAdd(const IDBRequestData& requestData, IDBKey* key, SerializedScriptValue& value, const IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</span><span class="cx"> {
</span><span class="cx"> RefPtr<InProcessIDBServer> self(this);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -61,6 +61,7 @@
</span><span class="cx"> virtual void createObjectStore(const IDBRequestData&, const IDBObjectStoreInfo&) override final;
</span><span class="cx"> virtual void deleteObjectStore(const IDBRequestData&, const String& objectStoreName) override final;
</span><span class="cx"> virtual void clearObjectStore(const IDBRequestData&, uint64_t objectStoreIdentifier) override final;
</span><ins>+ virtual void createIndex(const IDBRequestData&, const IDBIndexInfo&) override final;
</ins><span class="cx"> virtual void putOrAdd(const IDBRequestData&, IDBKey*, SerializedScriptValue&, const IndexedDB::ObjectStoreOverwriteMode) override final;
</span><span class="cx"> virtual void getRecord(const IDBRequestData&, const IDBKeyRangeData&) override final;
</span><span class="cx"> virtual void getCount(const IDBRequestData&, const IDBKeyRangeData&) override final;
</span><span class="lines">@@ -77,6 +78,7 @@
</span><span class="cx"> virtual void didCreateObjectStore(const IDBResultData&) override final;
</span><span class="cx"> virtual void didDeleteObjectStore(const IDBResultData&) override final;
</span><span class="cx"> virtual void didClearObjectStore(const IDBResultData&) override final;
</span><ins>+ virtual void didCreateIndex(const IDBResultData&) override final;
</ins><span class="cx"> virtual void didPutOrAdd(const IDBResultData&) override final;
</span><span class="cx"> virtual void didGetRecord(const IDBResultData&) override final;
</span><span class="cx"> virtual void didGetCount(const IDBResultData&) override final;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -2070,7 +2070,7 @@
</span><span class="cx">                 5185FC8D1BB4C4E80012898F /* IDBFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B471B9F889B00F789CE /* IDBFactory.h */; };
</span><span class="cx">                 5185FC8F1BB4C4E80012898F /* IDBGetResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 5123AF1C18918AE40031CDC9 /* IDBGetResult.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 5185FC901BB4C4E80012898F /* IDBIndex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51645B481B9F889B00F789CE /* IDBIndex.cpp */; };
</span><del>-                5185FC911BB4C4E80012898F /* IDBIndex.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B491B9F889B00F789CE /* IDBIndex.h */; };
</del><ins>+                5185FC911BB4C4E80012898F /* IDBIndex.h in Headers */ = {isa = PBXBuildFile; fileRef = 51645B491B9F889B00F789CE /* IDBIndex.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 5185FC931BB4C4E80012898F /* IDBIndexMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 51ABB5B6186D0ED1008391A1 /* IDBIndexMetadata.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 5185FC941BB4C4E80012898F /* IDBKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D71991181106E00016DC51 /* IDBKey.cpp */; };
</span><span class="cx">                 5185FC951BB4C4E80012898F /* IDBKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D71992181106E00016DC51 /* IDBKey.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -2115,6 +2115,8 @@
</span><span class="cx">                 518F5002194CAC3A0081BAAE /* JSGamepad.h in Headers */ = {isa = PBXBuildFile; fileRef = 518F4FFE194CAC3A0081BAAE /* JSGamepad.h */; };
</span><span class="cx">                 518F5003194CAC3A0081BAAE /* JSGamepadButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 518F4FFF194CAC3A0081BAAE /* JSGamepadButton.cpp */; };
</span><span class="cx">                 518F5004194CAC3A0081BAAE /* JSGamepadButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 518F5000194CAC3A0081BAAE /* JSGamepadButton.h */; };
</span><ins>+                518F97021BE94C630023187C /* MemoryIndex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 518F97001BE94C5B0023187C /* MemoryIndex.cpp */; };
+                518F97031BE94C630023187C /* MemoryIndex.h in Headers */ = {isa = PBXBuildFile; fileRef = 518F97011BE94C5B0023187C /* MemoryIndex.h */; };
</ins><span class="cx">                 5198F7A41BBDB79300E2CC5F /* UniqueIDBDatabaseConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5198F7A21BBDAA2900E2CC5F /* UniqueIDBDatabaseConnection.cpp */; };
</span><span class="cx">                 5198F7A51BBDB79300E2CC5F /* UniqueIDBDatabaseConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 5198F7A31BBDAA2900E2CC5F /* UniqueIDBDatabaseConnection.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 5198F7A81BBDD38500E2CC5F /* UniqueIDBDatabaseTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5198F7A61BBDD38100E2CC5F /* UniqueIDBDatabaseTransaction.cpp */; };
</span><span class="lines">@@ -9496,6 +9498,8 @@
</span><span class="cx">                 518F4FFE194CAC3A0081BAAE /* JSGamepad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGamepad.h; sourceTree = "<group>"; };
</span><span class="cx">                 518F4FFF194CAC3A0081BAAE /* JSGamepadButton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGamepadButton.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 518F5000194CAC3A0081BAAE /* JSGamepadButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGamepadButton.h; sourceTree = "<group>"; };
</span><ins>+                518F97001BE94C5B0023187C /* MemoryIndex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryIndex.cpp; sourceTree = "<group>"; };
+                518F97011BE94C5B0023187C /* MemoryIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryIndex.h; sourceTree = "<group>"; };
</ins><span class="cx">                 5198F7A21BBDAA2900E2CC5F /* UniqueIDBDatabaseConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UniqueIDBDatabaseConnection.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 5198F7A31BBDAA2900E2CC5F /* UniqueIDBDatabaseConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UniqueIDBDatabaseConnection.h; sourceTree = "<group>"; };
</span><span class="cx">                 5198F7A61BBDD38100E2CC5F /* UniqueIDBDatabaseTransaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UniqueIDBDatabaseTransaction.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -16853,6 +16857,8 @@
</span><span class="cx">                                 51E1BAC11BD806470055D81F /* MemoryBackingStoreTransaction.h */,
</span><span class="cx">                                 51BA4AC81BBC5B9E00DF3D6D /* MemoryIDBBackingStore.cpp */,
</span><span class="cx">                                 51BA4AC91BBC5B9E00DF3D6D /* MemoryIDBBackingStore.h */,
</span><ins>+                                518F97001BE94C5B0023187C /* MemoryIndex.cpp */,
+                                518F97011BE94C5B0023187C /* MemoryIndex.h */,
</ins><span class="cx">                                 51771DFC1BDB475600CAE8E4 /* MemoryObjectStore.cpp */,
</span><span class="cx">                                 51771DFD1BDB475600CAE8E4 /* MemoryObjectStore.h */,
</span><span class="cx">                                 518864DE1BBAF30F00E540C9 /* UniqueIDBDatabase.cpp */,
</span><span class="lines">@@ -25837,6 +25843,7 @@
</span><span class="cx">                                 F344C75311294D9D00F26EEE /* InspectorFrontendClientLocal.h in Headers */,
</span><span class="cx">                                 7A0E770F10C00A8800A0276E /* InspectorFrontendHost.h in Headers */,
</span><span class="cx">                                 7A54858014E02D51006AE05A /* InspectorHistory.h in Headers */,
</span><ins>+                                518F97031BE94C630023187C /* MemoryIndex.h in Headers */,
</ins><span class="cx">                                 7ACD88D414C08BD60084EDD2 /* InspectorIndexedDBAgent.h in Headers */,
</span><span class="cx">                                 20D629271253690B00081543 /* InspectorInstrumentation.h in Headers */,
</span><span class="cx">                                 A5840E1D187B74D500843B10 /* InspectorInstrumentationCookie.h in Headers */,
</span><span class="lines">@@ -31023,6 +31030,7 @@
</span><span class="cx">                                 B2227A3B0D00BF220071B782 /* SVGLineElement.cpp in Sources */,
</span><span class="cx">                                 B2227A400D00BF220071B782 /* SVGLocatable.cpp in Sources */,
</span><span class="cx">                                 B2227A430D00BF220071B782 /* SVGMarkerElement.cpp in Sources */,
</span><ins>+                                518F97021BE94C630023187C /* MemoryIndex.cpp in Sources */,
</ins><span class="cx">                                 B2227A460D00BF220071B782 /* SVGMaskElement.cpp in Sources */,
</span><span class="cx">                                 B2227A4A0D00BF220071B782 /* SVGMetadataElement.cpp in Sources */,
</span><span class="cx">                                 B2A1F2B00CEF0ABF00442F6A /* SVGMissingGlyphElement.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSIDBObjectStoreCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSIDBObjectStoreCustom.cpp (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSIDBObjectStoreCustom.cpp        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/bindings/js/JSIDBObjectStoreCustom.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -102,11 +102,19 @@
</span><span class="cx"> if (state.argumentCount() < 2)
</span><span class="cx"> return state.vm().throwException(&state, createNotEnoughArgumentsError(&state));
</span><span class="cx">
</span><del>- String name = state.argument(0).toString(&state)->value(&state);
</del><ins>+ String name;
+ JSValue nameValue = state.argument(0);
+ if (!nameValue.isUndefinedOrNull())
+ name = nameValue.toString(&state)->value(&state);
+
</ins><span class="cx"> if (state.hadException())
</span><span class="cx"> return jsUndefined();
</span><span class="cx">
</span><del>- IDBKeyPath keyPath = idbKeyPathFromValue(&state, state.argument(1));
</del><ins>+ IDBKeyPath keyPath;
+ JSValue keyPathValue = state.argument(1);
+ if (!keyPathValue.isUndefinedOrNull())
+ keyPath = idbKeyPathFromValue(&state, state.argument(1));
+
</ins><span class="cx"> if (state.hadException())
</span><span class="cx"> return jsUndefined();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformCrossThreadCopiercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/CrossThreadCopier.cpp (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/CrossThreadCopier.cpp        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/platform/CrossThreadCopier.cpp        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> #include "IDBDatabaseMetadata.h"
</span><span class="cx"> #include "IDBError.h"
</span><span class="cx"> #include "IDBGetResult.h"
</span><ins>+#include "IDBIndexInfo.h"
</ins><span class="cx"> #include "IDBKeyData.h"
</span><span class="cx"> #include "IDBKeyRangeData.h"
</span><span class="cx"> #include "IDBObjectStoreInfo.h"
</span><span class="lines">@@ -169,6 +170,11 @@
</span><span class="cx"> return info.isolatedCopy();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+CrossThreadCopierBase<false, false, IDBIndexInfo>::Type CrossThreadCopierBase<false, false, IDBIndexInfo>::copy(const IDBIndexInfo& info)
+{
+ return info.isolatedCopy();
+}
+
</ins><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span><span class="cx">
</span><span class="cx"> // Test CrossThreadCopier using COMPILE_ASSERT.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformCrossThreadCopierh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/CrossThreadCopier.h (192013 => 192014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/CrossThreadCopier.h        2015-11-04 07:06:16 UTC (rev 192013)
+++ trunk/Source/WebCore/platform/CrossThreadCopier.h        2015-11-04 07:16:30 UTC (rev 192014)
</span><span class="lines">@@ -233,6 +233,12 @@
</span><span class="cx"> static Type copy(const IDBObjectStoreInfo&);
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+ class IDBIndexInfo;
+ template<> struct WEBCORE_EXPORT CrossThreadCopierBase<false, false, IDBIndexInfo> {
+ typedef IDBIndexInfo Type;
+ static Type copy(const IDBIndexInfo&);
+ };
+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> template<typename T>
</span></span></pre>
</div>
</div>
</body>
</html>