<!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&gt;::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  &lt;beidson@apple.com&gt;
+
+        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  &lt;jiewen_tan@apple.com&gt;
</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().&lt;br&gt;
+&lt;div id=&quot;logger&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+}
+
+function done()
+{
+    log(&quot;Done&quot;);
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+function log(message)
+{
+    document.getElementById(&quot;logger&quot;).innerHTML += message + &quot;&lt;br&gt;&quot;;
+}
+
+var createRequest = window.indexedDB.open(&quot;IDBObjectStoreCreateIndexFailuresDatabase&quot;, 1);
+var database;
+
+createRequest.onupgradeneeded = function(event) {
+    log(&quot;Initial upgrade needed: Old version - &quot; + event.oldVersion + &quot; New version - &quot; + event.newVersion);
+
+    var versionTransaction = createRequest.transaction;
+    database = event.target.result;
+    var objectStore = database.createObjectStore(&quot;TestObjectStore&quot;);
+
+    try {
+        objectStore.createIndex(null, &quot;foo&quot;);
+    } catch(e) {
+        log(&quot;Failed to create index with null name&quot;);
+    }
+    
+    try {
+        objectStore.createIndex(&quot;TestIndex1&quot;, null);
+    } catch(e) {
+        log(&quot;Failed to create index with invalid key path&quot;);
+    }
+    
+    database.deleteObjectStore(&quot;TestObjectStore&quot;);
+    try {
+        objectStore.createIndex(&quot;TestIndex2&quot;, &quot;foo&quot;);
+    } catch(e) {
+        log(&quot;Failed to create index on a deleted object store&quot;);
+    }
+
+    objectStore = database.createObjectStore(&quot;TestObjectStore&quot;);
+    
+    try {
+        objectStore.createIndex(&quot;TestIndex3&quot;, [&quot;foo&quot;, &quot;bar&quot;], { multiEntry: true });
+    } catch(e) {
+        log(&quot;Failed to create multi-entry index with an array key path&quot;);
+    }
+    
+    objectStore.createIndex(&quot;TestIndex4&quot;, &quot;foo&quot;);
+    try {
+        objectStore.createIndex(&quot;TestIndex4&quot;, &quot;foo&quot;);
+    } catch(e) {
+        log(&quot;Failed to create index that already exists&quot;);
+    }
+
+    // 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(&quot;foo&quot;).onsuccess = function() {
+            if (!canFinish)
+                spinGet();
+        }
+    }
+    spinGet();
+
+    var createWhileInactive = function() {
+        try {
+            objectStore.createIndex(&quot;TestIndex5&quot;, &quot;foo&quot;);
+        } catch(e) {
+            log(&quot;Failed to create index while the transaction is inactive&quot;);
+        }
+        canFinish = true;
+    }
+    
+    setTimeout(createWhileInactive, 0);
+    
+    versionTransaction.onabort = function(event) {
+        log(&quot;Initial upgrade versionchange transaction unexpected aborted&quot;);
+        done();
+    }
+
+    versionTransaction.oncomplete = function(event) {
+        log(&quot;Initial upgrade versionchange transaction complete&quot;);
+        continueTest1();
+    }
+
+    versionTransaction.onerror = function(event) {
+        log(&quot;Initial upgrade versionchange transaction unexpected error&quot; + event);
+        done();
+    }
+}
+
+function continueTest1()
+{
+    var transaction = database.transaction(&quot;TestObjectStore&quot;, &quot;readwrite&quot;);
+    var objectStore = transaction.objectStore(&quot;TestObjectStore&quot;);
+
+    try {
+        objectStore.createIndex(&quot;TestIndex6&quot;, &quot;foo&quot;);
+    } catch(e) {
+        log(&quot;Failed to create index outside of a version change transaction&quot;);
+    }
+        
+    transaction.onabort = function(event) {
+        log(&quot;readonly transaction unexpected abort&quot; + event);
+        done();
+    }
+
+    transaction.oncomplete = function(event) {
+        log(&quot;readonly transaction complete&quot;);
+        done();
+    }
+
+    transaction.onerror = function(event) {
+        log(&quot;readonly transaction unexpected error&quot; + event);
+        done();
+    }
+}
+
+&lt;/script&gt;
</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().&lt;br&gt;
+&lt;div id=&quot;logger&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+}
+
+function done()
+{
+    log(&quot;Done&quot;);
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+function log(message)
+{
+    document.getElementById(&quot;logger&quot;).innerHTML += message + &quot;&lt;br&gt;&quot;;
+}
+
+var createRequest = window.indexedDB.open(&quot;IDBObjectStoreGetIndexFailuresDatabase&quot;, 1);
+var database;
+
+createRequest.onupgradeneeded = function(event) {
+    log(&quot;Initial upgrade needed: Old version - &quot; + event.oldVersion + &quot; New version - &quot; + event.newVersion);
+
+    var versionTransaction = createRequest.transaction;
+    database = event.target.result;
+    var objectStore = database.createObjectStore(&quot;TestObjectStore&quot;);
+    objectStore.createIndex(&quot;TestIndex&quot;, &quot;foo&quot;);
+    
+    versionTransaction.onabort = function(event) {
+        log(&quot;Initial upgrade versionchange transaction unexpected aborted&quot;);
+        done();
+    }
+
+    versionTransaction.oncomplete = function(event) {
+        log(&quot;Initial upgrade versionchange transaction complete&quot;);
+        continueTest1();
+    }
+
+    versionTransaction.onerror = function(event) {
+        log(&quot;Initial upgrade versionchange transaction unexpected error&quot; + event);
+        done();
+    }
+}
+
+function continueTest1()
+{
+    var transaction = database.transaction(&quot;TestObjectStore&quot;, &quot;readonly&quot;);
+    var objectStore = transaction.objectStore(&quot;TestObjectStore&quot;);
+
+    var index = objectStore.index(&quot;TestIndex&quot;);
+    log(&quot;Got an index as expected: &quot; + index);
+
+    try {
+        objectStore.index(null);
+    } catch(e) {
+        log(&quot;Failed to get an index with a null name&quot;);
+    }
+
+    try {
+        objectStore.index(&quot;DoesNotExistdex&quot;);
+    } catch(e) {
+        log(&quot;Failed to get an index that doesn't exist&quot;);
+    }
+
+    transaction.onabort = function(event) {
+        log(&quot;readonly transaction unexpected abort&quot; + event);
+        done();
+    }
+
+    transaction.oncomplete = function(event) {
+        log(&quot;readonly transaction complete&quot;);
+        continueTest2();
+        database.close();
+    }
+
+    transaction.onerror = function(event) {
+        log(&quot;readonly transaction unexpected error&quot; + event);
+        done();
+    }
+}
+
+function continueTest2()
+{
+    var createRequest = window.indexedDB.open(&quot;IDBObjectStoreGetIndexFailuresDatabase&quot;, 2);
+    createRequest.onupgradeneeded = function(event) {
+        log(&quot;Second upgrade needed: Old version - &quot; + event.oldVersion + &quot; New version - &quot; + event.newVersion);
+
+        var versionTransaction = createRequest.transaction;
+        var database = event.target.result;
+        var objectStore = versionTransaction.objectStore(&quot;TestObjectStore&quot;);
+        database.deleteObjectStore(&quot;TestObjectStore&quot;);
+        
+        try {
+            objectStore.index(&quot;TestIndex&quot;);
+        } catch(e) {
+            log(&quot;Failed to get an index from a deleted object store&quot;);
+        }        
+            
+        versionTransaction.onabort = function(event) {
+            log(&quot;Second versionchange transaction unexpected aborted&quot;);
+            done();
+        }
+
+        versionTransaction.oncomplete = function(event) {
+            log(&quot;Second versionchange transaction complete&quot;);
+            done();
+        }
+
+        versionTransaction.onerror = function(event) {
+            log(&quot;Second versionchange transaction unexpected error&quot; + event);
+            done();
+        }
+    }
+}
+
+&lt;/script&gt;
</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.&lt;br&gt;
+&lt;div id=&quot;logger&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+}
+
+function done()
+{
+    alert(&quot;Done&quot;);
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+function gol(message)
+{
+    document.getElementById(&quot;logger&quot;).innerHTML += message + &quot;&lt;br&gt;&quot;;
+}
+
+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(&quot;IDBIndexPropertiesBasicDatabase&quot;, 1);
+var database;
+
+var indexes = new Array();
+
+createRequest.onupgradeneeded = function(event) {
+    alert(&quot;Initial upgrade needed: Old version - &quot; + event.oldVersion + &quot; New version - &quot; + event.newVersion);
+
+    var versionTransaction = createRequest.transaction;
+    database = event.target.result;
+    var objectStore = database.createObjectStore(&quot;TestObjectStore&quot;);
+    
+    indexes.push(objectStore.createIndex(&quot;TestIndex1&quot;, &quot;foo&quot;));
+    indexes.push(objectStore.createIndex(&quot;TestIndex2&quot;, &quot;foo&quot;, { unique: false, multiEntry: false }));
+    indexes.push(objectStore.createIndex(&quot;TestIndex3&quot;, &quot;foo&quot;, { unique: true, multiEntry: false }));
+    indexes.push(objectStore.createIndex(&quot;TestIndex4&quot;, &quot;foo&quot;, { unique: false, multiEntry: true }));
+    indexes.push(objectStore.createIndex(&quot;TestIndex5&quot;, &quot;foo&quot;, { unique: true, multiEntry: true }));
+    indexes.push(objectStore.createIndex(&quot;TestIndex6&quot;, [ &quot;foo&quot; ]));
+    indexes.push(objectStore.createIndex(&quot;TestIndex7&quot;, [ &quot;foo&quot;, &quot;bar&quot; ]));
+
+    for (index in indexes)
+        logIndex(indexes[index]);
+
+    versionTransaction.onabort = function(event) {
+        alert(&quot;Initial upgrade versionchange transaction unexpected aborted&quot;);
+        done();
+    }
+
+    versionTransaction.oncomplete = function(event) {
+        alert(&quot;Initial upgrade versionchange transaction complete&quot;);
+        continueTest1();
+    }
+
+    versionTransaction.onerror = function(event) {
+        alert(&quot;Initial upgrade versionchange transaction unexpected error&quot; + event);
+        done();
+    }
+}
+
+function continueTest1()
+{
+    var transaction = database.transaction(&quot;TestObjectStore&quot;, &quot;readonly&quot;);
+    var objectStore = transaction.objectStore(&quot;TestObjectStore&quot;);
+
+    logIndex(objectStore.index(&quot;TestIndex1&quot;));
+    logIndex(objectStore.index(&quot;TestIndex2&quot;));
+    logIndex(objectStore.index(&quot;TestIndex3&quot;));
+    logIndex(objectStore.index(&quot;TestIndex4&quot;));
+    logIndex(objectStore.index(&quot;TestIndex5&quot;));
+    logIndex(objectStore.index(&quot;TestIndex6&quot;));
+    logIndex(objectStore.index(&quot;TestIndex7&quot;));
+
+    transaction.onabort = function(event) {
+        alert(&quot;readonly transaction unexpected abort&quot; + event);
+        done();
+    }
+
+    transaction.oncomplete = function(event) {
+        alert(&quot;readonly transaction complete&quot;);
+        done();
+    }
+
+    transaction.onerror = function(event) {
+        alert(&quot;readonly transaction unexpected error&quot; + event);
+        done();
+    }
+}
+
+&lt;/script&gt;
</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  &lt;beidson@apple.com&gt;
+
+        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&gt;::copy):
+        * platform/CrossThreadCopier.h:
+
</ins><span class="cx"> 2015-11-03  Andy Estes  &lt;aestes@apple.com&gt;
</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&amp; name() const = 0;
</span><del>-    virtual RefPtr&lt;IDBObjectStore&gt; objectStore() const = 0;
</del><ins>+    virtual RefPtr&lt;IDBObjectStore&gt; objectStore() = 0;
</ins><span class="cx">     virtual RefPtr&lt;IDBAny&gt; keyPathAny() const = 0;
</span><span class="cx">     virtual const IDBKeyPath&amp; 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&amp; operation, const IDBIndexInfo&amp; info)
+{
+    LOG(IndexedDB, &quot;IDBConnectionToServer::createIndex&quot;);
+
+    saveOperation(operation);
+
+    m_delegate-&gt;createIndex(IDBRequestData(operation), info);
+}
+
+void IDBConnectionToServer::didCreateIndex(const IDBResultData&amp; resultData)
+{
+    LOG(IndexedDB, &quot;IDBConnectionToServer::didCreateIndex&quot;);
+    completeOperation(resultData);
+}
+
</ins><span class="cx"> void IDBConnectionToServer::putOrAdd(TransactionOperation&amp; operation, RefPtr&lt;IDBKey&gt;&amp; key, RefPtr&lt;SerializedScriptValue&gt;&amp; value, const IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBConnectionToServer::putOrAdd&quot;);
</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&amp;, uint64_t objectStoreIdentifier);
</span><span class="cx">     void didClearObjectStore(const IDBResultData&amp;);
</span><span class="cx"> 
</span><ins>+    void createIndex(TransactionOperation&amp;, const IDBIndexInfo&amp;);
+    void didCreateIndex(const IDBResultData&amp;);
+
</ins><span class="cx">     void putOrAdd(TransactionOperation&amp;, RefPtr&lt;IDBKey&gt;&amp;, RefPtr&lt;SerializedScriptValue&gt;&amp;, const IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx">     void didPutOrAdd(const IDBResultData&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerDelegateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h (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&amp;, const IDBObjectStoreInfo&amp;) = 0;
</span><span class="cx">     virtual void deleteObjectStore(const IDBRequestData&amp;, const String&amp; objectStoreName) = 0;
</span><span class="cx">     virtual void clearObjectStore(const IDBRequestData&amp;, uint64_t objectStoreIdentifier) = 0;
</span><ins>+    virtual void createIndex(const IDBRequestData&amp;, const IDBIndexInfo&amp;) = 0;
</ins><span class="cx">     virtual void putOrAdd(const IDBRequestData&amp;, IDBKey*, SerializedScriptValue&amp;, const IndexedDB::ObjectStoreOverwriteMode) = 0;
</span><span class="cx">     virtual void getRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) = 0;
</span><span class="cx">     virtual void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) = 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 &quot;IDBCursorWithValue.h&quot;
</del><ins>+#include &quot;IDBCursorImpl.h&quot;
</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()-&gt;eventQueue().enqueueEvent(adoptRef(&amp;event.leakRef()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBDatabase::didCreateIndexInfo(const IDBIndexInfo&amp; info)
+{
+    auto* objectStore = m_info.infoForExistingObjectStore(info.objectStoreIdentifier());
+    ASSERT(objectStore);
+    objectStore-&gt;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&amp; serverConnection() { return m_serverConnection.get(); }
</span><span class="cx"> 
</span><ins>+    void didCreateIndexInfo(const IDBIndexInfo&amp;);
+
</ins><span class="cx"> private:
</span><span class="cx">     IDBDatabase(ScriptExecutionContext&amp;, IDBConnectionToServer&amp;, const IDBResultData&amp;);
</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 &quot;IDBAnyImpl.h&quot;
+#include &quot;IDBObjectStoreImpl.h&quot;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> namespace IDBClient {
</span><span class="cx"> 
</span><ins>+Ref&lt;IDBIndex&gt; IDBIndex::create(const IDBIndexInfo&amp; info, IDBObjectStore&amp; objectStore)
+{
+    return adoptRef(*new IDBIndex(info, objectStore));
+}
+
+IDBIndex::IDBIndex(const IDBIndexInfo&amp; info, IDBObjectStore&amp; 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&lt;IDBObjectStore&gt; IDBIndex::objectStore() const
</del><ins>+RefPtr&lt;WebCore::IDBObjectStore&gt; IDBIndex::objectStore()
</ins><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    return &amp;m_objectStore.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBAny&gt; IDBIndex::keyPathAny() const
</del><ins>+RefPtr&lt;WebCore::IDBAny&gt; 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&amp; 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&lt;IDBRequest&gt; IDBIndex::openCursor(ScriptExecutionContext*, IDBKeyRange*, const String&amp;, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::openCursor(ScriptExecutionContext*, IDBKeyRange*, const String&amp;, ExceptionCode&amp;)
</ins><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue&amp;, const String&amp;, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue&amp;, const String&amp;, ExceptionCode&amp;)
</ins><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::count(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::count(ScriptExecutionContext*, ExceptionCode&amp;)
</ins><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::count(ScriptExecutionContext*, const Deprecated::ScriptValue&amp;, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::count(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&amp;)
</ins><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::openKeyCursor(ScriptExecutionContext*, IDBKeyRange*, const String&amp;, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::count(ScriptExecutionContext*, const Deprecated::ScriptValue&amp;, ExceptionCode&amp;)
</ins><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::openKeyCursor(ScriptExecutionContext*, const Deprecated::ScriptValue&amp;, const String&amp;, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::openKeyCursor(ScriptExecutionContext*, IDBKeyRange*, const String&amp;, ExceptionCode&amp;)
</ins><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::get(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::openKeyCursor(ScriptExecutionContext*, const Deprecated::ScriptValue&amp;, const String&amp;, ExceptionCode&amp;)
</ins><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::get(ScriptExecutionContext*, const Deprecated::ScriptValue&amp;, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::get(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&amp;)
</ins><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::getKey(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::get(ScriptExecutionContext*, const Deprecated::ScriptValue&amp;, ExceptionCode&amp;)
</ins><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBRequest&gt; IDBIndex::getKey(ScriptExecutionContext*, const Deprecated::ScriptValue&amp;, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::getKey(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&amp;)
</ins><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBIndex::getKey(ScriptExecutionContext*, const Deprecated::ScriptValue&amp;, ExceptionCode&amp;)
+{
+    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&lt;IDBIndex&gt; create(const IDBIndexInfo&amp;, IDBObjectStore&amp;);
+
</ins><span class="cx">     virtual ~IDBIndex();
</span><span class="cx"> 
</span><span class="cx">     // Implement the IDL
</span><span class="cx">     virtual const String&amp; name() const override final;
</span><del>-    virtual RefPtr&lt;IDBObjectStore&gt; objectStore() const override final;
-    virtual RefPtr&lt;IDBAny&gt; keyPathAny() const override final;
</del><ins>+    virtual RefPtr&lt;WebCore::IDBObjectStore&gt; objectStore() override final;
+    virtual RefPtr&lt;WebCore::IDBAny&gt; keyPathAny() const override final;
</ins><span class="cx">     virtual const IDBKeyPath&amp; 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&lt;IDBRequest&gt; openCursor(ScriptExecutionContext*, IDBKeyRange*, const String&amp; direction, ExceptionCode&amp;) override final;
-    virtual RefPtr&lt;IDBRequest&gt; openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue&amp; key, const String&amp; direction, ExceptionCode&amp;) override final;
-    virtual RefPtr&lt;IDBRequest&gt; count(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&amp;) override final;
-    virtual RefPtr&lt;IDBRequest&gt; count(ScriptExecutionContext*, const Deprecated::ScriptValue&amp; key, ExceptionCode&amp;) override final;
</del><ins>+    virtual RefPtr&lt;WebCore::IDBRequest&gt; openCursor(ScriptExecutionContext* context, ExceptionCode&amp; ec) override final { return openCursor(context, static_cast&lt;IDBKeyRange*&gt;(nullptr), ec); }
+    virtual RefPtr&lt;WebCore::IDBRequest&gt; openCursor(ScriptExecutionContext* context, IDBKeyRange* keyRange, ExceptionCode&amp; ec) override final { return openCursor(context, keyRange, IDBCursor::directionNext(), ec); }
+    virtual RefPtr&lt;WebCore::IDBRequest&gt; openCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue&amp; key, ExceptionCode&amp; ec) override final { return openCursor(context, key, IDBCursor::directionNext(), ec); }
+    virtual RefPtr&lt;WebCore::IDBRequest&gt; openCursor(ScriptExecutionContext*, IDBKeyRange*, const String&amp; direction, ExceptionCode&amp;) override final;
+    virtual RefPtr&lt;WebCore::IDBRequest&gt; openCursor(ScriptExecutionContext*, const Deprecated::ScriptValue&amp; key, const String&amp; direction, ExceptionCode&amp;) override final;
</ins><span class="cx"> 
</span><del>-    virtual RefPtr&lt;IDBRequest&gt; openKeyCursor(ScriptExecutionContext*, IDBKeyRange*, const String&amp; direction, ExceptionCode&amp;) override final;
-    virtual RefPtr&lt;IDBRequest&gt; openKeyCursor(ScriptExecutionContext*, const Deprecated::ScriptValue&amp; key, const String&amp; direction, ExceptionCode&amp;) override final;
</del><ins>+    virtual RefPtr&lt;WebCore::IDBRequest&gt; count(ScriptExecutionContext*, ExceptionCode&amp;) override final;
+    virtual RefPtr&lt;WebCore::IDBRequest&gt; count(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&amp;) override final;
+    virtual RefPtr&lt;WebCore::IDBRequest&gt; count(ScriptExecutionContext*, const Deprecated::ScriptValue&amp; key, ExceptionCode&amp;) override final;
</ins><span class="cx"> 
</span><del>-    virtual RefPtr&lt;IDBRequest&gt; get(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&amp;) override final;
-    virtual RefPtr&lt;IDBRequest&gt; get(ScriptExecutionContext*, const Deprecated::ScriptValue&amp; key, ExceptionCode&amp;) override final;
-    virtual RefPtr&lt;IDBRequest&gt; getKey(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&amp;) override final;
-    virtual RefPtr&lt;IDBRequest&gt; getKey(ScriptExecutionContext*, const Deprecated::ScriptValue&amp; key, ExceptionCode&amp;) override final;
</del><ins>+    virtual RefPtr&lt;WebCore::IDBRequest&gt; openKeyCursor(ScriptExecutionContext* context, ExceptionCode&amp; ec) override final { return openKeyCursor(context, static_cast&lt;IDBKeyRange*&gt;(nullptr), ec); }
+    virtual RefPtr&lt;WebCore::IDBRequest&gt; openKeyCursor(ScriptExecutionContext* context, IDBKeyRange* keyRange, ExceptionCode&amp; ec) override final { return openKeyCursor(context, keyRange, IDBCursor::directionNext(), ec); }
+    virtual RefPtr&lt;WebCore::IDBRequest&gt; openKeyCursor(ScriptExecutionContext* context, const Deprecated::ScriptValue&amp; key, ExceptionCode&amp; ec) override final { return openKeyCursor(context, key, IDBCursor::directionNext(), ec); }
+    virtual RefPtr&lt;WebCore::IDBRequest&gt; openKeyCursor(ScriptExecutionContext*, IDBKeyRange*, const String&amp; direction, ExceptionCode&amp;) override final;
+    virtual RefPtr&lt;WebCore::IDBRequest&gt; openKeyCursor(ScriptExecutionContext*, const Deprecated::ScriptValue&amp; key, const String&amp; direction, ExceptionCode&amp;) override final;
</ins><span class="cx"> 
</span><ins>+    virtual RefPtr&lt;WebCore::IDBRequest&gt; get(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&amp;) override final;
+    virtual RefPtr&lt;WebCore::IDBRequest&gt; get(ScriptExecutionContext*, const Deprecated::ScriptValue&amp; key, ExceptionCode&amp;) override final;
+    virtual RefPtr&lt;WebCore::IDBRequest&gt; getKey(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&amp;) override final;
+    virtual RefPtr&lt;WebCore::IDBRequest&gt; getKey(ScriptExecutionContext*, const Deprecated::ScriptValue&amp; key, ExceptionCode&amp;) override final;
+
</ins><span class="cx"> private:
</span><ins>+    IDBIndex(const IDBIndexInfo&amp;, IDBObjectStore&amp;);
+
</ins><span class="cx">     IDBIndexInfo m_info;
</span><ins>+    Ref&lt;IDBObjectStore&gt; 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 &quot;DOMRequestState.h&quot;
</span><span class="cx"> #include &quot;IDBBindingUtilities.h&quot;
</span><ins>+#include &quot;IDBDatabaseException.h&quot;
</ins><span class="cx"> #include &quot;IDBError.h&quot;
</span><ins>+#include &quot;IDBIndexImpl.h&quot;
</ins><span class="cx"> #include &quot;IDBKey.h&quot;
</span><span class="cx"> #include &quot;IDBKeyRangeData.h&quot;
</span><span class="cx"> #include &quot;IDBRequestImpl.h&quot;
</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&lt;WebCore::IDBIndex&gt; IDBObjectStore::createIndex(ScriptExecutionContext*, const String&amp;, const IDBKeyPath&amp;, bool, bool, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBIndex&gt; IDBObjectStore::createIndex(ScriptExecutionContext* context, const String&amp; name, const IDBKeyPath&amp; keyPath, bool unique, bool multiEntry, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    LOG(IndexedDB, &quot;IDBObjectStore::createIndex %s&quot;, name.utf8().data());
+
+    if (!context) {
+        ec = INVALID_STATE_ERR;
+        return nullptr;
+    }
+
+    if (m_deleted) {
+        ec = static_cast&lt;ExceptionCode&gt;(IDBExceptionCode::InvalidStateError);
+        return nullptr;
+    }
+
+    if (!m_transaction-&gt;isVersionChange()) {
+        ec = static_cast&lt;ExceptionCode&gt;(IDBExceptionCode::InvalidStateError);
+        return nullptr;
+    }
+
+    if (!m_transaction-&gt;isActive()) {
+        ec = static_cast&lt;ExceptionCode&gt;(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 &amp;&amp; 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-&gt;database().didCreateIndexInfo(info);
+
+    // Create the actual IDBObjectStore from the transaction, which also schedules the operation server side.
+    Ref&lt;IDBIndex&gt; index = m_transaction-&gt;createIndex(*this, info);
+    return WTF::move(index);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::IDBIndex&gt; IDBObjectStore::index(const String&amp;, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBIndex&gt; IDBObjectStore::index(const String&amp; indexName, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    LOG(IndexedDB, &quot;IDBObjectStore::index&quot;);
+
+    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-&gt;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, &amp;index.get());
+
+    return WTF::move(index);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void IDBObjectStore::deleteIndex(const String&amp;, ExceptionCode&amp;)
</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 &quot;IDBIndexImpl.h&quot;
</ins><span class="cx"> #include &quot;IDBObjectStore.h&quot;
</span><span class="cx"> #include &quot;IDBObjectStoreInfo.h&quot;
</span><span class="cx"> #include &quot;IndexedDB.h&quot;
</span><span class="lines">@@ -91,6 +92,8 @@
</span><span class="cx">     Ref&lt;IDBTransaction&gt; m_transaction;
</span><span class="cx"> 
</span><span class="cx">     bool m_deleted { false };
</span><ins>+
+    HashMap&lt;String, RefPtr&lt;IDBIndex&gt;&gt; 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&lt;IDBObjectStore&gt; objectStore = IDBObjectStore::create(info, *this);
</span><ins>+    m_referencedObjectStores.set(info.name(), &amp;objectStore.get());
</ins><span class="cx"> 
</span><span class="cx">     auto operation = createTransactionOperation(*this, &amp;IDBTransaction::didCreateObjectStoreOnServer, &amp;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&lt;IDBIndex&gt; IDBTransaction::createIndex(IDBObjectStore&amp; objectStore, const IDBIndexInfo&amp; info)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::createIndex&quot;);
+    ASSERT(isVersionChange());
+
+    Ref&lt;IDBIndex&gt; index = IDBIndex::create(info, objectStore);
+
+    auto operation = createTransactionOperation(*this, &amp;IDBTransaction::didCreateIndexOnServer, &amp;IDBTransaction::createIndexOnServer, info);
+    scheduleOperation(WTF::move(operation));
+
+    return WTF::move(index);
+}
+
+void IDBTransaction::createIndexOnServer(TransactionOperation&amp; operation, const IDBIndexInfo&amp; info)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::createIndexOnServer&quot;);
+
+    ASSERT(isVersionChange());
+
+    m_database-&gt;serverConnection().createIndex(operation, info);
+}
+
+void IDBTransaction::didCreateIndexOnServer(const IDBResultData&amp; resultData)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::didCreateIndexOnServer&quot;);
+
+    ASSERT_UNUSED(resultData, resultData.type() == IDBResultType::CreateIndexSuccess);
+}
+
</ins><span class="cx"> Ref&lt;IDBRequest&gt; IDBTransaction::requestGetRecord(ScriptExecutionContext&amp; context, IDBObjectStore&amp; objectStore, const IDBKeyRangeData&amp; keyRangeData)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBTransaction::requestGetRecord&quot;);
</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 &quot;IDBDatabaseInfo.h&quot;
</span><span class="cx"> #include &quot;IDBError.h&quot;
</span><ins>+#include &quot;IDBIndexImpl.h&quot;
</ins><span class="cx"> #include &quot;IDBObjectStoreImpl.h&quot;
</span><span class="cx"> #include &quot;IDBTransaction.h&quot;
</span><span class="cx"> #include &quot;IDBTransactionInfo.h&quot;
</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&lt;IDBObjectStore&gt; createObjectStore(const IDBObjectStoreInfo&amp;);
</span><ins>+    Ref&lt;IDBIndex&gt; createIndex(IDBObjectStore&amp;, const IDBIndexInfo&amp;);
</ins><span class="cx"> 
</span><span class="cx">     Ref&lt;IDBRequest&gt; requestPutOrAdd(ScriptExecutionContext&amp;, IDBObjectStore&amp;, IDBKey*, SerializedScriptValue&amp;, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx">     Ref&lt;IDBRequest&gt; requestGetRecord(ScriptExecutionContext&amp;, IDBObjectStore&amp;, const IDBKeyRangeData&amp;);
</span><span class="lines">@@ -129,6 +132,9 @@
</span><span class="cx">     void createObjectStoreOnServer(TransactionOperation&amp;, const IDBObjectStoreInfo&amp;);
</span><span class="cx">     void didCreateObjectStoreOnServer(const IDBResultData&amp;);
</span><span class="cx"> 
</span><ins>+    void createIndexOnServer(TransactionOperation&amp;, const IDBIndexInfo&amp;);
+    void didCreateIndexOnServer(const IDBResultData&amp;);
+
</ins><span class="cx">     void clearObjectStoreOnServer(TransactionOperation&amp;, const uint64_t&amp; objectStoreIdentifier);
</span><span class="cx">     void didClearObjectStoreOnServer(IDBRequest&amp;, const IDBResultData&amp;);
</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&amp; name() const override final { return m_metadata.name; }
</span><del>-    virtual RefPtr&lt;IDBObjectStore&gt; objectStore() const override final { return m_objectStore; }
</del><ins>+    virtual RefPtr&lt;IDBObjectStore&gt; objectStore() override final { return m_objectStore; }
</ins><span class="cx">     LegacyObjectStore* legacyObjectStore() const { return m_objectStore.get(); }
</span><span class="cx">     virtual RefPtr&lt;IDBAny&gt; keyPathAny() const override final { return LegacyAny::create(m_metadata.keyPath); }
</span><span class="cx">     virtual const IDBKeyPath&amp; 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&amp; transactionIdentifier, const IDBObjectStoreInfo&amp;) = 0;
</span><span class="cx">     virtual IDBError deleteObjectStore(const IDBResourceIdentifier&amp; transactionIdentifier, const String&amp; objectStoreName) = 0;
</span><span class="cx">     virtual IDBError clearObjectStore(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier) = 0;
</span><ins>+    virtual IDBError createIndex(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBIndexInfo&amp;) = 0;
</ins><span class="cx">     virtual IDBError keyExistsInObjectStore(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;, bool&amp; keyExists) = 0;
</span><span class="cx">     virtual IDBError deleteRange(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;) = 0;
</span><span class="cx">     virtual IDBError putRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;, const ThreadSafeDataBuffer&amp; value) = 0;
</span></span></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-&gt;didClearObjectStore(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBConnectionToClient::didCreateIndex(const IDBResultData&amp; result)
+{
+    m_delegate-&gt;didCreateIndex(result);
+}
+
</ins><span class="cx"> void IDBConnectionToClient::didPutOrAdd(const IDBResultData&amp; result)
</span><span class="cx"> {
</span><span class="cx">     m_delegate-&gt;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&amp;);
</span><span class="cx">     void didDeleteObjectStore(const IDBResultData&amp;);
</span><span class="cx">     void didClearObjectStore(const IDBResultData&amp;);
</span><ins>+    void didCreateIndex(const IDBResultData&amp;);
</ins><span class="cx">     void didPutOrAdd(const IDBResultData&amp;);
</span><span class="cx">     void didGetRecord(const IDBResultData&amp;);
</span><span class="cx">     void didGetCount(const IDBResultData&amp;);
</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&amp;) = 0;
</span><span class="cx">     virtual void didDeleteObjectStore(const IDBResultData&amp;) = 0;
</span><span class="cx">     virtual void didClearObjectStore(const IDBResultData&amp;) = 0;
</span><ins>+    virtual void didCreateIndex(const IDBResultData&amp;) = 0;
</ins><span class="cx">     virtual void didPutOrAdd(const IDBResultData&amp;) = 0;
</span><span class="cx">     virtual void didGetRecord(const IDBResultData&amp;) = 0;
</span><span class="cx">     virtual void didGetCount(const IDBResultData&amp;) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp (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-&gt;clearObjectStore(requestData, objectStoreIdentifier);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBServer::createIndex(const IDBRequestData&amp; requestData, const IDBIndexInfo&amp; info)
+{
+    LOG(IndexedDB, &quot;IDBServer::createIndex&quot;);
+
+    auto transaction = m_transactions.get(requestData.transactionIdentifier());
+    if (!transaction)
+        return;
+
+    ASSERT(transaction-&gt;isVersionChange());
+    transaction-&gt;createIndex(requestData, info);
+}
+
</ins><span class="cx"> void IDBServer::putOrAdd(const IDBRequestData&amp; requestData, const IDBKeyData&amp; keyData, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBServer::putOrAdd&quot;);
</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&amp;, const IDBObjectStoreInfo&amp;);
</span><span class="cx">     void deleteObjectStore(const IDBRequestData&amp;, const String&amp; objectStoreName);
</span><span class="cx">     void clearObjectStore(const IDBRequestData&amp;, uint64_t objectStoreIdentifier);
</span><ins>+    void createIndex(const IDBRequestData&amp;, const IDBIndexInfo&amp;);
</ins><span class="cx">     void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx">     void getRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</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&amp; index)
+{
+    LOG(IndexedDB, &quot;MemoryBackingStoreTransaction::addNewIndex()&quot;);
+
+    ASSERT(isVersionChange());
+    m_versionChangeAddedIndexes.add(&amp;index);
+
+    addExistingIndex(index);
+}
+
+void MemoryBackingStoreTransaction::addExistingIndex(MemoryIndex&amp; index)
+{
+    LOG(IndexedDB, &quot;MemoryBackingStoreTransaction::addExistingIndex&quot;);
+
+    ASSERT(isWriting());
+
+    ASSERT(!m_indexes.contains(&amp;index));
+    m_indexes.add(&amp;index);
+}
+
</ins><span class="cx"> void MemoryBackingStoreTransaction::addExistingObjectStore(MemoryObjectStore&amp; objectStore)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;MemoryBackingStoreTransaction::addExistingObjectStore&quot;);
</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&lt;IDBKeyData, ThreadSafeDataBuffer, IDBKeyDataHash, IDBKeyDataHashTraits&gt; KeyValueMap;
</span><span class="lines">@@ -62,6 +63,9 @@
</span><span class="cx">     void objectStoreDeleted(std::unique_ptr&lt;MemoryObjectStore&gt;);
</span><span class="cx">     void objectStoreCleared(MemoryObjectStore&amp;, std::unique_ptr&lt;KeyValueMap&gt;&amp;&amp;);
</span><span class="cx"> 
</span><ins>+    void addNewIndex(MemoryIndex&amp;);
+    void addExistingIndex(MemoryIndex&amp;);
+
</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&lt;MemoryObjectStore*&gt; m_objectStores;
</span><span class="cx">     HashSet&lt;MemoryObjectStore*&gt; m_versionChangeAddedObjectStores;
</span><ins>+    HashSet&lt;MemoryIndex*&gt; m_indexes;
+    HashSet&lt;MemoryIndex*&gt; m_versionChangeAddedIndexes;
</ins><span class="cx"> 
</span><span class="cx">     HashMap&lt;MemoryObjectStore*, uint64_t&gt; m_originalKeyGenerators;
</span><span class="cx">     HashMap&lt;String, std::unique_ptr&lt;MemoryObjectStore&gt;&gt; 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 &quot;IDBIndexInfo.h&quot;
</ins><span class="cx"> #include &quot;IDBKeyRangeData.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;MemoryObjectStore.h&quot;
</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&amp; transactionIdentifier, const IDBIndexInfo&amp; info)
+{
+    LOG(IndexedDB, &quot;MemoryIDBBackingStore::createIndex&quot;);
+
+    auto rawTransaction = m_transactions.get(transactionIdentifier);
+    ASSERT(rawTransaction);
+    ASSERT(rawTransaction-&gt;isVersionChange());
+
+    auto* objectStore = m_objectStoresByIdentifier.get(info.objectStoreIdentifier());
+    if (!objectStore)
+        return IDBError(IDBExceptionCode::ConstraintError);
+
+    return objectStore-&gt;createIndex(*rawTransaction, info);
+}
+
</ins><span class="cx"> void MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort(MemoryObjectStore&amp; objectStore)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort&quot;);
</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&amp; transactionIdentifier, const IDBObjectStoreInfo&amp;) override final;
</span><span class="cx">     virtual IDBError deleteObjectStore(const IDBResourceIdentifier&amp; transactionIdentifier, const String&amp; objectStoreName) override final;
</span><span class="cx">     virtual IDBError clearObjectStore(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier) override final;
</span><ins>+    virtual IDBError createIndex(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBIndexInfo&amp;) override final;
</ins><span class="cx">     virtual IDBError keyExistsInObjectStore(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;, bool&amp; keyExists) override final;
</span><span class="cx">     virtual IDBError deleteRange(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;) override final;
</span><span class="cx">     virtual IDBError putRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;, const ThreadSafeDataBuffer&amp; value) override final;
</span></span></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 &quot;config.h&quot;
+#include &quot;MemoryIndex.h&quot;
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+namespace IDBServer {
+
+std::unique_ptr&lt;MemoryIndex&gt; MemoryIndex::create(const IDBIndexInfo&amp; info)
+{
+    return std::make_unique&lt;MemoryIndex&gt;(info);
+}
+
+MemoryIndex::MemoryIndex(const IDBIndexInfo&amp; 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 &quot;IDBIndexInfo.h&quot;
+
+namespace WebCore {
+namespace IDBServer {
+
+class MemoryIndex {
+    friend std::unique_ptr&lt;MemoryIndex&gt; std::make_unique&lt;MemoryIndex&gt;(const WebCore::IDBIndexInfo&amp;);
+public:
+    static std::unique_ptr&lt;MemoryIndex&gt; create(const IDBIndexInfo&amp;);
+
+    ~MemoryIndex();
+
+    const IDBIndexInfo&amp; info() const { return m_info; }
+
+private:
+    MemoryIndex(const IDBIndexInfo&amp;);
+
+    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 &quot;IDBDatabaseException.h&quot;
+#include &quot;IDBError.h&quot;
</ins><span class="cx"> #include &quot;IDBKeyRangeData.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;MemoryBackingStoreTransaction.h&quot;
</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&amp; transaction, const IDBIndexInfo&amp; info)
+{
+    LOG(IndexedDB, &quot;MemoryObjectStore::createIndex&quot;);
+
+    if (!m_writeTransaction || m_writeTransaction-&gt;isVersionChange() || m_writeTransaction != &amp;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&amp; 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&lt;MemoryIndex&gt;&amp;&amp; index)
+{
+    ASSERT(index);
+    ASSERT(!m_indexesByIdentifier.contains(index-&gt;info().identifier()));
+    ASSERT(!m_indexesByName.contains(index-&gt;info().name()));
+
+    m_indexesByName.set(index-&gt;info().name(), index.get());
+    m_indexesByIdentifier.set(index-&gt;info().identifier(), WTF::move(index));
+}
+
+void MemoryObjectStore::unregisterIndex(MemoryIndex&amp; 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 &quot;IDBKeyData.h&quot;
</span><span class="cx"> #include &quot;IDBObjectStoreInfo.h&quot;
</span><ins>+#include &quot;MemoryIndex.h&quot;
</ins><span class="cx"> #include &quot;ThreadSafeDataBuffer.h&quot;
</span><span class="cx"> #include &lt;set&gt;
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</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&amp;);
</span><span class="cx">     void writeTransactionFinished(MemoryBackingStoreTransaction&amp;);
</span><span class="cx"> 
</span><ins>+    IDBError createIndex(MemoryBackingStoreTransaction&amp;, const IDBIndexInfo&amp;);
+
</ins><span class="cx">     bool containsRecord(const IDBKeyData&amp;);
</span><span class="cx">     void deleteRecord(const IDBKeyData&amp;);
</span><span class="cx">     void deleteRange(const IDBKeyRangeData&amp;);
</span><span class="lines">@@ -86,6 +90,11 @@
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;KeyValueMap&gt; m_keyValueStore;
</span><span class="cx">     std::unique_ptr&lt;std::set&lt;IDBKeyData&gt;&gt; m_orderedKeys;
</span><ins>+
+    void registerIndex(std::unique_ptr&lt;MemoryIndex&gt;&amp;&amp;);
+    void unregisterIndex(MemoryIndex&amp;);
+    HashMap&lt;uint64_t, std::unique_ptr&lt;MemoryIndex&gt;&gt; m_indexesByIdentifier;
+    HashMap&lt;String, MemoryIndex*&gt; 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&amp; transaction, const IDBIndexInfo&amp; info, ErrorCallback callback)
+{
+    ASSERT(isMainThread());
+    LOG(IndexedDB, &quot;(main) UniqueIDBDatabase::createIndex&quot;);
+
+    uint64_t callbackID = storeCallback(callback);
+    m_server.postDatabaseTask(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::performCreateIndex, callbackID, transaction.info().identifier(), info));
+}
+
+void UniqueIDBDatabase::performCreateIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, const IDBIndexInfo&amp; info)
+{
+    ASSERT(!isMainThread());
+    LOG(IndexedDB, &quot;(db) UniqueIDBDatabase::performCreateIndex&quot;);
+
+    ASSERT(m_backingStore);
+    m_backingStore-&gt;createIndex(transactionIdentifier, info);
+
+    IDBError error;
+    m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::didPerformCreateIndex, callbackIdentifier, error, info));
+}
+
+void UniqueIDBDatabase::didPerformCreateIndex(uint64_t callbackIdentifier, const IDBError&amp; error, const IDBIndexInfo&amp; info)
+{
+    ASSERT(isMainThread());
+    LOG(IndexedDB, &quot;(main) UniqueIDBDatabase::didPerformCreateIndex&quot;);
+
+    if (error.isNull()) {
+        ASSERT(m_databaseInfo);
+        auto* objectStoreInfo = m_databaseInfo-&gt;infoForExistingObjectStore(info.objectStoreIdentifier());
+        ASSERT(objectStoreInfo);
+        objectStoreInfo-&gt;addExistingIndex(info);
+    }
+
+    performErrorCallback(callbackIdentifier, error);
+}
+
</ins><span class="cx"> void UniqueIDBDatabase::putOrAdd(const IDBRequestData&amp; requestData, const IDBKeyData&amp; keyData, const ThreadSafeDataBuffer&amp; 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&amp;, const IDBObjectStoreInfo&amp;, ErrorCallback);
</span><span class="cx">     void deleteObjectStore(UniqueIDBDatabaseTransaction&amp;, const String&amp; objectStoreName, ErrorCallback);
</span><span class="cx">     void clearObjectStore(UniqueIDBDatabaseTransaction&amp;, uint64_t objectStoreIdentifier, ErrorCallback);
</span><ins>+    void createIndex(UniqueIDBDatabaseTransaction&amp;, const IDBIndexInfo&amp;, ErrorCallback);
</ins><span class="cx">     void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode, KeyDataCallback);
</span><span class="cx">     void getRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;, ValueDataCallback);
</span><span class="cx">     void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;, CountCallback);
</span><span class="lines">@@ -105,6 +106,7 @@
</span><span class="cx">     void performCreateObjectStore(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, const IDBObjectStoreInfo&amp;);
</span><span class="cx">     void performDeleteObjectStore(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, const String&amp; objectStoreName);
</span><span class="cx">     void performClearObjectStore(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier);
</span><ins>+    void performCreateIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, const IDBIndexInfo&amp;);
</ins><span class="cx">     void performPutOrAdd(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx">     void performGetRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;);
</span><span class="cx">     void performGetCount(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;);
</span><span class="lines">@@ -116,6 +118,7 @@
</span><span class="cx">     void didPerformCreateObjectStore(uint64_t callbackIdentifier, const IDBError&amp;, const IDBObjectStoreInfo&amp;);
</span><span class="cx">     void didPerformDeleteObjectStore(uint64_t callbackIdentifier, const IDBError&amp;, const String&amp; objectStoreName);
</span><span class="cx">     void didPerformClearObjectStore(uint64_t callbackIdentifier, const IDBError&amp;);
</span><ins>+    void didPerformCreateIndex(uint64_t callbackIdentifier, const IDBError&amp;, const IDBIndexInfo&amp;);
</ins><span class="cx">     void didPerformPutOrAdd(uint64_t callbackIdentifier, const IDBError&amp;, const IDBKeyData&amp;);
</span><span class="cx">     void didPerformGetRecord(uint64_t callbackIdentifier, const IDBError&amp;, const ThreadSafeDataBuffer&amp;);
</span><span class="cx">     void didPerformGetCount(uint64_t callbackIdentifier, const IDBError&amp;, 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&amp; resultData)
+{
+    LOG(IndexedDB, &quot;UniqueIDBDatabaseConnection::didCreateIndex&quot;);
+
+    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&amp;);
</span><span class="cx">     void didDeleteObjectStore(const IDBResultData&amp;);
</span><span class="cx">     void didClearObjectStore(const IDBResultData&amp;);
</span><ins>+    void didCreateIndex(const IDBResultData&amp;);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     UniqueIDBDatabaseConnection(UniqueIDBDatabase&amp;, IDBConnectionToClient&amp;);
</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&amp; requestData, const IDBIndexInfo&amp; info)
+{
+    LOG(IndexedDB, &quot;UniqueIDBDatabaseTransaction::createIndex&quot;);
+
+    ASSERT(isVersionChange());
+    ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
+
+    RefPtr&lt;UniqueIDBDatabaseTransaction&gt; self(this);
+    m_databaseConnection-&gt;database().createIndex(*this, info, [this, self, requestData](const IDBError&amp; error) {
+        LOG(IndexedDB, &quot;UniqueIDBDatabaseTransaction::createIndex (callback)&quot;);
+        if (error.isNull())
+            m_databaseConnection-&gt;didCreateIndex(IDBResultData::createIndexSuccess(requestData.requestIdentifier()));
+        else
+            m_databaseConnection-&gt;didCreateIndex(IDBResultData::error(requestData.requestIdentifier(), error));
+    });
+}
+
</ins><span class="cx"> void UniqueIDBDatabaseTransaction::putOrAdd(const IDBRequestData&amp; requestData, const IDBKeyData&amp; keyData, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;UniqueIDBDatabaseTransaction::putOrAdd&quot;);
</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&amp;, const IDBObjectStoreInfo&amp;);
</span><span class="cx">     void deleteObjectStore(const IDBRequestData&amp;, const String&amp; objectStoreName);
</span><span class="cx">     void clearObjectStore(const IDBRequestData&amp;, uint64_t objectStoreIdentifier);
</span><ins>+    void createIndex(const IDBRequestData&amp;, const IDBIndexInfo&amp;);
</ins><span class="cx">     void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx">     void getRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</span><span class="cx">     void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</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 &amp;iterator-&gt;value;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-const IDBObjectStoreInfo* IDBDatabaseInfo::infoForExistingObjectStore(const String&amp; name) const
</del><ins>+IDBObjectStoreInfo* IDBDatabaseInfo::getInfoForExistingObjectStore(const String&amp; name)
</ins><span class="cx"> {
</span><span class="cx">     for (auto&amp; 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&lt;IDBDatabaseInfo*&gt;(this)-&gt;getInfoForExistingObjectStore(objectStoreIdentifier);
+}
+
+IDBObjectStoreInfo* IDBDatabaseInfo::infoForExistingObjectStore(uint64_t objectStoreIdentifier)
+{
+    return getInfoForExistingObjectStore(objectStoreIdentifier);
+}
+
+const IDBObjectStoreInfo* IDBDatabaseInfo::infoForExistingObjectStore(const String&amp; name) const
+{
+    return const_cast&lt;IDBDatabaseInfo*&gt;(this)-&gt;getInfoForExistingObjectStore(name);
+}
+
+IDBObjectStoreInfo* IDBDatabaseInfo::infoForExistingObjectStore(const String&amp; name)
+{
+    return getInfoForExistingObjectStore(name);
+}
+
</ins><span class="cx"> Vector&lt;String&gt; IDBDatabaseInfo::objectStoreNames() const
</span><span class="cx"> {
</span><span class="cx">     Vector&lt;String&gt; 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&amp; name) const;
</span><span class="cx">     IDBObjectStoreInfo createNewObjectStore(const String&amp; name, const IDBKeyPath&amp;, bool autoIncrement);
</span><span class="cx">     void addExistingObjectStore(const IDBObjectStoreInfo&amp;);
</span><ins>+    IDBObjectStoreInfo* infoForExistingObjectStore(uint64_t objectStoreIdentifier);
+    IDBObjectStoreInfo* infoForExistingObjectStore(const String&amp; objectStoreName);
</ins><span class="cx">     const IDBObjectStoreInfo* infoForExistingObjectStore(uint64_t objectStoreIdentifier) const;
</span><span class="cx">     const IDBObjectStoreInfo* infoForExistingObjectStore(const String&amp; 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&amp; 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&amp; name, const IDBKeyPath&amp; 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&amp; name, const IDBKeyPath&amp;, 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&amp; name() const { return m_name; }
</span><span class="cx">     const IDBKeyPath&amp; 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&amp; name, const IDBKeyPath&amp; 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&amp; info)
+{
+    ASSERT(!m_indexMap.contains(info.identifier()));
+
+    if (info.identifier() &gt; m_maxIndexID)
+        m_maxIndexID = info.identifier();
+
+    m_indexMap.set(info.identifier(), info);
+}
+
+bool IDBObjectStoreInfo::hasIndex(const String&amp; name) const
+{
+    for (auto&amp; index : m_indexMap.values()) {
+        if (index.name() == name)
+            return true;
+    }
+
+    return false;
+}
+
+IDBIndexInfo* IDBObjectStoreInfo::infoForExistingIndex(const String&amp; name)
+{
+    for (auto&amp; index : m_indexMap.values()) {
+        if (index.name() == name)
+            return &amp;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&amp; 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 &quot;IDBIndexInfo.h&quot;
</ins><span class="cx"> #include &quot;IDBKeyPath.h&quot;
</span><ins>+#include &lt;wtf/HashMap.h&gt;
</ins><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</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&amp; name, const IDBKeyPath&amp;, bool unique, bool multiEntry);
+    void addExistingIndex(const IDBIndexInfo&amp;);
+    bool hasIndex(const String&amp; name) const;
+    IDBIndexInfo* infoForExistingIndex(const String&amp; 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&lt;uint64_t, IDBIndexInfo&gt; 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&amp; requestIdentifier)
+{
+    return { IDBResultType::CreateIndexSuccess, requestIdentifier };
+}
+
</ins><span class="cx"> IDBResultData IDBResultData::putOrAddSuccess(const IDBResourceIdentifier&amp; requestIdentifier, const IDBKeyData&amp; 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&amp;);
</span><span class="cx">     static IDBResultData deleteObjectStoreSuccess(const IDBResourceIdentifier&amp;);
</span><span class="cx">     static IDBResultData clearObjectStoreSuccess(const IDBResourceIdentifier&amp;);
</span><ins>+    static IDBResultData createIndexSuccess(const IDBResourceIdentifier&amp;);
</ins><span class="cx">     static IDBResultData putOrAddSuccess(const IDBResourceIdentifier&amp;, const IDBKeyData&amp;);
</span><span class="cx">     static IDBResultData getRecordSuccess(const IDBResourceIdentifier&amp;, const ThreadSafeDataBuffer&amp; valueData);
</span><span class="cx">     static IDBResultData getCountSuccess(const IDBResourceIdentifier&amp;, 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&amp; resultData)
+{
+    RefPtr&lt;InProcessIDBServer&gt; self(this);
+    RunLoop::current().dispatch([this, self, resultData] {
+        m_connectionToServer-&gt;didCreateIndex(resultData);
+    });
+}
+
</ins><span class="cx"> void InProcessIDBServer::didPutOrAdd(const IDBResultData&amp; resultData)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;InProcessIDBServer&gt; 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&amp; resultData, const IDBIndexInfo&amp; info)
+{
+    RefPtr&lt;InProcessIDBServer&gt; self(this);
+    RunLoop::current().dispatch([this, self, resultData, info] {
+        m_server-&gt;createIndex(resultData, info);
+    });
+}
+
</ins><span class="cx"> void InProcessIDBServer::putOrAdd(const IDBRequestData&amp; requestData, IDBKey* key, SerializedScriptValue&amp; value, const IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;InProcessIDBServer&gt; 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&amp;, const IDBObjectStoreInfo&amp;) override final;
</span><span class="cx">     virtual void deleteObjectStore(const IDBRequestData&amp;, const String&amp; objectStoreName) override final;
</span><span class="cx">     virtual void clearObjectStore(const IDBRequestData&amp;, uint64_t objectStoreIdentifier) override final;
</span><ins>+    virtual void createIndex(const IDBRequestData&amp;, const IDBIndexInfo&amp;) override final;
</ins><span class="cx">     virtual void putOrAdd(const IDBRequestData&amp;, IDBKey*, SerializedScriptValue&amp;, const IndexedDB::ObjectStoreOverwriteMode) override final;
</span><span class="cx">     virtual void getRecord(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) override final;
</span><span class="cx">     virtual void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) override final;
</span><span class="lines">@@ -77,6 +78,7 @@
</span><span class="cx">     virtual void didCreateObjectStore(const IDBResultData&amp;) override final;
</span><span class="cx">     virtual void didDeleteObjectStore(const IDBResultData&amp;) override final;
</span><span class="cx">     virtual void didClearObjectStore(const IDBResultData&amp;) override final;
</span><ins>+    virtual void didCreateIndex(const IDBResultData&amp;) override final;
</ins><span class="cx">     virtual void didPutOrAdd(const IDBResultData&amp;) override final;
</span><span class="cx">     virtual void didGetRecord(const IDBResultData&amp;) override final;
</span><span class="cx">     virtual void didGetCount(const IDBResultData&amp;) 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 = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 518F4FFF194CAC3A0081BAAE /* JSGamepadButton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGamepadButton.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 518F5000194CAC3A0081BAAE /* JSGamepadButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGamepadButton.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                518F97001BE94C5B0023187C /* MemoryIndex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryIndex.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                518F97011BE94C5B0023187C /* MemoryIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryIndex.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 5198F7A21BBDAA2900E2CC5F /* UniqueIDBDatabaseConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UniqueIDBDatabaseConnection.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5198F7A31BBDAA2900E2CC5F /* UniqueIDBDatabaseConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UniqueIDBDatabaseConnection.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5198F7A61BBDD38100E2CC5F /* UniqueIDBDatabaseTransaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UniqueIDBDatabaseTransaction.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</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() &lt; 2)
</span><span class="cx">         return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><del>-    String name = state.argument(0).toString(&amp;state)-&gt;value(&amp;state);
</del><ins>+    String name;
+    JSValue nameValue = state.argument(0);
+    if (!nameValue.isUndefinedOrNull())
+        name = nameValue.toString(&amp;state)-&gt;value(&amp;state);
+
</ins><span class="cx">     if (state.hadException())
</span><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><del>-    IDBKeyPath keyPath = idbKeyPathFromValue(&amp;state, state.argument(1));
</del><ins>+    IDBKeyPath keyPath;
+    JSValue keyPathValue = state.argument(1);
+    if (!keyPathValue.isUndefinedOrNull())
+        keyPath = idbKeyPathFromValue(&amp;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 &quot;IDBDatabaseMetadata.h&quot;
</span><span class="cx"> #include &quot;IDBError.h&quot;
</span><span class="cx"> #include &quot;IDBGetResult.h&quot;
</span><ins>+#include &quot;IDBIndexInfo.h&quot;
</ins><span class="cx"> #include &quot;IDBKeyData.h&quot;
</span><span class="cx"> #include &quot;IDBKeyRangeData.h&quot;
</span><span class="cx"> #include &quot;IDBObjectStoreInfo.h&quot;
</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&lt;false, false, IDBIndexInfo&gt;::Type CrossThreadCopierBase&lt;false, false, IDBIndexInfo&gt;::copy(const IDBIndexInfo&amp; 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&amp;);
</span><span class="cx">     };
</span><span class="cx"> 
</span><ins>+    class IDBIndexInfo;
+    template&lt;&gt; struct WEBCORE_EXPORT CrossThreadCopierBase&lt;false, false, IDBIndexInfo&gt; {
+        typedef IDBIndexInfo Type;
+        static Type copy(const IDBIndexInfo&amp;);
+    };
+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     template&lt;typename T&gt;
</span></span></pre>
</div>
</div>

</body>
</html>