<!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>[192645] 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/192645">192645</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2015-11-19 11:57:18 -0800 (Thu, 19 Nov 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Modern IDB: IDBObjectStore.deleteIndex() support.
https://bugs.webkit.org/show_bug.cgi?id=150911

Reviewed by Alex Christensen.

Source/WebCore:

Tests: storage/indexeddb/modern/deleteindex-1.html
       storage/indexeddb/modern/deleteindex-2.html

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::deleteIndex):
(WebCore::IDBClient::IDBConnectionToServer::didDeleteIndex):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:

* Modules/indexeddb/client/IDBDatabaseImpl.cpp:
(WebCore::IDBClient::IDBDatabase::didDeleteIndexInfo):
* Modules/indexeddb/client/IDBDatabaseImpl.h:

* Modules/indexeddb/client/IDBIndexImpl.cpp:
(WebCore::IDBClient::IDBIndex::markAsDeleted):
* Modules/indexeddb/client/IDBIndexImpl.h:

* Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
(WebCore::IDBClient::IDBObjectStore::index):
(WebCore::IDBClient::IDBObjectStore::deleteIndex):

* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::deleteIndex):
(WebCore::IDBClient::IDBTransaction::deleteIndexOnServer):
(WebCore::IDBClient::IDBTransaction::didDeleteIndexOnServer):
* Modules/indexeddb/client/IDBTransactionImpl.h:

* Modules/indexeddb/client/TransactionOperation.h:
(WebCore::IDBClient::createTransactionOperation):

* Modules/indexeddb/server/IDBBackingStore.h:

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

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

* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::indexDeleted):
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
* Modules/indexeddb/server/MemoryBackingStoreTransaction.h:

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

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

* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::maybeRestoreDeletedIndex):
(WebCore::IDBServer::MemoryObjectStore::takeIndexByName):
(WebCore::IDBServer::MemoryObjectStore::deleteIndex):
* Modules/indexeddb/server/MemoryObjectStore.h:

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
(WebCore::IDBServer::UniqueIDBDatabase::performDeleteIndex):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteIndex):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

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

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

* Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
(WebCore::IDBDatabaseInfo::loggingString):
* Modules/indexeddb/shared/IDBDatabaseInfo.h:

* Modules/indexeddb/shared/IDBIndexInfo.cpp:
(WebCore::IDBIndexInfo::loggingString):
* Modules/indexeddb/shared/IDBIndexInfo.h:

* Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
(WebCore::IDBObjectStoreInfo::hasIndex):
(WebCore::IDBObjectStoreInfo::deleteIndex):
(WebCore::IDBObjectStoreInfo::loggingString):
* Modules/indexeddb/shared/IDBObjectStoreInfo.h:

* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::deleteIndexSuccess):
* Modules/indexeddb/shared/IDBResultData.h:

* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::didDeleteIndex):
(WebCore::InProcessIDBServer::createIndex):
(WebCore::InProcessIDBServer::deleteIndex):
* Modules/indexeddb/shared/InProcessIDBServer.h:

LayoutTests:

* storage/indexeddb/modern/deleteindex-1-expected.txt: Added.
* storage/indexeddb/modern/deleteindex-1.html: Added.
* storage/indexeddb/modern/deleteindex-2-expected.txt: Added.
* storage/indexeddb/modern/deleteindex-2.html: Added.
* storage/indexeddb/modern/index-get-count-failures.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernindexgetcountfailuresexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/index-get-count-failures-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernindexgetcountfailureshtml">trunk/LayoutTests/storage/indexeddb/modern/index-get-count-failures.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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="#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="#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="#trunkSourceWebCoreModulesindexeddbclientTransactionOperationh">trunk/Source/WebCore/Modules/indexeddb/client/TransactionOperation.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="#trunkSourceWebCoreModulesindexeddbserverMemoryIndexcpp">trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryIndexh">trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryObjectStorecpp">trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryObjectStoreh">trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h</a></li>
<li><a href="#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>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsstorageindexeddbmoderndeleteindex1expectedtxt">trunk/LayoutTests/storage/indexeddb/modern/deleteindex-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmoderndeleteindex1html">trunk/LayoutTests/storage/indexeddb/modern/deleteindex-1.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmoderndeleteindex2expectedtxt">trunk/LayoutTests/storage/indexeddb/modern/deleteindex-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmoderndeleteindex2html">trunk/LayoutTests/storage/indexeddb/modern/deleteindex-2.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/LayoutTests/ChangeLog        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-11-19  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Modern IDB: IDBObjectStore.deleteIndex() support.
+        https://bugs.webkit.org/show_bug.cgi?id=150911
+
+        Reviewed by Alex Christensen.
+
+        * storage/indexeddb/modern/deleteindex-1-expected.txt: Added.
+        * storage/indexeddb/modern/deleteindex-1.html: Added.
+        * storage/indexeddb/modern/deleteindex-2-expected.txt: Added.
+        * storage/indexeddb/modern/deleteindex-2.html: Added.
+        * storage/indexeddb/modern/index-get-count-failures.html:
+
</ins><span class="cx"> 2015-11-19  Brian Burg  &lt;bburg@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION(r8780): Backwards delete by word incorrectly appends deleted text to kill ring, should be prepend
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmoderndeleteindex1expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/deleteindex-1-expected.txt (0 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/deleteindex-1-expected.txt                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/deleteindex-1-expected.txt        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+This tests deleting an index and then committing the transaction.
+Initial upgrade needed: Old version - 0 New version - 1
+Count is: 2
+Cursor at record: A / 1
+Cursor at record: A / 2
+Cursor at record: undefined / undefined
+Deleted the index
+Initial upgrade versionchange transaction complete
+Object store has indexes:
+Unable to get index from object store (it shouldn't exist)
+Transaction complete
+Done
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmoderndeleteindex1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/deleteindex-1.html (0 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/deleteindex-1.html                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/deleteindex-1.html        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -0,0 +1,113 @@
</span><ins>+This tests deleting an index and then committing the transaction.&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 index;
+var objectStore;
+var database;
+
+function checkIndexValues()
+{
+    var countRequest = index.count();
+    countRequest.onsuccess = function() {
+        log(&quot;Count is: &quot; + countRequest.result);
+    }
+
+    var cursorRequest = index.openCursor();
+    cursorRequest.onsuccess = function() {
+        var cursor = cursorRequest.result;
+        log(&quot;Cursor at record: &quot; + cursor.key + &quot; / &quot; + cursor.primaryKey);
+        
+        if (cursor.key != undefined)
+            cursor.continue();
+        else {
+            objectStore.deleteIndex(&quot;TestIndex1&quot;);
+            log(&quot;Deleted the index&quot;);
+        }
+    }
+    cursorRequest.onerror = function(e) {
+        log(&quot;Unexpected error opening or iterating cursor&quot;);
+        logCursor(cursorRequest.result);
+        done();
+    } 
+}
+
+var createRequest = window.indexedDB.open(&quot;DeleteIndex1Database&quot;, 1);
+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;
+    objectStore = database.createObjectStore(&quot;TestObjectStore&quot;);
+    objectStore.put({ bar: &quot;A&quot; }, 1);
+    objectStore.put({ bar: &quot;A&quot; }, 2);
+
+    index = objectStore.createIndex(&quot;TestIndex1&quot;, &quot;bar&quot;);
+    
+    checkIndexValues();
+    
+    versionTransaction.onabort = function(event) {
+        log(&quot;Initial upgrade versionchange transaction unexpected abort&quot;);
+        done();
+    }
+
+    versionTransaction.oncomplete = function(event) {
+        log(&quot;Initial upgrade versionchange transaction complete&quot;);
+        continueTest();
+    }
+
+    versionTransaction.onerror = function(event) {
+        log(&quot;Initial upgrade versionchange transaction unexpected error&quot; + event);
+        done();
+    }
+}
+
+function continueTest() {
+    var transaction = database.transaction(&quot;TestObjectStore&quot;);
+    objectStore = transaction.objectStore(&quot;TestObjectStore&quot;);
+
+    var names = objectStore.indexNames;
+    log(&quot;Object store has indexes:&quot;)
+    for (var i = 0; i &lt; names.length; ++i)
+        log(names[i]);
+    
+    try {
+        objectStore.index(&quot;TestIndex1&quot;);
+    } catch(e) {
+        log(&quot;Unable to get index from object store (it shouldn't exist)&quot;);
+    }
+
+    transaction.onabort = function(event) {
+        log(&quot;Transaction unexpected abort&quot;);
+        done();
+    }
+
+    transaction.oncomplete = function(event) {
+        log(&quot;Transaction complete&quot;);
+        done();
+    }
+
+    transaction.onerror = function(event) {
+        log(&quot;Transaction unexpected error&quot; + event);
+        done();
+    }
+}
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmoderndeleteindex2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/deleteindex-2-expected.txt (0 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/deleteindex-2-expected.txt                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/deleteindex-2-expected.txt        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+This tests deleting an index and then aborting the transaction.
+Initial upgrade needed: Old version - 0 New version - 1
+Count is: 2
+Cursor at record: A / 1
+Cursor at record: A / 2
+Cursor at record: undefined / undefined
+Initial upgrade versionchange transaction complete
+Second upgrade needed: Old version - 1 New version - 2
+Deleted the index
+Aborted the transaction
+Second upgrade versionchange transaction abort
+Third upgrade needed: Old version - 1 New version - 3
+Count is: 2
+Cursor at record: A / 1
+Cursor at record: A / 2
+Cursor at record: undefined / undefined
+Third upgrade versionchange transaction complete
+Done
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmoderndeleteindex2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/deleteindex-2.html (0 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/deleteindex-2.html                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/deleteindex-2.html        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -0,0 +1,138 @@
</span><ins>+This tests deleting an index and then aborting the transaction.&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 index;
+var objectStore;
+var database;
+
+function checkIndexValues()
+{
+    var countRequest = index.count();
+    countRequest.onsuccess = function() {
+        log(&quot;Count is: &quot; + countRequest.result);
+    }
+
+    var cursorRequest = index.openCursor();
+    cursorRequest.onsuccess = function() {
+        var cursor = cursorRequest.result;
+        log(&quot;Cursor at record: &quot; + cursor.key + &quot; / &quot; + cursor.primaryKey);
+        
+        if (cursor.key != undefined)
+            cursor.continue();
+    }
+    cursorRequest.onerror = function(e) {
+        log(&quot;Unexpected error opening or iterating cursor&quot;);
+        logCursor(cursorRequest.result);
+        done();
+    } 
+}
+
+var createRequest = window.indexedDB.open(&quot;DeleteIndex2Database&quot;, 1);
+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;
+    objectStore = database.createObjectStore(&quot;TestObjectStore&quot;);
+    objectStore.put({ bar: &quot;A&quot; }, 1);
+    objectStore.put({ bar: &quot;A&quot; }, 2);
+
+    index = objectStore.createIndex(&quot;TestIndex1&quot;, &quot;bar&quot;);
+    
+    checkIndexValues();
+    
+    versionTransaction.onabort = function(event) {
+        log(&quot;Initial upgrade versionchange transaction unexpected abort&quot;);
+        done();
+    }
+
+    versionTransaction.oncomplete = function(event) {
+        log(&quot;Initial upgrade versionchange transaction complete&quot;);
+        database.close();
+        continueTest1();
+    }
+
+    versionTransaction.onerror = function(event) {
+        log(&quot;Initial upgrade versionchange transaction unexpected error&quot; + event);
+        done();
+    }
+}
+
+function continueTest1() {
+    var createRequest = window.indexedDB.open(&quot;DeleteIndex2Database&quot;, 2);
+    createRequest.onupgradeneeded = function(event) {
+        log(&quot;Second upgrade needed: Old version - &quot; + event.oldVersion + &quot; New version - &quot; + event.newVersion);
+
+        database = event.target.result;
+        var versionTransaction = createRequest.transaction;
+        objectStore = versionTransaction.objectStore(&quot;TestObjectStore&quot;);
+        objectStore.deleteIndex(&quot;TestIndex1&quot;);
+        log(&quot;Deleted the index&quot;);
+        versionTransaction.abort();
+        log(&quot;Aborted the transaction&quot;);
+
+        versionTransaction.onabort = function(event) {
+            log(&quot;Second upgrade versionchange transaction abort&quot;);
+            database.close();
+            continueTest2();
+        }
+
+        versionTransaction.oncomplete = function(event) {
+            log(&quot;Second upgrade versionchange transaction unexpected complete&quot;);
+            done();
+        }
+
+        versionTransaction.onerror = function(event) {
+            log(&quot;Second upgrade versionchange transaction unexpected error&quot; + event);
+            done();
+        }
+    }
+}
+
+function continueTest2() {
+    var createRequest = window.indexedDB.open(&quot;DeleteIndex2Database&quot;, 3);
+    createRequest.onupgradeneeded = function(event) {
+        log(&quot;Third upgrade needed: Old version - &quot; + event.oldVersion + &quot; New version - &quot; + event.newVersion);
+
+        var versionTransaction = createRequest.transaction;
+        objectStore = versionTransaction.objectStore(&quot;TestObjectStore&quot;);
+        index = objectStore.index(&quot;TestIndex1&quot;);
+    
+        checkIndexValues();    
+        
+        versionTransaction.onabort = function(event) {
+            log(&quot;Third upgrade versionchange transaction unexpected abort&quot;);
+            done();
+        }
+
+        versionTransaction.oncomplete = function(event) {
+            log(&quot;Third upgrade versionchange transaction complete&quot;);
+            done();
+        }
+
+        versionTransaction.onerror = function(event) {
+            log(&quot;Third upgrade versionchange transaction unexpected error&quot; + event);
+            done();
+        }
+    }
+}
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernindexgetcountfailuresexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/modern/index-get-count-failures-expected.txt (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/index-get-count-failures-expected.txt        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/LayoutTests/storage/indexeddb/modern/index-get-count-failures-expected.txt        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -3,6 +3,10 @@
</span><span class="cx"> Failed to get with a null key
</span><span class="cx"> Failed to getKey with a null key
</span><span class="cx"> Failed to count with a null range
</span><ins>+Failed to get with deleted IDBIndex
+Failed to getKey with deleted IDBIndex
+Failed to count with deleted IDBIndex
+Failed to delete a nonexistent IDBIndex
</ins><span class="cx"> Failed to get with deleted IDBObjectStore
</span><span class="cx"> Failed to getKey with deleted IDBObjectStore
</span><span class="cx"> Failed to count with deleted IDBObjectStore
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernindexgetcountfailureshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/modern/index-get-count-failures.html (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/index-get-count-failures.html        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/LayoutTests/storage/indexeddb/modern/index-get-count-failures.html        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -49,27 +49,31 @@
</span><span class="cx">         log(&quot;Failed to count with a null range&quot;);
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    // FIXME: once IDBObjectStore.deleteIndex() is implemented, try these
-    // https://bugs.webkit.org/show_bug.cgi?id=150911
-    // objectStore.deleteIndex(&quot;TestIndex&quot;);
-    // 
-    // try {
-    //     index.get(&quot;test&quot;);
-    // } catch(e) {
-    //     log(&quot;Failed to get with deleted IDBIndex&quot;);
-    // }
-    // 
-    // try {
-    //     index.getKey(&quot;test&quot;);
-    // } catch(e) {
-    //     log(&quot;Failed to getKey with deleted IDBIndex&quot;);
-    // }
-    // 
-    // try {
-    //     index.count();
-    // } catch(e) {
-    //     log(&quot;Failed to count with deleted IDBIndex&quot;);
-    // }
</del><ins>+    objectStore.deleteIndex(&quot;TestIndex&quot;);
+    
+    try {
+        index.get(&quot;test&quot;);
+    } catch(e) {
+        log(&quot;Failed to get with deleted IDBIndex&quot;);
+    }
+    
+    try {
+        index.getKey(&quot;test&quot;);
+    } catch(e) {
+        log(&quot;Failed to getKey with deleted IDBIndex&quot;);
+    }
+    
+    try {
+        index.count();
+    } catch(e) {
+        log(&quot;Failed to count with deleted IDBIndex&quot;);
+    }
+    
+    try {
+        objectStore.deleteIndex(&quot;TestIndex&quot;);
+    } catch(e) {
+        log(&quot;Failed to delete a nonexistent IDBIndex&quot;);
+    }
</ins><span class="cx"> 
</span><span class="cx">     database.deleteObjectStore(&quot;TestObjectStore&quot;);
</span><span class="cx">     try {
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/ChangeLog        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -1,3 +1,108 @@
</span><ins>+2015-11-19  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Modern IDB: IDBObjectStore.deleteIndex() support.
+        https://bugs.webkit.org/show_bug.cgi?id=150911
+
+        Reviewed by Alex Christensen.
+
+        Tests: storage/indexeddb/modern/deleteindex-1.html
+               storage/indexeddb/modern/deleteindex-2.html
+
+        * Modules/indexeddb/client/IDBConnectionToServer.cpp:
+        (WebCore::IDBClient::IDBConnectionToServer::deleteIndex):
+        (WebCore::IDBClient::IDBConnectionToServer::didDeleteIndex):
+        * Modules/indexeddb/client/IDBConnectionToServer.h:
+        * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
+
+        * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
+        (WebCore::IDBClient::IDBDatabase::didDeleteIndexInfo):
+        * Modules/indexeddb/client/IDBDatabaseImpl.h:
+
+        * Modules/indexeddb/client/IDBIndexImpl.cpp:
+        (WebCore::IDBClient::IDBIndex::markAsDeleted):
+        * Modules/indexeddb/client/IDBIndexImpl.h:
+
+        * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
+        (WebCore::IDBClient::IDBObjectStore::index):
+        (WebCore::IDBClient::IDBObjectStore::deleteIndex):
+
+        * Modules/indexeddb/client/IDBTransactionImpl.cpp:
+        (WebCore::IDBClient::IDBTransaction::deleteIndex):
+        (WebCore::IDBClient::IDBTransaction::deleteIndexOnServer):
+        (WebCore::IDBClient::IDBTransaction::didDeleteIndexOnServer):
+        * Modules/indexeddb/client/IDBTransactionImpl.h:
+
+        * Modules/indexeddb/client/TransactionOperation.h:
+        (WebCore::IDBClient::createTransactionOperation):
+
+        * Modules/indexeddb/server/IDBBackingStore.h:
+
+        * Modules/indexeddb/server/IDBConnectionToClient.cpp:
+        (WebCore::IDBServer::IDBConnectionToClient::didDeleteIndex):
+        * Modules/indexeddb/server/IDBConnectionToClient.h:
+        * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
+
+        * Modules/indexeddb/server/IDBServer.cpp:
+        (WebCore::IDBServer::IDBServer::deleteIndex):
+        * Modules/indexeddb/server/IDBServer.h:
+
+        * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::indexDeleted):
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
+        * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
+
+        * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
+        (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
+        * Modules/indexeddb/server/MemoryIDBBackingStore.h:
+
+        * Modules/indexeddb/server/MemoryIndex.cpp:
+        (WebCore::IDBServer::MemoryIndex::clearIndexValueStore):
+        * Modules/indexeddb/server/MemoryIndex.h:
+
+        * Modules/indexeddb/server/MemoryObjectStore.cpp:
+        (WebCore::IDBServer::MemoryObjectStore::maybeRestoreDeletedIndex):
+        (WebCore::IDBServer::MemoryObjectStore::takeIndexByName):
+        (WebCore::IDBServer::MemoryObjectStore::deleteIndex):
+        * Modules/indexeddb/server/MemoryObjectStore.h:
+
+        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
+        (WebCore::IDBServer::UniqueIDBDatabase::performDeleteIndex):
+        (WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteIndex):
+        * Modules/indexeddb/server/UniqueIDBDatabase.h:
+
+        * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteIndex):
+        * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
+
+        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteIndex):
+        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
+
+        * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
+        (WebCore::IDBDatabaseInfo::loggingString):
+        * Modules/indexeddb/shared/IDBDatabaseInfo.h:
+
+        * Modules/indexeddb/shared/IDBIndexInfo.cpp:
+        (WebCore::IDBIndexInfo::loggingString):
+        * Modules/indexeddb/shared/IDBIndexInfo.h:
+
+        * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
+        (WebCore::IDBObjectStoreInfo::hasIndex):
+        (WebCore::IDBObjectStoreInfo::deleteIndex):
+        (WebCore::IDBObjectStoreInfo::loggingString):
+        * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
+
+        * Modules/indexeddb/shared/IDBResultData.cpp:
+        (WebCore::IDBResultData::deleteIndexSuccess):
+        * Modules/indexeddb/shared/IDBResultData.h:
+
+        * Modules/indexeddb/shared/InProcessIDBServer.cpp:
+        (WebCore::InProcessIDBServer::didDeleteIndex):
+        (WebCore::InProcessIDBServer::createIndex):
+        (WebCore::InProcessIDBServer::deleteIndex):
+        * Modules/indexeddb/shared/InProcessIDBServer.h:
+
</ins><span class="cx"> 2015-11-19  Brian Burg  &lt;bburg@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION(r8780): Backwards delete by word incorrectly appends deleted text to kill ring, should be prepend
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -155,6 +155,21 @@
</span><span class="cx">     completeOperation(resultData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBConnectionToServer::deleteIndex(TransactionOperation&amp; operation, uint64_t objectStoreIdentifier, const String&amp; indexName)
+{
+    LOG(IndexedDB, &quot;IDBConnectionToServer::deleteIndex&quot;);
+
+    saveOperation(operation);
+
+    m_delegate-&gt;deleteIndex(IDBRequestData(operation), objectStoreIdentifier, indexName);
+}
+
+void IDBConnectionToServer::didDeleteIndex(const IDBResultData&amp; resultData)
+{
+    LOG(IndexedDB, &quot;IDBConnectionToServer::didDeleteIndex&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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -74,6 +74,9 @@
</span><span class="cx">     void createIndex(TransactionOperation&amp;, const IDBIndexInfo&amp;);
</span><span class="cx">     void didCreateIndex(const IDBResultData&amp;);
</span><span class="cx"> 
</span><ins>+    void deleteIndex(TransactionOperation&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName);
+    void didDeleteIndex(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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -63,6 +63,7 @@
</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><span class="cx">     virtual void createIndex(const IDBRequestData&amp;, const IDBIndexInfo&amp;) = 0;
</span><ins>+    virtual void deleteIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName) = 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="trunkSourceWebCoreModulesindexeddbclientIDBDatabaseImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -341,6 +341,13 @@
</span><span class="cx">     objectStore-&gt;addExistingIndex(info);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBDatabase::didDeleteIndexInfo(const IDBIndexInfo&amp; info)
+{
+    auto* objectStore = m_info.infoForExistingObjectStore(info.objectStoreIdentifier());
+    ASSERT(objectStore);
+    objectStore-&gt;deleteIndex(info.name());
+}
+
</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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -85,6 +85,7 @@
</span><span class="cx">     IDBConnectionToServer&amp; serverConnection() { return m_serverConnection.get(); }
</span><span class="cx"> 
</span><span class="cx">     void didCreateIndexInfo(const IDBIndexInfo&amp;);
</span><ins>+    void didDeleteIndexInfo(const IDBIndexInfo&amp;);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     IDBDatabase(ScriptExecutionContext&amp;, IDBConnectionToServer&amp;, const IDBResultData&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBIndexImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.cpp (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.cpp        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.cpp        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -327,6 +327,11 @@
</span><span class="cx">     return transaction.requestGetKey(context, *this, range);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBIndex::markAsDeleted()
+{
+    m_deleted = true;
+}
+
</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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -78,6 +78,8 @@
</span><span class="cx">     const IDBIndexInfo&amp; info() const { return m_info; }
</span><span class="cx"> 
</span><span class="cx">     IDBObjectStore&amp; modernObjectStore() { return m_objectStore.get(); }
</span><ins>+
+    void markAsDeleted();
</ins><span class="cx">     bool isDeleted() const { return m_deleted; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBObjectStoreImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -424,6 +424,8 @@
</span><span class="cx"> 
</span><span class="cx">     // Create the actual IDBObjectStore from the transaction, which also schedules the operation server side.
</span><span class="cx">     Ref&lt;IDBIndex&gt; index = m_transaction-&gt;createIndex(*this, info);
</span><ins>+    m_referencedIndexes.set(name, &amp;index.get());
+
</ins><span class="cx">     return WTF::move(index);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -441,6 +443,11 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (!m_transaction-&gt;isActive()) {
+        ec = static_cast&lt;ExceptionCode&gt;(IDBExceptionCode::TransactionInactiveError);
+        return nullptr;
+    }
+
</ins><span class="cx">     auto iterator = m_referencedIndexes.find(indexName);
</span><span class="cx">     if (iterator != m_referencedIndexes.end())
</span><span class="cx">         return iterator-&gt;value;
</span><span class="lines">@@ -457,9 +464,40 @@
</span><span class="cx">     return WTF::move(index);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBObjectStore::deleteIndex(const String&amp;, ExceptionCode&amp;)
</del><ins>+void IDBObjectStore::deleteIndex(const String&amp; name, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    LOG(IndexedDB, &quot;IDBObjectStore::deleteIndex %s&quot;, name.utf8().data());
+
+    if (m_deleted) {
+        ec = static_cast&lt;ExceptionCode&gt;(IDBExceptionCode::InvalidStateError);
+        return;
+    }
+
+    if (!m_transaction-&gt;isVersionChange()) {
+        ec = static_cast&lt;ExceptionCode&gt;(IDBExceptionCode::InvalidStateError);
+        return;
+    }
+
+    if (!m_transaction-&gt;isActive()) {
+        ec = static_cast&lt;ExceptionCode&gt;(IDBExceptionCode::TransactionInactiveError);
+        return;
+    }
+
+    if (!m_info.hasIndex(name)) {
+        ec = IDBDatabaseException::NotFoundError;
+        return;
+    }
+
+    auto* info = m_info.infoForExistingIndex(name);
+    ASSERT(info);
+    m_transaction-&gt;database().didDeleteIndexInfo(*info);
+
+    m_info.deleteIndex(name);
+
+    if (auto index = m_referencedIndexes.take(name))
+        index-&gt;markAsDeleted();
+
+    m_transaction-&gt;deleteIndex(m_info.identifier(), name);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;WebCore::IDBRequest&gt; IDBObjectStore::count(ScriptExecutionContext* context, ExceptionCode&amp; ec)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -751,6 +751,30 @@
</span><span class="cx">     ASSERT_UNUSED(resultData, resultData.type() == IDBResultType::DeleteObjectStoreSuccess);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBTransaction::deleteIndex(uint64_t objectStoreIdentifier, const String&amp; indexName)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::deleteIndex&quot;);
+
+    ASSERT(isVersionChange());
+
+    auto operation = createTransactionOperation(*this, &amp;IDBTransaction::didDeleteIndexOnServer, &amp;IDBTransaction::deleteIndexOnServer, objectStoreIdentifier, indexName);
+    scheduleOperation(WTF::move(operation));
+}
+
+void IDBTransaction::deleteIndexOnServer(TransactionOperation&amp; operation, const uint64_t&amp; objectStoreIdentifier, const String&amp; indexName)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::deleteIndexOnServer&quot;);
+    ASSERT(isVersionChange());
+
+    serverConnection().deleteIndex(operation, objectStoreIdentifier, indexName);
+}
+
+void IDBTransaction::didDeleteIndexOnServer(const IDBResultData&amp; resultData)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::didDeleteIndexOnServer&quot;);
+    ASSERT_UNUSED(resultData, resultData.type() == IDBResultType::DeleteIndexSuccess);
+}
+
</ins><span class="cx"> void IDBTransaction::operationDidComplete(TransactionOperation&amp; operation)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_transactionOperationMap.get(operation.identifier()) == &amp;operation);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -109,6 +109,7 @@
</span><span class="cx">     void iterateCursor(IDBCursor&amp;, const IDBKeyData&amp;, unsigned long count);
</span><span class="cx"> 
</span><span class="cx">     void deleteObjectStore(const String&amp; objectStoreName);
</span><ins>+    void deleteIndex(uint64_t objectStoreIdentifier, const String&amp; indexName);
</ins><span class="cx"> 
</span><span class="cx">     void addRequest(IDBRequest&amp;);
</span><span class="cx">     void removeRequest(IDBRequest&amp;);
</span><span class="lines">@@ -165,6 +166,9 @@
</span><span class="cx">     void deleteObjectStoreOnServer(TransactionOperation&amp;, const String&amp; objectStoreName);
</span><span class="cx">     void didDeleteObjectStoreOnServer(const IDBResultData&amp;);
</span><span class="cx"> 
</span><ins>+    void deleteIndexOnServer(TransactionOperation&amp;, const uint64_t&amp; objectStoreIdentifier, const String&amp; indexName);
+    void didDeleteIndexOnServer(const IDBResultData&amp;);
+
</ins><span class="cx">     Ref&lt;IDBRequest&gt; doRequestOpenCursor(ScriptExecutionContext&amp;, Ref&lt;IDBCursor&gt;&amp;&amp;);
</span><span class="cx">     void openCursorOnServer(TransactionOperation&amp;, const IDBCursorInfo&amp;);
</span><span class="cx">     void didOpenCursorOnServer(IDBRequest&amp;, const IDBResultData&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientTransactionOperationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -138,6 +138,18 @@
</span><span class="cx">     return adoptRef(operation);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template&lt;typename MP1, typename P1, typename MP2, typename P2&gt;
+RefPtr&lt;TransactionOperation&gt; createTransactionOperation(
+    IDBTransaction&amp; transaction,
+    void (IDBTransaction::*complete)(const IDBResultData&amp;),
+    void (IDBTransaction::*perform)(TransactionOperation&amp;, MP1, MP2),
+    const P1&amp; parameter1,
+    const P2&amp; parameter2)
+{
+    auto operation = new TransactionOperationImpl&lt;MP1, MP2&gt;(transaction, complete, perform, parameter1, parameter2);
+    return adoptRef(operation);
+}
+
</ins><span class="cx"> template&lt;typename MP1, typename P1&gt;
</span><span class="cx"> RefPtr&lt;TransactionOperation&gt; createTransactionOperation(
</span><span class="cx">     IDBTransaction&amp; transaction,
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -64,6 +64,7 @@
</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><span class="cx">     virtual IDBError createIndex(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBIndexInfo&amp;) = 0;
</span><ins>+    virtual IDBError deleteIndex(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const String&amp; indexName) = 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 addRecord(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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -83,6 +83,11 @@
</span><span class="cx">     m_delegate-&gt;didCreateIndex(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBConnectionToClient::didDeleteIndex(const IDBResultData&amp; result)
+{
+    m_delegate-&gt;didDeleteIndex(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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -56,6 +56,7 @@
</span><span class="cx">     void didDeleteObjectStore(const IDBResultData&amp;);
</span><span class="cx">     void didClearObjectStore(const IDBResultData&amp;);
</span><span class="cx">     void didCreateIndex(const IDBResultData&amp;);
</span><ins>+    void didDeleteIndex(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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -52,6 +52,7 @@
</span><span class="cx">     virtual void didDeleteObjectStore(const IDBResultData&amp;) = 0;
</span><span class="cx">     virtual void didClearObjectStore(const IDBResultData&amp;) = 0;
</span><span class="cx">     virtual void didCreateIndex(const IDBResultData&amp;) = 0;
</span><ins>+    virtual void didDeleteIndex(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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -203,6 +203,18 @@
</span><span class="cx">     transaction-&gt;createIndex(requestData, info);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBServer::deleteIndex(const IDBRequestData&amp; requestData, uint64_t objectStoreIdentifier, const String&amp; indexName)
+{
+    LOG(IndexedDB, &quot;IDBServer::deleteIndex&quot;);
+
+    auto transaction = m_transactions.get(requestData.transactionIdentifier());
+    if (!transaction)
+        return;
+
+    ASSERT(transaction-&gt;isVersionChange());
+    transaction-&gt;deleteIndex(requestData, objectStoreIdentifier, indexName);
+}
+
</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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -64,6 +64,7 @@
</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><span class="cx">     void createIndex(const IDBRequestData&amp;, const IDBIndexInfo&amp;);
</span><ins>+    void deleteIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName);
</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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -86,6 +86,16 @@
</span><span class="cx">     m_indexes.add(&amp;index);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void MemoryBackingStoreTransaction::indexDeleted(std::unique_ptr&lt;MemoryIndex&gt; index)
+{
+    ASSERT(index);
+    m_indexes.remove(index.get());
+
+    auto addResult = m_deletedIndexes.add(index-&gt;info().name(), nullptr);
+    if (addResult.isNewEntry)
+        addResult.iterator-&gt;value = WTF::move(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 class="lines">@@ -170,7 +180,7 @@
</span><span class="cx"> 
</span><span class="cx">     TemporaryChange&lt;bool&gt; change(m_isAborting, true);
</span><span class="cx"> 
</span><del>-    // This loop moves the underlying unique_ptrs from out of the m_deleteObjectStores map,
</del><ins>+    // This loop moves the underlying unique_ptrs from out of the m_deletedObjectStores map,
</ins><span class="cx">     // but the entries in the map still remain.
</span><span class="cx">     for (auto&amp; objectStore : m_deletedObjectStores.values()) {
</span><span class="cx">         MemoryObjectStore* rawObjectStore = objectStore.get();
</span><span class="lines">@@ -214,6 +224,16 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // This loop moves the underlying unique_ptrs from out of the m_deletedIndexes map,
+    // but the entries in the map still remain.
+    for (auto&amp; index : m_deletedIndexes.values()) {
+        MemoryObjectStore&amp; objectStore = index-&gt;objectStore();
+        objectStore.maybeRestoreDeletedIndex(WTF::move(index));
+    }
+
+    // This clears the entries from the map.
+    m_deletedIndexes.clear();
+
</ins><span class="cx">     finish();
</span><span class="cx"> 
</span><span class="cx">     for (auto objectStore : m_versionChangeAddedObjectStores)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryBackingStoreTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx"> 
</span><span class="cx">     void addNewIndex(MemoryIndex&amp;);
</span><span class="cx">     void addExistingIndex(MemoryIndex&amp;);
</span><ins>+    void indexDeleted(std::unique_ptr&lt;MemoryIndex&gt;);
</ins><span class="cx"> 
</span><span class="cx">     void abort();
</span><span class="cx">     void commit();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -201,6 +201,21 @@
</span><span class="cx">     return objectStore-&gt;createIndex(*rawTransaction, info);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IDBError MemoryIDBBackingStore::deleteIndex(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const String&amp; indexName)
+{
+    LOG(IndexedDB, &quot;MemoryIDBBackingStore::deleteIndex&quot;);
+
+    auto rawTransaction = m_transactions.get(transactionIdentifier);
+    ASSERT(rawTransaction);
+    ASSERT(rawTransaction-&gt;isVersionChange());
+
+    auto* objectStore = m_objectStoresByIdentifier.get(objectStoreIdentifier);
+    if (!objectStore)
+        return IDBError(IDBExceptionCode::ConstraintError);
+
+    return objectStore-&gt;deleteIndex(*rawTransaction, indexName);
+}
+
</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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -56,6 +56,7 @@
</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><span class="cx">     virtual IDBError createIndex(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBIndexInfo&amp;) override final;
</span><ins>+    virtual IDBError deleteIndex(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const String&amp; indexName) 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 addRecord(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="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -93,6 +93,14 @@
</span><span class="cx">     ASSERT(m_cleanCursors.isEmpty());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void MemoryIndex::clearIndexValueStore()
+{
+    ASSERT(m_objectStore.writeTransaction());
+    ASSERT(m_objectStore.writeTransaction()-&gt;isAborting());
+
+    m_records = nullptr;
+}
+
</ins><span class="cx"> void MemoryIndex::replaceIndexValueStore(std::unique_ptr&lt;IndexValueStore&gt;&amp;&amp; valueStore)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_objectStore.writeTransaction());
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIndexh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -71,6 +71,7 @@
</span><span class="cx">     void removeRecord(const IDBKeyData&amp;, const IndexKey&amp;);
</span><span class="cx"> 
</span><span class="cx">     void objectStoreCleared();
</span><ins>+    void clearIndexValueStore();
</ins><span class="cx">     void replaceIndexValueStore(std::unique_ptr&lt;IndexValueStore&gt;&amp;&amp;);
</span><span class="cx"> 
</span><span class="cx">     MemoryIndexCursor* maybeOpenCursor(const IDBCursorInfo&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -102,6 +102,59 @@
</span><span class="cx">     return { };
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void MemoryObjectStore::maybeRestoreDeletedIndex(std::unique_ptr&lt;MemoryIndex&gt; index)
+{
+    LOG(IndexedDB, &quot;MemoryObjectStore::maybeRestoreDeletedIndex&quot;);
+
+    ASSERT(index);
+
+    if (m_info.hasIndex(index-&gt;info().name()))
+        return;
+
+    m_info.addExistingIndex(index-&gt;info());
+
+    ASSERT(!m_indexesByIdentifier.contains(index-&gt;info().identifier()));
+    index-&gt;clearIndexValueStore();
+    auto error = populateIndexWithExistingRecords(*index);
+
+    // Since this index was installed in the object store before this transaction started,
+    // assuming things were in a valid state then, we should definitely be able to successfully
+    // repopulate the index with the object store's pre-transaction records.
+    ASSERT_UNUSED(error, error.isNull());
+
+    registerIndex(WTF::move(index));
+}
+
+std::unique_ptr&lt;MemoryIndex&gt; MemoryObjectStore::takeIndexByName(const String&amp; name)
+{
+    auto rawIndex = m_indexesByName.take(name);
+    if (!rawIndex)
+        return nullptr;
+
+    auto index = m_indexesByIdentifier.take(rawIndex-&gt;info().identifier());
+    ASSERT(index);
+
+    return index;
+}
+
+IDBError MemoryObjectStore::deleteIndex(MemoryBackingStoreTransaction&amp; transaction, const String&amp; indexName)
+{
+    LOG(IndexedDB, &quot;MemoryObjectStore::deleteIndex&quot;);
+
+    if (!m_writeTransaction || !m_writeTransaction-&gt;isVersionChange() || m_writeTransaction != &amp;transaction)
+        return IDBError(IDBExceptionCode::ConstraintError);
+    
+    auto index = takeIndexByName(indexName);
+    ASSERT(index);
+    if (!index)
+        return IDBError(IDBExceptionCode::ConstraintError);
+
+    m_info.deleteIndex(indexName);
+    transaction.indexDeleted(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></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryObjectStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -66,6 +66,8 @@
</span><span class="cx">     MemoryBackingStoreTransaction* writeTransaction() { return m_writeTransaction; }
</span><span class="cx"> 
</span><span class="cx">     IDBError createIndex(MemoryBackingStoreTransaction&amp;, const IDBIndexInfo&amp;);
</span><ins>+    IDBError deleteIndex(MemoryBackingStoreTransaction&amp;, const String&amp; indexName);
+    void registerIndex(std::unique_ptr&lt;MemoryIndex&gt;&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx">     bool containsRecord(const IDBKeyData&amp;);
</span><span class="cx">     void deleteRecord(const IDBKeyData&amp;);
</span><span class="lines">@@ -91,6 +93,8 @@
</span><span class="cx"> 
</span><span class="cx">     MemoryIndex* indexForIdentifier(uint64_t);
</span><span class="cx"> 
</span><ins>+    void maybeRestoreDeletedIndex(std::unique_ptr&lt;MemoryIndex&gt;);
+
</ins><span class="cx"> private:
</span><span class="cx">     MemoryObjectStore(const IDBObjectStoreInfo&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -103,6 +107,8 @@
</span><span class="cx">     void updateCursorsForPutRecord(std::set&lt;IDBKeyData&gt;::iterator);
</span><span class="cx">     void updateCursorsForDeleteRecord(const IDBKeyData&amp;);
</span><span class="cx"> 
</span><ins>+    std::unique_ptr&lt;MemoryIndex&gt; takeIndexByName(const String&amp; name);
+
</ins><span class="cx">     IDBObjectStoreInfo m_info;
</span><span class="cx"> 
</span><span class="cx">     MemoryBackingStoreTransaction* m_writeTransaction { nullptr };
</span><span class="lines">@@ -111,7 +117,6 @@
</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><span class="cx"> 
</span><del>-    void registerIndex(std::unique_ptr&lt;MemoryIndex&gt;&amp;&amp;);
</del><span class="cx">     void unregisterIndex(MemoryIndex&amp;);
</span><span class="cx">     HashMap&lt;uint64_t, std::unique_ptr&lt;MemoryIndex&gt;&gt; m_indexesByIdentifier;
</span><span class="cx">     HashMap&lt;String, MemoryIndex*&gt; m_indexesByName;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -373,6 +373,41 @@
</span><span class="cx">     performErrorCallback(callbackIdentifier, error);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UniqueIDBDatabase::deleteIndex(UniqueIDBDatabaseTransaction&amp; transaction, uint64_t objectStoreIdentifier, const String&amp; indexName, ErrorCallback callback)
+{
+    ASSERT(isMainThread());
+    LOG(IndexedDB, &quot;(main) UniqueIDBDatabase::deleteIndex&quot;);
+
+    uint64_t callbackID = storeCallback(callback);
+    m_server.postDatabaseTask(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::performDeleteIndex, callbackID, transaction.info().identifier(), objectStoreIdentifier, indexName));
+}
+
+void UniqueIDBDatabase::performDeleteIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const String&amp; indexName)
+{
+    ASSERT(!isMainThread());
+    LOG(IndexedDB, &quot;(db) UniqueIDBDatabase::performDeleteIndex&quot;);
+
+    ASSERT(m_backingStore);
+    m_backingStore-&gt;deleteIndex(transactionIdentifier, objectStoreIdentifier, indexName);
+
+    IDBError error;
+    m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::didPerformDeleteIndex, callbackIdentifier, error, objectStoreIdentifier, indexName));
+}
+
+void UniqueIDBDatabase::didPerformDeleteIndex(uint64_t callbackIdentifier, const IDBError&amp; error, uint64_t objectStoreIdentifier, const String&amp; indexName)
+{
+    ASSERT(isMainThread());
+    LOG(IndexedDB, &quot;(main) UniqueIDBDatabase::didPerformDeleteIndex&quot;);
+
+    if (error.isNull()) {
+        auto* objectStoreInfo = m_databaseInfo-&gt;infoForExistingObjectStore(objectStoreIdentifier);
+        if (objectStoreInfo)
+            objectStoreInfo-&gt;deleteIndex(indexName);
+    }
+
+    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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -79,6 +79,7 @@
</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><span class="cx">     void createIndex(UniqueIDBDatabaseTransaction&amp;, const IDBIndexInfo&amp;, ErrorCallback);
</span><ins>+    void deleteIndex(UniqueIDBDatabaseTransaction&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName, 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;, GetResultCallback);
</span><span class="cx">     void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;, CountCallback);
</span><span class="lines">@@ -114,6 +115,7 @@
</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><span class="cx">     void performCreateIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, const IDBIndexInfo&amp;);
</span><ins>+    void performDeleteIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const String&amp; indexName);
</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 performGetIndexRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;);
</span><span class="lines">@@ -129,6 +131,7 @@
</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><span class="cx">     void didPerformCreateIndex(uint64_t callbackIdentifier, const IDBError&amp;, const IDBIndexInfo&amp;);
</span><ins>+    void didPerformDeleteIndex(uint64_t callbackIdentifier, const IDBError&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName);
</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 IDBGetResult&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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -160,6 +160,13 @@
</span><span class="cx">     m_connectionToClient.didCreateIndex(resultData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UniqueIDBDatabaseConnection::didDeleteIndex(const IDBResultData&amp; resultData)
+{
+    LOG(IndexedDB, &quot;UniqueIDBDatabaseConnection::didDeleteIndex&quot;);
+
+    m_connectionToClient.didDeleteIndex(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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -70,6 +70,7 @@
</span><span class="cx">     void didDeleteObjectStore(const IDBResultData&amp;);
</span><span class="cx">     void didClearObjectStore(const IDBResultData&amp;);
</span><span class="cx">     void didCreateIndex(const IDBResultData&amp;);
</span><ins>+    void didDeleteIndex(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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -163,6 +163,23 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UniqueIDBDatabaseTransaction::deleteIndex(const IDBRequestData&amp; requestData, uint64_t objectStoreIdentifier, const String&amp; indexName)
+{
+    LOG(IndexedDB, &quot;UniqueIDBDatabaseTransaction::deleteIndex&quot;);
+
+    ASSERT(isVersionChange());
+    ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
+
+    RefPtr&lt;UniqueIDBDatabaseTransaction&gt; self(this);
+    m_databaseConnection-&gt;database().deleteIndex(*this, objectStoreIdentifier, indexName, [this, self, requestData](const IDBError&amp; error) {
+        LOG(IndexedDB, &quot;UniqueIDBDatabaseTransaction::createIndex (callback)&quot;);
+        if (error.isNull())
+            m_databaseConnection-&gt;didDeleteIndex(IDBResultData::deleteIndexSuccess(requestData.requestIdentifier()));
+        else
+            m_databaseConnection-&gt;didDeleteIndex(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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -70,6 +70,7 @@
</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><span class="cx">     void createIndex(const IDBRequestData&amp;, const IDBIndexInfo&amp;);
</span><ins>+    void deleteIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName);
</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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -135,6 +135,17 @@
</span><span class="cx">     m_objectStoreMap.remove(info-&gt;identifier());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#ifndef NDEBUG
+String IDBDatabaseInfo::loggingString() const
+{
+    String top = makeString(&quot;Database: &quot;, m_name, &quot; version &quot;, String::number(m_version), &quot;\n&quot;);
+    for (auto objectStore : m_objectStoreMap.values())
+        top.append(makeString(objectStore.loggingString(1), &quot;\n&quot;));
+
+    return top; 
+}
+#endif
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBDatabaseInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -58,6 +58,10 @@
</span><span class="cx"> 
</span><span class="cx">     void deleteObjectStore(const String&amp; objectStoreName);
</span><span class="cx"> 
</span><ins>+#ifndef NDEBUG
+    String loggingString() const;
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     IDBDatabaseInfo();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBIndexInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.cpp (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.cpp        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.cpp        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -49,6 +49,17 @@
</span><span class="cx">     return { m_identifier, m_objectStoreIdentifier, m_name.isolatedCopy(), m_keyPath.isolatedCopy(), m_unique, m_multiEntry };
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#ifndef NDEBUG
+String IDBIndexInfo::loggingString(int indent) const
+{
+    String indentString;
+    for (int i = 0; i &lt; indent; ++i)
+        indentString.append(&quot; &quot;);
+
+    return makeString(indentString, &quot;Index: &quot;, m_name, String::format(&quot; (%&quot; PRIu64 &quot;) \n&quot;, m_identifier));
+}
+#endif
+
</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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -47,6 +47,10 @@
</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><ins>+#ifndef NDEBUG
+    String loggingString(int indent = 0) const;
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     uint64_t m_identifier { 0 };
</span><span class="cx">     uint64_t m_objectStoreIdentifier { 0 };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBObjectStoreInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -69,6 +69,11 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool IDBObjectStoreInfo::hasIndex(uint64_t indexIdentifier) const
+{
+    return m_indexMap.contains(indexIdentifier);
+}
+
</ins><span class="cx"> IDBIndexInfo* IDBObjectStoreInfo::infoForExistingIndex(const String&amp; name)
</span><span class="cx"> {
</span><span class="cx">     for (auto&amp; index : m_indexMap.values()) {
</span><span class="lines">@@ -99,6 +104,30 @@
</span><span class="cx">     return names;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBObjectStoreInfo::deleteIndex(const String&amp; indexName)
+{
+    auto* info = infoForExistingIndex(indexName);
+    if (!info)
+        return;
+
+    m_indexMap.remove(info-&gt;identifier());
+}
+
+#ifndef NDEBUG
+String IDBObjectStoreInfo::loggingString(int indent) const
+{
+    String indentString;
+    for (int i = 0; i &lt; indent; ++i)
+        indentString.append(&quot; &quot;);
+
+    String top = makeString(indentString, &quot;Object store: &quot;, m_name, String::format(&quot; (%&quot; PRIu64 &quot;) \n&quot;, m_identifier));
+    for (auto index : m_indexMap.values())
+        top.append(makeString(index.loggingString(indent + 1), &quot;\n&quot;));
+
+    return top; 
+}
+#endif
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBObjectStoreInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -52,10 +52,17 @@
</span><span class="cx">     IDBIndexInfo createNewIndex(const String&amp; name, const IDBKeyPath&amp;, bool unique, bool multiEntry);
</span><span class="cx">     void addExistingIndex(const IDBIndexInfo&amp;);
</span><span class="cx">     bool hasIndex(const String&amp; name) const;
</span><ins>+    bool hasIndex(uint64_t indexIdentifier) const;
</ins><span class="cx">     IDBIndexInfo* infoForExistingIndex(const String&amp; name);
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;String&gt; indexNames() const;
</span><span class="cx"> 
</span><ins>+    void deleteIndex(const String&amp; indexName);
+
+#ifndef NDEBUG
+    String loggingString(int indent = 0) const;
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     uint64_t m_identifier { 0 };
</span><span class="cx">     String m_name;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBResultDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -110,6 +110,11 @@
</span><span class="cx">     return { IDBResultType::CreateIndexSuccess, requestIdentifier };
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IDBResultData IDBResultData::deleteIndexSuccess(const IDBResourceIdentifier&amp; requestIdentifier)
+{
+    return { IDBResultType::DeleteIndexSuccess, 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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx">     GetCountSuccess,
</span><span class="cx">     DeleteRecordSuccess,
</span><span class="cx">     CreateIndexSuccess,
</span><ins>+    DeleteIndexSuccess,
</ins><span class="cx">     OpenCursorSuccess,
</span><span class="cx">     IterateCursorSuccess,
</span><span class="cx"> };
</span><span class="lines">@@ -71,6 +72,7 @@
</span><span class="cx">     static IDBResultData deleteObjectStoreSuccess(const IDBResourceIdentifier&amp;);
</span><span class="cx">     static IDBResultData clearObjectStoreSuccess(const IDBResourceIdentifier&amp;);
</span><span class="cx">     static IDBResultData createIndexSuccess(const IDBResourceIdentifier&amp;);
</span><ins>+    static IDBResultData deleteIndexSuccess(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 IDBGetResult&amp;);
</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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -152,6 +152,14 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InProcessIDBServer::didDeleteIndex(const IDBResultData&amp; resultData)
+{
+    RefPtr&lt;InProcessIDBServer&gt; self(this);
+    RunLoop::current().dispatch([this, self, resultData] {
+        m_connectionToServer-&gt;didDeleteIndex(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">@@ -240,14 +248,22 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InProcessIDBServer::createIndex(const IDBRequestData&amp; resultData, const IDBIndexInfo&amp; info)
</del><ins>+void InProcessIDBServer::createIndex(const IDBRequestData&amp; requestData, const IDBIndexInfo&amp; info)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;InProcessIDBServer&gt; self(this);
</span><del>-    RunLoop::current().dispatch([this, self, resultData, info] {
-        m_server-&gt;createIndex(resultData, info);
</del><ins>+    RunLoop::current().dispatch([this, self, requestData, info] {
+        m_server-&gt;createIndex(requestData, info);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InProcessIDBServer::deleteIndex(const IDBRequestData&amp; requestData, uint64_t objectStoreIdentifier, const String&amp; indexName)
+{
+    RefPtr&lt;InProcessIDBServer&gt; self(this);
+    RunLoop::current().dispatch([this, self, requestData, objectStoreIdentifier, indexName] {
+        m_server-&gt;deleteIndex(requestData, objectStoreIdentifier, indexName);
+    });
+}
+
</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 (192644 => 192645)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h        2015-11-19 19:55:46 UTC (rev 192644)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h        2015-11-19 19:57:18 UTC (rev 192645)
</span><span class="lines">@@ -62,6 +62,7 @@
</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><span class="cx">     virtual void createIndex(const IDBRequestData&amp;, const IDBIndexInfo&amp;) override final;
</span><ins>+    virtual void deleteIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName) 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">@@ -81,6 +82,7 @@
</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><span class="cx">     virtual void didCreateIndex(const IDBResultData&amp;) override final;
</span><ins>+    virtual void didDeleteIndex(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>
</div>

</body>
</html>