<!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>[207761] 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/207761">207761</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-10-24 09:24:09 -0700 (Mon, 24 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>IndexedDB 2.0: Support IDBIndex name assignment.
&lt;rdar://problem/28806932&gt; and https://bugs.webkit.org/show_bug.cgi?id=163805

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/IndexedDB/idbindex-rename-errors-expected.txt:
* web-platform-tests/IndexedDB/idbindex-rename-expected.txt:

Source/WebCore:

Tests: storage/indexeddb/modern/index-rename-1-private.html
       storage/indexeddb/modern/index-rename-1.html

Touches a *lot* of code sites, but none of them are particularly interesting.
They are all just getting the new name spread out to all of the various objects that need it.

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::renameIndex):
* Modules/indexeddb/IDBDatabase.h:

* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::IDBIndex):
(WebCore::IDBIndex::setName):
(WebCore::IDBIndex::rollbackInfoForVersionChangeAbort):
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBIndex.idl:

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
(WebCore::IDBObjectStore::renameReferencedIndex):
(WebCore::IDBObjectStore::rollbackInfoForVersionChangeAbort): Deleted.
* Modules/indexeddb/IDBObjectStore.h:

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::internalAbort):
(WebCore::IDBTransaction::renameIndex):
(WebCore::IDBTransaction::renameIndexOnServer):
(WebCore::IDBTransaction::didRenameIndexOnServer):
* Modules/indexeddb/IDBTransaction.h:

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

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::renameIndex):
(WebCore::IDBClient::IDBConnectionToServer::didRenameIndex):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:

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

* Modules/indexeddb/server/IDBBackingStore.h:

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

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

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

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

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

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

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

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
(WebCore::IDBServer::UniqueIDBDatabase::performRenameIndex):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameIndex):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

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

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

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

* Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
(WebCore::IDBObjectStoreInfo::infoForExistingIndex):
* Modules/indexeddb/shared/IDBObjectStoreInfo.h:

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

* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::didRenameIndex):
(WebCore::InProcessIDBServer::renameIndex):
* Modules/indexeddb/shared/InProcessIDBServer.h:

Source/WebKit2:

* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::didRenameIndex):
(WebKit::WebIDBConnectionToClient::renameIndex):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::renameIndex):
(WebKit::WebIDBConnectionToServer::didRenameIndex):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:

LayoutTests:

* storage/indexeddb/modern/index-rename-1-expected.txt: Added.
* storage/indexeddb/modern/index-rename-1-private-expected.txt: Added.
* storage/indexeddb/modern/index-rename-1-private.html: Added.
* storage/indexeddb/modern/index-rename-1.html: Added.
* storage/indexeddb/modern/resources/index-rename-1.js: Added.

* storage/indexeddb/readonly-expected.txt:
* storage/indexeddb/readonly-private-expected.txt:
* storage/indexeddb/resources/readonly.js: Removed the test that verifies that index names are
  readonly as they are no longer readonly.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsIndexedDBidbindexrenameerrorsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex-rename-errors-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsIndexedDBidbindexrenameexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex-rename-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbreadonlyexpectedtxt">trunk/LayoutTests/storage/indexeddb/readonly-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbreadonlyprivateexpectedtxt">trunk/LayoutTests/storage/indexeddb/readonly-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcesreadonlyjs">trunk/LayoutTests/storage/indexeddb/resources/readonly.js</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBDatabaseh">trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBIndexcpp">trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBIndexh">trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBIndexidl">trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStoreh">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactioncpp">trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactionh">trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxycpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxyh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerDelegateh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h</a></li>
<li><a href="#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="#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="#trunkSourceWebCoreModulesindexeddbserverSQLiteIDBBackingStorecpp">trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverSQLiteIDBBackingStoreh">trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h</a></li>
<li><a href="#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="#trunkSourceWebCoreModulesindexeddbsharedIDBIndexInfoh">trunk/Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBObjectStoreInfocpp">trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBObjectStoreInfoh">trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBResultDatacpp">trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBResultDatah">trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServercpp">trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServerh">trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClientcpp">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClienth">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClientmessagesin">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServercpp">trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServerh">trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServermessagesin">trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernindexrename1expectedtxt">trunk/LayoutTests/storage/indexeddb/modern/index-rename-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernindexrename1privateexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/index-rename-1-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernindexrename1privatehtml">trunk/LayoutTests/storage/indexeddb/modern/index-rename-1-private.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernindexrename1html">trunk/LayoutTests/storage/indexeddb/modern/index-rename-1.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernresourcesindexrename1js">trunk/LayoutTests/storage/indexeddb/modern/resources/index-rename-1.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/LayoutTests/ChangeLog        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2016-10-24  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        IndexedDB 2.0: Support IDBIndex name assignment.
+        &lt;rdar://problem/28806932&gt; and https://bugs.webkit.org/show_bug.cgi?id=163805
+
+        Reviewed by Alex Christensen.
+
+        * storage/indexeddb/modern/index-rename-1-expected.txt: Added.
+        * storage/indexeddb/modern/index-rename-1-private-expected.txt: Added.
+        * storage/indexeddb/modern/index-rename-1-private.html: Added.
+        * storage/indexeddb/modern/index-rename-1.html: Added.
+        * storage/indexeddb/modern/resources/index-rename-1.js: Added.
+
+        * storage/indexeddb/readonly-expected.txt:
+        * storage/indexeddb/readonly-private-expected.txt:
+        * storage/indexeddb/resources/readonly.js: Removed the test that verifies that index names are
+          readonly as they are no longer readonly.
+
</ins><span class="cx"> 2016-10-24  Dave Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSS Parser] Unprefix -webkit-writing-mode
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-10-24  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        IndexedDB 2.0: Support IDBIndex name assignment.
+        &lt;rdar://problem/28806932&gt; and https://bugs.webkit.org/show_bug.cgi?id=163805
+
+        Reviewed by Alex Christensen.
+
+        * web-platform-tests/IndexedDB/idbindex-rename-errors-expected.txt:
+        * web-platform-tests/IndexedDB/idbindex-rename-expected.txt:
+
</ins><span class="cx"> 2016-10-22  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Upgrading custom element should enqueue attributeChanged and connected callbacks
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsIndexedDBidbindexrenameerrorsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex-rename-errors-expected.txt (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex-rename-errors-expected.txt        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex-rename-errors-expected.txt        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -1,10 +1,8 @@
</span><span class="cx"> 
</span><del>-FAIL IndexedDB deleted index rename throws assert_throws: function &quot;() =&gt; index.name = 'renamed_by_author'&quot; did not throw
-FAIL IndexedDB index rename throws in a readonly transaction assert_throws: function &quot;() =&gt; index.name = 'renamed_by_author'&quot; did not throw
-FAIL IndexedDB index rename throws in a readwrite transaction assert_throws: function &quot;() =&gt; index.name = 'renamed_by_author'&quot; did not throw
-FAIL IndexedDB index rename throws in an inactive transaction assert_throws: function &quot;() =&gt; authorIndex.name = 'renamed_by_author'&quot; did not throw
-FAIL IndexedDB index rename to the name of another index throws assert_throws: function &quot;() =&gt; index.name = 'by_title'&quot; did not throw
-FAIL IndexedDB index rename handles exceptions when stringifying names assert_throws: IDBObjectStore rename should re-raise toString() exception function &quot;() =&gt; {
-              index.name = {
-                toSt...&quot; did not throw
</del><ins>+PASS IndexedDB deleted index rename throws 
+PASS IndexedDB index rename throws in a readonly transaction 
+PASS IndexedDB index rename throws in a readwrite transaction 
+FAIL IndexedDB index rename throws in an inactive transaction assert_throws: function &quot;() =&gt; authorIndex.name = 'renamed_by_author'&quot; threw object &quot;InvalidStateError (DOM Exception 11): Failed set property...&quot; that is not a DOMException TransactionInactiveError: property &quot;code&quot; is equal to 11, expected 0
+FAIL IndexedDB index rename to the name of another index throws assert_throws: function &quot;() =&gt; index.name = 'by_title'&quot; threw object &quot;InvalidStateError (DOM Exception 11): Failed set property...&quot; that is not a DOMException ConstraintError: property &quot;code&quot; is equal to 11, expected 0
+PASS IndexedDB index rename handles exceptions when stringifying names 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsIndexedDBidbindexrenameexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex-rename-expected.txt (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex-rename-expected.txt        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex-rename-expected.txt        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -1,11 +1,11 @@
</span><span class="cx"> 
</span><del>-FAIL IndexedDB index rename in new transaction assert_equals: IDBIndex name should change immediately after a rename expected &quot;renamed_by_author&quot; but got &quot;by_author&quot;
-FAIL IndexedDB index rename in the transaction where it is created assert_equals: IDBIndex name should change immediately after a rename expected &quot;renamed_by_author&quot; but got &quot;by_author&quot;
</del><ins>+PASS IndexedDB index rename in new transaction 
+PASS IndexedDB index rename in the transaction where it is created 
</ins><span class="cx"> PASS IndexedDB index rename to the same name succeeds 
</span><del>-FAIL IndexedDB index rename to the name of a deleted index succeeds assert_array_equals: IDBObjectStore.indexNames should immediately reflect the rename property 0, expected &quot;by_title&quot; but got &quot;by_author&quot;
-FAIL IndexedDB index swapping via renames succeeds Failed to execute 'index' on 'IDBObjectStore': The specified index was not found.
-FAIL IndexedDB index rename stringifies non-string names assert_equals: IDBIndex name should change immediately after a rename to a number expected &quot;42&quot; but got &quot;by_author&quot;
-FAIL IndexedDB index can be renamed to &quot;&quot; assert_equals: IDBIndex name should change immediately after the rename expected &quot;&quot; but got &quot;by_author&quot;
-FAIL IndexedDB index can be renamed to &quot;\u0000&quot; assert_equals: IDBIndex name should change immediately after the rename expected &quot;\0&quot; but got &quot;by_author&quot;
-FAIL IndexedDB index can be renamed to &quot;\uDC00\uD800&quot; assert_equals: IDBIndex name should change immediately after the rename expected &quot;í°€í €&quot; but got &quot;by_author&quot;
</del><ins>+PASS IndexedDB index rename to the name of a deleted index succeeds 
+PASS IndexedDB index swapping via renames succeeds 
+PASS IndexedDB index rename stringifies non-string names 
+PASS IndexedDB index can be renamed to &quot;&quot; 
+PASS IndexedDB index can be renamed to &quot;\u0000&quot; 
+PASS IndexedDB index can be renamed to &quot;\uDC00\uD800&quot; 
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernindexrename1expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/index-rename-1-expected.txt (0 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/index-rename-1-expected.txt                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/index-rename-1-expected.txt        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+This tests expectations with renaming existing indexes.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
+
+indexedDB.deleteDatabase(dbname)
+indexedDB.open(dbname)
+Initial upgrade needed: Old version - 0 New version - 1
+Failed to rename deleted index: InvalidStateError (DOM Exception 11): Failed set property 'name' on 'IDBIndex': The index has been deleted.
+Initial index name: NewIndex
+Caught exception renaming index to the name of another existing index: InvalidStateError (DOM Exception 11): Failed set property 'name' on 'IDBIndex': The owning object store already has an index named 'ExistingIndex'.
+Renamed this index to the same name it already has, it's name is now: NewIndex
+Renamed index name: RenamedIndex
+Current index name in a new transaction: RenamedIndex
+Caught exception renaming index outside of a version change transaction: InvalidStateError (DOM Exception 11): Failed set property 'name' on 'IDBIndex': The index's transaction is not a version change transaction.
+Current indexNames during second upgrade transaction includes 'ExistingIndex': true
+Current indexNames during second upgrade transaction includes 'RenamedIndex': true
+Current indexNames during second upgrade transaction includes 'AnotherName': false
+Current indexNames during second upgrade transaction includes 'YetAnotherName': false
+Renamed index to: AnotherName
+Current indexNames during second upgrade transaction includes 'ExistingIndex': true
+Current indexNames during second upgrade transaction includes 'RenamedIndex': false
+Current indexNames during second upgrade transaction includes 'AnotherName': true
+Current indexNames during second upgrade transaction includes 'YetAnotherName': false
+Renamed index again to: YetAnotherName
+Current indexNames during second upgrade transaction includes 'ExistingIndex': true
+Current indexNames during second upgrade transaction includes 'RenamedIndex': false
+Current indexNames during second upgrade transaction includes 'AnotherName': false
+Current indexNames during second upgrade transaction includes 'YetAnotherName': true
+Aborting version change transaction...
+Current indexNames during second upgrade transaction includes 'ExistingIndex': true
+Current indexNames during second upgrade transaction includes 'RenamedIndex': true
+Current indexNames during second upgrade transaction includes 'AnotherName': false
+Current indexNames during second upgrade transaction includes 'YetAnotherName': false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernindexrename1privateexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/index-rename-1-private-expected.txt (0 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/index-rename-1-private-expected.txt                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/index-rename-1-private-expected.txt        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+This tests expectations with renaming existing indexes.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
+
+indexedDB.deleteDatabase(dbname)
+indexedDB.open(dbname)
+Initial upgrade needed: Old version - 0 New version - 1
+Failed to rename deleted index: InvalidStateError (DOM Exception 11): Failed set property 'name' on 'IDBIndex': The index has been deleted.
+Initial index name: NewIndex
+Caught exception renaming index to the name of another existing index: InvalidStateError (DOM Exception 11): Failed set property 'name' on 'IDBIndex': The owning object store already has an index named 'ExistingIndex'.
+Renamed this index to the same name it already has, it's name is now: NewIndex
+Renamed index name: RenamedIndex
+Current index name in a new transaction: RenamedIndex
+Caught exception renaming index outside of a version change transaction: InvalidStateError (DOM Exception 11): Failed set property 'name' on 'IDBIndex': The index's transaction is not a version change transaction.
+Current indexNames during second upgrade transaction includes 'ExistingIndex': true
+Current indexNames during second upgrade transaction includes 'RenamedIndex': true
+Current indexNames during second upgrade transaction includes 'AnotherName': false
+Current indexNames during second upgrade transaction includes 'YetAnotherName': false
+Renamed index to: AnotherName
+Current indexNames during second upgrade transaction includes 'ExistingIndex': true
+Current indexNames during second upgrade transaction includes 'RenamedIndex': false
+Current indexNames during second upgrade transaction includes 'AnotherName': true
+Current indexNames during second upgrade transaction includes 'YetAnotherName': false
+Renamed index again to: YetAnotherName
+Current indexNames during second upgrade transaction includes 'ExistingIndex': true
+Current indexNames during second upgrade transaction includes 'RenamedIndex': false
+Current indexNames during second upgrade transaction includes 'AnotherName': false
+Current indexNames during second upgrade transaction includes 'YetAnotherName': true
+Aborting version change transaction...
+Current indexNames during second upgrade transaction includes 'ExistingIndex': true
+Current indexNames during second upgrade transaction includes 'RenamedIndex': true
+Current indexNames during second upgrade transaction includes 'AnotherName': false
+Current indexNames during second upgrade transaction includes 'YetAnotherName': false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernindexrename1privatehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/index-rename-1-private.html (0 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/index-rename-1-private.html                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/index-rename-1-private.html        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+enablePrivateBrowsing = true;
+&lt;/script&gt;
+&lt;script src=&quot;../../../resources/js-test.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/shared.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/index-rename-1.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernindexrename1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/index-rename-1.html (0 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/index-rename-1.html                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/index-rename-1.html        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../../resources/js-test.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/shared.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/index-rename-1.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernresourcesindexrename1js"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/resources/index-rename-1.js (0 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/resources/index-rename-1.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/resources/index-rename-1.js        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -0,0 +1,137 @@
</span><ins>+description(&quot;This tests expectations with renaming existing indexes.&quot;);
+
+indexedDBTest(prepareDatabase);
+
+function log(message)
+{
+    debug(message);
+}
+
+var testGenerator;
+function next()
+{
+    testGenerator.next();
+}
+
+function asyncNext()
+{
+    setTimeout(&quot;testGenerator.next();&quot;, 0);
+}
+
+var db;
+var dbName;
+var dbVersion;
+
+function prepareDatabase(event)
+{
+    log(&quot;Initial upgrade needed: Old version - &quot; + event.oldVersion + &quot; New version - &quot; + event.newVersion);
+
+    db = event.target.result;
+        dbName = db.name;
+        dbVersion = db.version;
+
+        objectStore = db.createObjectStore(&quot;ObjectStore&quot;);
+
+        objectStore.createIndex(&quot;ExistingIndex&quot;, &quot;foo&quot;);
+        
+        indexToDelete = objectStore.createIndex(&quot;IndexToDelete&quot;, &quot;bar&quot;);
+        objectStore.deleteIndex(&quot;IndexToDelete&quot;);
+        try {
+                indexToDelete.name = &quot;RenamedIndex&quot;;
+                log(&quot;Was incorrectly able to rename a deleted index&quot;);
+        } catch (e) {
+                log(&quot;Failed to rename deleted index: &quot; + e)
+        }
+        
+        newIndex = objectStore.createIndex(&quot;NewIndex&quot;, &quot;bar&quot;);
+        
+        log(&quot;Initial index name: &quot; + newIndex.name);
+        
+        try {
+                newIndex.name = &quot;ExistingIndex&quot;;
+                log(&quot;Was incorrectly able to rename this index to the name of another existing index&quot;);
+        } catch(e) {
+                log(&quot;Caught exception renaming index to the name of another existing index: &quot; + e);
+        }
+
+        newIndex.name = newIndex.name;
+        log(&quot;Renamed this index to the same name it already has, it's name is now: &quot; + newIndex.name);
+
+        newIndex.name = &quot;RenamedIndex&quot;;
+        log(&quot;Renamed index name: &quot; + newIndex.name);
+
+    event.target.onsuccess = function() {
+        testGenerator = testSteps();
+        testGenerator.next();
+    };
+}
+
+function* testSteps()
+{    
+    tx = db.transaction(&quot;ObjectStore&quot;, &quot;readwrite&quot;);
+    tx.oncomplete = next;
+    objectStore = tx.objectStore(&quot;ObjectStore&quot;);
+        index = objectStore.index(&quot;RenamedIndex&quot;);
+    log(&quot;Current index name in a new transaction: &quot; + index.name);
+
+        try {
+                index.name = &quot;newName&quot;;
+                log(&quot;Was incorrectly able to rename this index outside of a version change transaction&quot;);
+        } catch(e) {
+                log(&quot;Caught exception renaming index outside of a version change transaction: &quot; + e);
+        }
+    
+    yield; // For the transaction's completion.
+
+        db.close();
+    
+        upgradeOpenRequest = indexedDB.open(dbName, dbVersion + 1);
+        upgradeOpenRequest.onerror = next;
+        upgradeOpenRequest.onupgradeneeded = function(event) {
+                objectStore = event.target.transaction.objectStore(&quot;ObjectStore&quot;);
+                
+                log(&quot;Current indexNames during second upgrade transaction includes 'ExistingIndex': &quot; + objectStore.indexNames.contains(&quot;ExistingIndex&quot;));
+                log(&quot;Current indexNames during second upgrade transaction includes 'RenamedIndex': &quot; + objectStore.indexNames.contains(&quot;RenamedIndex&quot;));
+                log(&quot;Current indexNames during second upgrade transaction includes 'AnotherName': &quot; + objectStore.indexNames.contains(&quot;AnotherName&quot;));
+                log(&quot;Current indexNames during second upgrade transaction includes 'YetAnotherName': &quot; + objectStore.indexNames.contains(&quot;YetAnotherName&quot;));
+
+                index = objectStore.index(&quot;RenamedIndex&quot;);
+                index.name = &quot;AnotherName&quot;;
+                log(&quot;Renamed index to: &quot; + index.name);
+                
+                log(&quot;Current indexNames during second upgrade transaction includes 'ExistingIndex': &quot; + objectStore.indexNames.contains(&quot;ExistingIndex&quot;));
+                log(&quot;Current indexNames during second upgrade transaction includes 'RenamedIndex': &quot; + objectStore.indexNames.contains(&quot;RenamedIndex&quot;));
+                log(&quot;Current indexNames during second upgrade transaction includes 'AnotherName': &quot; + objectStore.indexNames.contains(&quot;AnotherName&quot;));
+                log(&quot;Current indexNames during second upgrade transaction includes 'YetAnotherName': &quot; + objectStore.indexNames.contains(&quot;YetAnotherName&quot;));
+
+                index.name = &quot;YetAnotherName&quot;;
+                log(&quot;Renamed index again to: &quot; + index.name);
+
+                log(&quot;Current indexNames during second upgrade transaction includes 'ExistingIndex': &quot; + objectStore.indexNames.contains(&quot;ExistingIndex&quot;));
+                log(&quot;Current indexNames during second upgrade transaction includes 'RenamedIndex': &quot; + objectStore.indexNames.contains(&quot;RenamedIndex&quot;));
+                log(&quot;Current indexNames during second upgrade transaction includes 'AnotherName': &quot; + objectStore.indexNames.contains(&quot;AnotherName&quot;));
+                log(&quot;Current indexNames during second upgrade transaction includes 'YetAnotherName': &quot; + objectStore.indexNames.contains(&quot;YetAnotherName&quot;));
+
+                log(&quot;Aborting version change transaction...&quot;);
+                event.target.transaction.abort();
+        }
+
+        yield; // For the open request's failure (due to aborting the version change transaction)
+
+        upgradeOpenRequest = indexedDB.open(dbName);
+        upgradeOpenRequest.onsuccess = function(event) {
+                objectStore = event.target.result.transaction(&quot;ObjectStore&quot;).objectStore(&quot;ObjectStore&quot;);
+                
+                log(&quot;Current indexNames during second upgrade transaction includes 'ExistingIndex': &quot; + objectStore.indexNames.contains(&quot;ExistingIndex&quot;));
+                log(&quot;Current indexNames during second upgrade transaction includes 'RenamedIndex': &quot; + objectStore.indexNames.contains(&quot;RenamedIndex&quot;));
+                log(&quot;Current indexNames during second upgrade transaction includes 'AnotherName': &quot; + objectStore.indexNames.contains(&quot;AnotherName&quot;));
+                log(&quot;Current indexNames during second upgrade transaction includes 'YetAnotherName': &quot; + objectStore.indexNames.contains(&quot;YetAnotherName&quot;));
+
+                next();
+        }
+        
+        yield; // To balance the next() above.
+        
+    finishJSTest();
+ }

</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbreadonlyexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/readonly-expected.txt (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/readonly-expected.txt        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/LayoutTests/storage/indexeddb/readonly-expected.txt        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -35,9 +35,6 @@
</span><span class="cx"> cursor.primaryKey = Infinity
</span><span class="cx"> PASS cursor.primaryKey is still first
</span><span class="cx"> index = objectStore.createIndex('first', 'first');
</span><del>-trying to set readonly property index.name
-index.name = 'bar'
-PASS index.name is still first
</del><span class="cx"> trying to set readonly property index.objectStore
</span><span class="cx"> index.objectStore = this
</span><span class="cx"> PASS index.objectStore is still [object IDBObjectStore]
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbreadonlyprivateexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/readonly-private-expected.txt (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/readonly-private-expected.txt        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/LayoutTests/storage/indexeddb/readonly-private-expected.txt        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -35,9 +35,6 @@
</span><span class="cx"> cursor.primaryKey = Infinity
</span><span class="cx"> PASS cursor.primaryKey is still first
</span><span class="cx"> index = objectStore.createIndex('first', 'first');
</span><del>-trying to set readonly property index.name
-index.name = 'bar'
-PASS index.name is still first
</del><span class="cx"> trying to set readonly property index.objectStore
</span><span class="cx"> index.objectStore = this
</span><span class="cx"> PASS index.objectStore is still [object IDBObjectStore]
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcesreadonlyjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/resources/readonly.js (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/readonly.js        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/LayoutTests/storage/indexeddb/resources/readonly.js        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -63,7 +63,6 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     index = evalAndLog(&quot;index = objectStore.createIndex('first', 'first');&quot;);
</span><del>-    setReadonlyProperty(&quot;index.name&quot;, &quot;'bar'&quot;);
</del><span class="cx">     setReadonlyProperty(&quot;index.objectStore&quot;, &quot;this&quot;);
</span><span class="cx">     setReadonlyProperty(&quot;index.keyPath&quot;, &quot;'bar'&quot;);
</span><span class="cx">     setReadonlyProperty(&quot;index.unique&quot;, &quot;true&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/ChangeLog        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -1,3 +1,114 @@
</span><ins>+2016-10-24  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        IndexedDB 2.0: Support IDBIndex name assignment.
+        &lt;rdar://problem/28806932&gt; and https://bugs.webkit.org/show_bug.cgi?id=163805
+
+        Reviewed by Alex Christensen.
+
+        Tests: storage/indexeddb/modern/index-rename-1-private.html
+               storage/indexeddb/modern/index-rename-1.html
+
+        Touches a *lot* of code sites, but none of them are particularly interesting.
+        They are all just getting the new name spread out to all of the various objects that need it.
+
+        * Modules/indexeddb/IDBDatabase.cpp:
+        (WebCore::IDBDatabase::renameIndex):
+        * Modules/indexeddb/IDBDatabase.h:
+
+        * Modules/indexeddb/IDBIndex.cpp:
+        (WebCore::IDBIndex::IDBIndex):
+        (WebCore::IDBIndex::setName):
+        (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort):
+        * Modules/indexeddb/IDBIndex.h:
+        * Modules/indexeddb/IDBIndex.idl:
+
+        * Modules/indexeddb/IDBObjectStore.cpp:
+        (WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
+        (WebCore::IDBObjectStore::renameReferencedIndex):
+        (WebCore::IDBObjectStore::rollbackInfoForVersionChangeAbort): Deleted.
+        * Modules/indexeddb/IDBObjectStore.h:
+
+        * Modules/indexeddb/IDBTransaction.cpp:
+        (WebCore::IDBTransaction::internalAbort):
+        (WebCore::IDBTransaction::renameIndex):
+        (WebCore::IDBTransaction::renameIndexOnServer):
+        (WebCore::IDBTransaction::didRenameIndexOnServer):
+        * Modules/indexeddb/IDBTransaction.h:
+
+        * Modules/indexeddb/client/IDBConnectionProxy.cpp:
+        (WebCore::IDBClient::IDBConnectionProxy::renameIndex):
+        * Modules/indexeddb/client/IDBConnectionProxy.h:
+
+        * Modules/indexeddb/client/IDBConnectionToServer.cpp:
+        (WebCore::IDBClient::IDBConnectionToServer::renameIndex):
+        (WebCore::IDBClient::IDBConnectionToServer::didRenameIndex):
+        * Modules/indexeddb/client/IDBConnectionToServer.h:
+        * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
+
+        * Modules/indexeddb/client/TransactionOperation.h:
+        (WebCore::IDBClient::createTransactionOperation):
+
+        * Modules/indexeddb/server/IDBBackingStore.h:
+
+        * Modules/indexeddb/server/IDBConnectionToClient.cpp:
+        (WebCore::IDBServer::IDBConnectionToClient::didRenameIndex):
+        * Modules/indexeddb/server/IDBConnectionToClient.h:
+        * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
+
+        * Modules/indexeddb/server/IDBServer.cpp:
+        (WebCore::IDBServer::IDBServer::renameIndex):
+        * Modules/indexeddb/server/IDBServer.h:
+
+        * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::indexRenamed):
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
+        * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
+
+        * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
+        (WebCore::IDBServer::MemoryIDBBackingStore::renameIndex):
+        * Modules/indexeddb/server/MemoryIDBBackingStore.h:
+
+        * Modules/indexeddb/server/MemoryIndex.h:
+        (WebCore::IDBServer::MemoryIndex::rename):
+
+        * Modules/indexeddb/server/MemoryObjectStore.cpp:
+        (WebCore::IDBServer::MemoryObjectStore::renameIndex):
+        * Modules/indexeddb/server/MemoryObjectStore.h:
+
+        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
+        (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
+        * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
+
+        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
+        (WebCore::IDBServer::UniqueIDBDatabase::performRenameIndex):
+        (WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameIndex):
+        * Modules/indexeddb/server/UniqueIDBDatabase.h:
+
+        * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameIndex):
+        * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
+
+        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameIndex):
+        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
+
+        * Modules/indexeddb/shared/IDBIndexInfo.h:
+        (WebCore::IDBIndexInfo::rename):
+
+        * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
+        (WebCore::IDBObjectStoreInfo::infoForExistingIndex):
+        * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
+
+        * Modules/indexeddb/shared/IDBResultData.cpp:
+        (WebCore::IDBResultData::renameIndexSuccess):
+        * Modules/indexeddb/shared/IDBResultData.h:
+
+        * Modules/indexeddb/shared/InProcessIDBServer.cpp:
+        (WebCore::InProcessIDBServer::didRenameIndex):
+        (WebCore::InProcessIDBServer::renameIndex):
+        * Modules/indexeddb/shared/InProcessIDBServer.h:
+
</ins><span class="cx"> 2016-10-24  Dave Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSS Parser] Fix -webkit-box-reflect parsing
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include &quot;IDBConnectionProxy.h&quot;
</span><span class="cx"> #include &quot;IDBConnectionToServer.h&quot;
</span><span class="cx"> #include &quot;IDBDatabaseException.h&quot;
</span><ins>+#include &quot;IDBIndex.h&quot;
</ins><span class="cx"> #include &quot;IDBObjectStore.h&quot;
</span><span class="cx"> #include &quot;IDBOpenDBRequest.h&quot;
</span><span class="cx"> #include &quot;IDBResultData.h&quot;
</span><span class="lines">@@ -117,6 +118,18 @@
</span><span class="cx">     m_versionChangeTransaction-&gt;renameObjectStore(objectStore, newName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBDatabase::renameIndex(IDBIndex&amp; index, const String&amp; newName)
+{
+    ASSERT(currentThread() == originThreadID());
+    ASSERT(m_versionChangeTransaction);
+    ASSERT(m_info.hasObjectStore(index.objectStore().info().name()));
+    ASSERT(m_info.infoForExistingObjectStore(index.objectStore().info().name())-&gt;hasIndex(index.info().name()));
+
+    m_info.infoForExistingObjectStore(index.objectStore().info().name())-&gt;infoForExistingIndex(index.info().identifier())-&gt;rename(newName);
+
+    m_versionChangeTransaction-&gt;renameIndex(index, newName);
+}
+
</ins><span class="cx"> ExceptionOr&lt;Ref&lt;IDBObjectStore&gt;&gt; IDBDatabase::createObjectStore(const String&amp;, const Dictionary&amp;)
</span><span class="cx"> {
</span><span class="cx">     ASSERT_NOT_REACHED();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -63,6 +63,7 @@
</span><span class="cx">     void close();
</span><span class="cx"> 
</span><span class="cx">     void renameObjectStore(IDBObjectStore&amp;, const String&amp; newName);
</span><ins>+    void renameIndex(IDBIndex&amp;, const String&amp; newName);
</ins><span class="cx"> 
</span><span class="cx">     // EventTarget
</span><span class="cx">     EventTargetInterface eventTargetInterface() const final { return IDBDatabaseEventTargetInterfaceType; }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBIndexcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> IDBIndex::IDBIndex(ScriptExecutionContext&amp; context, const IDBIndexInfo&amp; info, IDBObjectStore&amp; objectStore)
</span><span class="cx">     : ActiveDOMObject(&amp;context)
</span><span class="cx">     , m_info(info)
</span><ins>+    , m_originalInfo(info)
</ins><span class="cx">     , m_objectStore(objectStore)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(currentThread() == m_objectStore.transaction().database().originThreadID());
</span><span class="lines">@@ -78,6 +79,34 @@
</span><span class="cx">     return m_info.name();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+ExceptionOr&lt;void&gt; IDBIndex::setName(const String&amp; name)
+{
+    ASSERT(currentThread() == m_objectStore.transaction().database().originThreadID());
+
+    if (m_deleted)
+        return Exception { INVALID_STATE_ERR, ASCIILiteral(&quot;Failed set property 'name' on 'IDBIndex': The index has been deleted.&quot;) };
+
+    if (m_objectStore.isDeleted())
+        return Exception { INVALID_STATE_ERR, ASCIILiteral(&quot;Failed set property 'name' on 'IDBIndex': The index's object store has been deleted.&quot;) };
+
+    if (!m_objectStore.transaction().isVersionChange())
+        return Exception { INVALID_STATE_ERR, ASCIILiteral(&quot;Failed set property 'name' on 'IDBIndex': The index's transaction is not a version change transaction.&quot;) };
+
+    if (!m_objectStore.transaction().isActive())
+        return Exception { INVALID_STATE_ERR, ASCIILiteral(&quot;Failed set property 'name' on 'IDBIndex': The index's transaction is not active.&quot;) };
+
+    if (m_info.name() == name)
+        return { };
+
+    if (m_objectStore.info().hasIndex(name))
+        return Exception { INVALID_STATE_ERR, makeString(&quot;Failed set property 'name' on 'IDBIndex': The owning object store already has an index named '&quot;, name, &quot;'.&quot;) };
+
+    m_objectStore.transaction().database().renameIndex(*this, name);
+    m_info.rename(name);
+
+    return { };
+}
+
</ins><span class="cx"> IDBObjectStore&amp; IDBIndex::objectStore()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(currentThread() == m_objectStore.transaction().database().originThreadID());
</span><span class="lines">@@ -102,6 +131,12 @@
</span><span class="cx">     return m_info.multiEntry();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBIndex::rollbackInfoForVersionChangeAbort()
+{
+    ASSERT(currentThread() == m_objectStore.transaction().database().originThreadID());
+    m_info = m_originalInfo;
+}
+
</ins><span class="cx"> ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; IDBIndex::openCursor(ExecState&amp; execState, IDBKeyRange* range, const String&amp; directionString)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBIndex::openCursor&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBIndexh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -48,11 +48,14 @@
</span><span class="cx">     virtual ~IDBIndex();
</span><span class="cx"> 
</span><span class="cx">     const String&amp; name() const;
</span><ins>+    ExceptionOr&lt;void&gt; setName(const String&amp;);
</ins><span class="cx">     IDBObjectStore&amp; objectStore();
</span><span class="cx">     const IDBKeyPath&amp; keyPath() const;
</span><span class="cx">     bool unique() const;
</span><span class="cx">     bool multiEntry() const;
</span><span class="cx"> 
</span><ins>+    void rollbackInfoForVersionChangeAbort();
+
</ins><span class="cx">     ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; openCursor(JSC::ExecState&amp;, IDBKeyRange*, const String&amp; direction);
</span><span class="cx">     ExceptionOr&lt;Ref&lt;IDBRequest&gt;&gt; openCursor(JSC::ExecState&amp;, JSC::JSValue key, const String&amp; direction);
</span><span class="cx"> 
</span><span class="lines">@@ -87,6 +90,7 @@
</span><span class="cx">     bool hasPendingActivity() const final;
</span><span class="cx"> 
</span><span class="cx">     IDBIndexInfo m_info;
</span><ins>+    IDBIndexInfo m_originalInfo;
</ins><span class="cx"> 
</span><span class="cx">     bool m_deleted { false };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBIndexidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx">     JSCustomMarkFunction,
</span><span class="cx">     SkipVTableValidation,
</span><span class="cx"> ] interface IDBIndex {
</span><del>-    readonly attribute DOMString name;
</del><ins>+    [SetterMayThrowException] attribute DOMString name;
</ins><span class="cx">     readonly attribute IDBObjectStore objectStore;
</span><span class="cx">     [ImplementationReturnType=IDBKeyPath] readonly attribute any keyPath;
</span><span class="cx">     readonly attribute boolean multiEntry;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -526,10 +526,14 @@
</span><span class="cx">     m_deleted = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBObjectStore::rollbackInfoForVersionChangeAbort()
</del><ins>+void IDBObjectStore::rollbackForVersionChangeAbort()
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</span><span class="cx">     m_info = m_originalInfo;
</span><ins>+
+    Locker&lt;Lock&gt; locker(m_referencedIndexLock);
+    for (auto&amp; index : m_referencedIndexes.values())
+        index-&gt;rollbackInfoForVersionChangeAbort();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void IDBObjectStore::visitReferencedIndexes(SlotVisitor&amp; visitor) const
</span><span class="lines">@@ -539,6 +543,21 @@
</span><span class="cx">         visitor.addOpaqueRoot(index.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBObjectStore::renameReferencedIndex(IDBIndex&amp; index, const String&amp; newName)
+{
+    LOG(IndexedDB, &quot;IDBObjectStore::renameReferencedIndex&quot;);
+
+    auto* indexInfo = m_info.infoForExistingIndex(index.info().identifier());
+    ASSERT(indexInfo);
+    indexInfo-&gt;rename(newName);
+
+    ASSERT(m_referencedIndexes.contains(index.info().name()));
+    ASSERT(!m_referencedIndexes.contains(newName));
+    ASSERT(m_referencedIndexes.get(index.info().name()) == &amp;index);
+
+    m_referencedIndexes.set(newName, m_referencedIndexes.take(index.info().name()));
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -93,9 +93,10 @@
</span><span class="cx"> 
</span><span class="cx">     const IDBObjectStoreInfo&amp; info() const { return m_info; }
</span><span class="cx"> 
</span><del>-    void rollbackInfoForVersionChangeAbort();
</del><ins>+    void rollbackForVersionChangeAbort();
</ins><span class="cx"> 
</span><span class="cx">     void visitReferencedIndexes(JSC::SlotVisitor&amp;) const;
</span><ins>+    void renameReferencedIndex(IDBIndex&amp;, const String&amp; newName);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     IDBObjectStore(ScriptExecutionContext&amp;, const IDBObjectStoreInfo&amp;, IDBTransaction&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -279,7 +279,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (isVersionChange()) {
</span><span class="cx">         for (auto&amp; objectStore : m_referencedObjectStores.values())
</span><del>-            objectStore-&gt;rollbackInfoForVersionChangeAbort();
</del><ins>+            objectStore-&gt;rollbackForVersionChangeAbort();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     transitionedToFinishing(IndexedDB::TransactionState::Aborting);
</span><span class="lines">@@ -677,6 +677,40 @@
</span><span class="cx">     abortDueToFailedRequest(DOMError::create(IDBDatabaseException::getErrorName(resultData.error().code()), resultData.error().message()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBTransaction::renameIndex(IDBIndex&amp; index, const String&amp; newName)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::renameIndex&quot;);
+    ASSERT(isVersionChange());
+    ASSERT(scriptExecutionContext());
+    ASSERT(currentThread() == m_database-&gt;originThreadID());
+
+    ASSERT(m_referencedObjectStores.contains(index.objectStore().info().name()));
+    ASSERT(m_referencedObjectStores.get(index.objectStore().info().name()) == &amp;index.objectStore());
+
+    index.objectStore().renameReferencedIndex(index, newName);
+
+    uint64_t objectStoreIdentifier = index.objectStore().info().identifier();
+    uint64_t indexIdentifier = index.info().identifier();
+    auto operation = IDBClient::createTransactionOperation(*this, &amp;IDBTransaction::didRenameIndexOnServer, &amp;IDBTransaction::renameIndexOnServer, objectStoreIdentifier, indexIdentifier, newName);
+    scheduleOperation(WTFMove(operation));
+}
+
+void IDBTransaction::renameIndexOnServer(IDBClient::TransactionOperation&amp; operation, const uint64_t&amp; objectStoreIdentifier, const uint64_t&amp; indexIdentifier, const String&amp; newName)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::renameIndexOnServer&quot;);
+    ASSERT(currentThread() == m_database-&gt;originThreadID());
+    ASSERT(isVersionChange());
+
+    m_database-&gt;connectionProxy().renameIndex(operation, objectStoreIdentifier, indexIdentifier, newName);
+}
+
+void IDBTransaction::didRenameIndexOnServer(const IDBResultData&amp; resultData)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::didRenameIndexOnServer&quot;);
+    ASSERT(currentThread() == m_database-&gt;originThreadID());
+    ASSERT_UNUSED(resultData, resultData.type() == IDBResultType::RenameIndexSuccess || resultData.type() == IDBResultType::Error);
+}
+
</ins><span class="cx"> Ref&lt;IDBRequest&gt; IDBTransaction::requestOpenCursor(ExecState&amp; execState, IDBObjectStore&amp; objectStore, const IDBCursorInfo&amp; info)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBTransaction::requestOpenCursor&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -115,6 +115,7 @@
</span><span class="cx">     Ref&lt;IDBObjectStore&gt; createObjectStore(const IDBObjectStoreInfo&amp;);
</span><span class="cx">     void renameObjectStore(IDBObjectStore&amp;, const String&amp; newName);
</span><span class="cx">     std::unique_ptr&lt;IDBIndex&gt; createIndex(IDBObjectStore&amp;, const IDBIndexInfo&amp;);
</span><ins>+    void renameIndex(IDBIndex&amp;, const String&amp; newName);
</ins><span class="cx"> 
</span><span class="cx">     Ref&lt;IDBRequest&gt; requestPutOrAdd(JSC::ExecState&amp;, IDBObjectStore&amp;, IDBKey*, SerializedScriptValue&amp;, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx">     Ref&lt;IDBRequest&gt; requestGetRecord(JSC::ExecState&amp;, IDBObjectStore&amp;, const IDBGetRecordData&amp;);
</span><span class="lines">@@ -178,6 +179,9 @@
</span><span class="cx">     void createIndexOnServer(IDBClient::TransactionOperation&amp;, const IDBIndexInfo&amp;);
</span><span class="cx">     void didCreateIndexOnServer(const IDBResultData&amp;);
</span><span class="cx"> 
</span><ins>+    void renameIndexOnServer(IDBClient::TransactionOperation&amp;, const uint64_t&amp; objectStoreIdentifier, const uint64_t&amp; indexIdentifier, const String&amp; newName);
+    void didRenameIndexOnServer(const IDBResultData&amp;);
+
</ins><span class="cx">     void clearObjectStoreOnServer(IDBClient::TransactionOperation&amp;, const uint64_t&amp; objectStoreIdentifier);
</span><span class="cx">     void didClearObjectStoreOnServer(IDBRequest&amp;, const IDBResultData&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -133,6 +133,14 @@
</span><span class="cx">     callConnectionOnMainThread(&amp;IDBConnectionToServer::renameObjectStore, requestData, objectStoreIdentifier, newName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBConnectionProxy::renameIndex(TransactionOperation&amp; operation, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName)
+{
+    const IDBRequestData requestData(operation);
+    saveOperation(operation);
+
+    callConnectionOnMainThread(&amp;IDBConnectionToServer::renameIndex, requestData, objectStoreIdentifier, indexIdentifier, newName);
+}
+
</ins><span class="cx"> void IDBConnectionProxy::deleteObjectStore(TransactionOperation&amp; operation, const String&amp; objectStoreName)
</span><span class="cx"> {
</span><span class="cx">     const IDBRequestData requestData(operation);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -78,6 +78,7 @@
</span><span class="cx">     void openCursor(TransactionOperation&amp;, const IDBCursorInfo&amp;);
</span><span class="cx">     void iterateCursor(TransactionOperation&amp;, const IDBKeyData&amp;, unsigned long count);
</span><span class="cx">     void renameObjectStore(TransactionOperation&amp;, uint64_t objectStoreIdentifier, const String&amp; newName);
</span><ins>+    void renameIndex(TransactionOperation&amp;, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName);
</ins><span class="cx"> 
</span><span class="cx">     void fireVersionChangeEvent(uint64_t databaseConnectionIdentifier, const IDBResourceIdentifier&amp; requestIdentifier, uint64_t requestedVersion);
</span><span class="cx">     void didFireVersionChangeEvent(uint64_t databaseConnectionIdentifier, const IDBResourceIdentifier&amp; requestIdentifier);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -172,6 +172,20 @@
</span><span class="cx">     m_proxy-&gt;completeOperation(resultData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBConnectionToServer::renameIndex(const IDBRequestData&amp; requestData, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName)
+{
+    LOG(IndexedDB, &quot;IDBConnectionToServer::renameIndex&quot;);
+    ASSERT(isMainThread());
+
+    m_delegate-&gt;renameIndex(requestData, objectStoreIdentifier, indexIdentifier, newName);
+}
+
+void IDBConnectionToServer::didRenameIndex(const IDBResultData&amp; resultData)
+{
+    LOG(IndexedDB, &quot;IDBConnectionToServer::didRenameIndex&quot;);
+    m_proxy-&gt;completeOperation(resultData);
+}
+
</ins><span class="cx"> void IDBConnectionToServer::putOrAdd(const IDBRequestData&amp; requestData, const IDBKeyData&amp; key, const IDBValue&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 (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -80,6 +80,9 @@
</span><span class="cx">     void deleteIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName);
</span><span class="cx">     WEBCORE_EXPORT void didDeleteIndex(const IDBResultData&amp;);
</span><span class="cx"> 
</span><ins>+    void renameIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName);
+    WEBCORE_EXPORT void didRenameIndex(const IDBResultData&amp;);
+
</ins><span class="cx">     void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const IDBValue&amp;, const IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx">     WEBCORE_EXPORT 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 (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -67,6 +67,7 @@
</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><span class="cx">     virtual void deleteIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName) = 0;
</span><ins>+    virtual void renameIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName) = 0;
</ins><span class="cx">     virtual void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const IDBValue&amp;, const IndexedDB::ObjectStoreOverwriteMode) = 0;
</span><span class="cx">     virtual void getRecord(const IDBRequestData&amp;, const IDBGetRecordData&amp;) = 0;
</span><span class="cx">     virtual void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientTransactionOperationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -194,6 +194,19 @@
</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, typename MP3, typename P3&gt;
+RefPtr&lt;TransactionOperation&gt; createTransactionOperation(
+    IDBTransaction&amp; transaction,
+    void (IDBTransaction::*complete)(const IDBResultData&amp;),
+    void (IDBTransaction::*perform)(TransactionOperation&amp;, MP1, MP2, MP3),
+    const P1&amp; parameter1,
+    const P2&amp; parameter2,
+    const P3&amp; parameter3)
+{
+    auto operation = new TransactionOperationImpl&lt;MP1, MP2, MP3&gt;(transaction, complete, perform, parameter1, parameter2, parameter3);
+    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 (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -74,6 +74,7 @@
</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><span class="cx">     virtual IDBError deleteIndex(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier) = 0;
</span><ins>+    virtual IDBError renameIndex(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName) = 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, const IDBObjectStoreInfo&amp;, const IDBKeyData&amp;, const IDBValue&amp;) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -93,6 +93,11 @@
</span><span class="cx">     m_delegate-&gt;didDeleteIndex(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBConnectionToClient::didRenameIndex(const IDBResultData&amp; result)
+{
+    m_delegate-&gt;didRenameIndex(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 (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -59,6 +59,7 @@
</span><span class="cx">     void didClearObjectStore(const IDBResultData&amp;);
</span><span class="cx">     void didCreateIndex(const IDBResultData&amp;);
</span><span class="cx">     void didDeleteIndex(const IDBResultData&amp;);
</span><ins>+    void didRenameIndex(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 (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx">     virtual void didClearObjectStore(const IDBResultData&amp;) = 0;
</span><span class="cx">     virtual void didCreateIndex(const IDBResultData&amp;) = 0;
</span><span class="cx">     virtual void didDeleteIndex(const IDBResultData&amp;) = 0;
</span><ins>+    virtual void didRenameIndex(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 (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -260,6 +260,18 @@
</span><span class="cx">     transaction-&gt;deleteIndex(requestData, objectStoreIdentifier, indexName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBServer::renameIndex(const IDBRequestData&amp; requestData, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName)
+{
+    LOG(IndexedDB, &quot;IDBServer::renameIndex&quot;);
+
+    auto transaction = m_transactions.get(requestData.transactionIdentifier());
+    if (!transaction)
+        return;
+
+    ASSERT(transaction-&gt;isVersionChange());
+    transaction-&gt;renameIndex(requestData, objectStoreIdentifier, indexIdentifier, newName);
+}
+
</ins><span class="cx"> void IDBServer::putOrAdd(const IDBRequestData&amp; requestData, const IDBKeyData&amp; keyData, const IDBValue&amp; value, 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 (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -71,6 +71,7 @@
</span><span class="cx">     WEBCORE_EXPORT void clearObjectStore(const IDBRequestData&amp;, uint64_t objectStoreIdentifier);
</span><span class="cx">     WEBCORE_EXPORT void createIndex(const IDBRequestData&amp;, const IDBIndexInfo&amp;);
</span><span class="cx">     WEBCORE_EXPORT void deleteIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName);
</span><ins>+    WEBCORE_EXPORT void renameIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName);
</ins><span class="cx">     WEBCORE_EXPORT void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const IDBValue&amp;, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx">     WEBCORE_EXPORT void getRecord(const IDBRequestData&amp;, const IDBGetRecordData&amp;);
</span><span class="cx">     WEBCORE_EXPORT 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 (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -160,6 +160,16 @@
</span><span class="cx">     m_originalObjectStoreNames.add(&amp;objectStore, oldName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void MemoryBackingStoreTransaction::indexRenamed(MemoryIndex&amp; index, const String&amp; oldName)
+{
+    ASSERT(m_objectStores.contains(&amp;index.objectStore()));
+    ASSERT(m_info.mode() == IndexedDB::TransactionMode::VersionChange);
+
+    // We only care about the first rename in a given transaction, because if the transaction is aborted we want
+    // to go back to the first 'oldName'
+    m_originalIndexNames.add(&amp;index, oldName);
+}
+
</ins><span class="cx"> void MemoryBackingStoreTransaction::indexCleared(MemoryIndex&amp; index, std::unique_ptr&lt;IndexValueStore&gt;&amp;&amp; valueStore)
</span><span class="cx"> {
</span><span class="cx">     auto addResult = m_clearedIndexValueStores.add(&amp;index, nullptr);
</span><span class="lines">@@ -203,6 +213,10 @@
</span><span class="cx"> 
</span><span class="cx">     TemporaryChange&lt;bool&gt; change(m_isAborting, true);
</span><span class="cx"> 
</span><ins>+    for (auto iterator : m_originalIndexNames)
+        iterator.key-&gt;rename(iterator.value);
+    m_originalIndexNames.clear();
+
</ins><span class="cx">     for (auto iterator : m_originalObjectStoreNames)
</span><span class="cx">         iterator.key-&gt;rename(iterator.value);
</span><span class="cx">     m_originalObjectStoreNames.clear();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryBackingStoreTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -65,6 +65,7 @@
</span><span class="cx">     void objectStoreDeleted(Ref&lt;MemoryObjectStore&gt;&amp;&amp;);
</span><span class="cx">     void objectStoreCleared(MemoryObjectStore&amp;, std::unique_ptr&lt;KeyValueMap&gt;&amp;&amp;, std::unique_ptr&lt;std::set&lt;IDBKeyData&gt;&gt;&amp;&amp;);
</span><span class="cx">     void objectStoreRenamed(MemoryObjectStore&amp;, const String&amp; oldName);
</span><ins>+    void indexRenamed(MemoryIndex&amp;, const String&amp; oldName);
</ins><span class="cx">     void indexCleared(MemoryIndex&amp;, std::unique_ptr&lt;IndexValueStore&gt;&amp;&amp;);
</span><span class="cx"> 
</span><span class="cx">     void addNewIndex(MemoryIndex&amp;);
</span><span class="lines">@@ -97,6 +98,7 @@
</span><span class="cx">     HashMap&lt;MemoryObjectStore*, std::unique_ptr&lt;KeyValueMap&gt;&gt; m_clearedKeyValueMaps;
</span><span class="cx">     HashMap&lt;MemoryObjectStore*, std::unique_ptr&lt;std::set&lt;IDBKeyData&gt;&gt;&gt; m_clearedOrderedKeys;
</span><span class="cx">     HashMap&lt;MemoryObjectStore*, String&gt; m_originalObjectStoreNames;
</span><ins>+    HashMap&lt;MemoryIndex*, String&gt; m_originalIndexNames;
</ins><span class="cx">     HashMap&lt;MemoryIndex*, std::unique_ptr&lt;IndexValueStore&gt;&gt; m_clearedIndexValueStores;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -248,6 +248,42 @@
</span><span class="cx">     return objectStore-&gt;deleteIndex(*rawTransaction, indexIdentifier);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IDBError MemoryIDBBackingStore::renameIndex(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName)
+{
+    LOG(IndexedDB, &quot;MemoryIDBBackingStore::renameIndex&quot;);
+
+    ASSERT(m_databaseInfo);
+    auto* objectStoreInfo = m_databaseInfo-&gt;infoForExistingObjectStore(objectStoreIdentifier);
+    if (!objectStoreInfo)
+        return IDBError(IDBDatabaseException::ConstraintError);
+
+    auto* indexInfo = objectStoreInfo-&gt;infoForExistingIndex(indexIdentifier);
+    if (!indexInfo)
+        return IDBError(IDBDatabaseException::ConstraintError);
+
+    auto transaction = m_transactions.get(transactionIdentifier);
+    ASSERT(transaction);
+    ASSERT(transaction-&gt;isVersionChange());
+
+    auto objectStore = m_objectStoresByIdentifier.get(objectStoreIdentifier);
+    ASSERT(objectStore);
+    if (!objectStore)
+        return IDBError(IDBDatabaseException::ConstraintError);
+
+    auto* index = objectStore-&gt;indexForIdentifier(indexIdentifier);
+    ASSERT(index);
+    if (!index)
+        return IDBError(IDBDatabaseException::ConstraintError);
+
+    String oldName = index-&gt;info().name();
+    objectStore-&gt;renameIndex(*index, newName);
+    transaction-&gt;indexRenamed(*index, oldName);
+
+    indexInfo-&gt;rename(newName);
+
+    return IDBError();
+}
+
</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 (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -58,6 +58,7 @@
</span><span class="cx">     IDBError clearObjectStore(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier) final;
</span><span class="cx">     IDBError createIndex(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBIndexInfo&amp;) final;
</span><span class="cx">     IDBError deleteIndex(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier) final;
</span><ins>+    IDBError renameIndex(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName) final;
</ins><span class="cx">     IDBError keyExistsInObjectStore(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;, bool&amp; keyExists) final;
</span><span class="cx">     IDBError deleteRange(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;) final;
</span><span class="cx">     IDBError addRecord(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBObjectStoreInfo&amp;, const IDBKeyData&amp;, const IDBValue&amp;) final;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIndexh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -62,6 +62,8 @@
</span><span class="cx"> 
</span><span class="cx">     const IDBIndexInfo&amp; info() const { return m_info; }
</span><span class="cx"> 
</span><ins>+    void rename(const String&amp; newName) { m_info.rename(newName); }
+
</ins><span class="cx">     IDBGetResult getResultForKeyRange(IndexedDB::IndexRecordType, const IDBKeyRangeData&amp;) const;
</span><span class="cx">     uint64_t countForKeyRange(const IDBKeyRangeData&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -475,6 +475,17 @@
</span><span class="cx">     return result.iterator-&gt;value.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void MemoryObjectStore::renameIndex(MemoryIndex&amp; index, const String&amp; newName)
+{
+    ASSERT(m_indexesByName.get(index.info().name()) == &amp;index);
+    ASSERT(!m_indexesByName.contains(newName));
+    ASSERT(m_info.infoForExistingIndex(index.info().name()));
+
+    m_info.infoForExistingIndex(index.info().name())-&gt;rename(newName);
+    m_indexesByName.set(newName, m_indexesByName.take(index.info().name()));
+    index.rename(newName);
+}
+
</ins><span class="cx"> } // namespace IDBServer
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryObjectStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -98,6 +98,7 @@
</span><span class="cx">     void maybeRestoreDeletedIndex(Ref&lt;MemoryIndex&gt;&amp;&amp;);
</span><span class="cx"> 
</span><span class="cx">     void rename(const String&amp; newName) { m_info.rename(newName); }
</span><ins>+    void renameIndex(MemoryIndex&amp;, const String&amp; newName);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     MemoryObjectStore(const IDBObjectStoreInfo&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverSQLiteIDBBackingStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -1275,6 +1275,49 @@
</span><span class="cx">     return { };
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IDBError SQLiteIDBBackingStore::renameIndex(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName)
+{
+    LOG(IndexedDB, &quot;SQLiteIDBBackingStore::renameIndex - object store %&quot; PRIu64 &quot;, index %&quot; PRIu64, objectStoreIdentifier, indexIdentifier);
+
+    ASSERT(m_sqliteDB);
+    ASSERT(m_sqliteDB-&gt;isOpen());
+
+    auto* objectStoreInfo = m_databaseInfo-&gt;infoForExistingObjectStore(objectStoreIdentifier);
+    if (!objectStoreInfo)
+        return { IDBDatabaseException::UnknownError, ASCIILiteral(&quot;Could not rename index&quot;) };
+
+    auto* indexInfo = objectStoreInfo-&gt;infoForExistingIndex(indexIdentifier);
+    if (!indexInfo)
+        return { IDBDatabaseException::UnknownError, ASCIILiteral(&quot;Could not rename index&quot;) };
+
+    auto* transaction = m_transactions.get(transactionIdentifier);
+    if (!transaction || !transaction-&gt;inProgress()) {
+        LOG_ERROR(&quot;Attempt to rename an index without an in-progress transaction&quot;);
+        return { IDBDatabaseException::UnknownError, ASCIILiteral(&quot;Attempt to rename an index without an in-progress transaction&quot;) };
+    }
+
+    if (transaction-&gt;mode() != IndexedDB::TransactionMode::VersionChange) {
+        LOG_ERROR(&quot;Attempt to rename an index in a non-version-change transaction&quot;);
+        return { IDBDatabaseException::UnknownError, ASCIILiteral(&quot;Attempt to rename an index in a non-version-change transaction&quot;) };
+    }
+
+    {
+        SQLiteStatement sql(*m_sqliteDB, ASCIILiteral(&quot;UPDATE IndexInfo SET name = ? WHERE objectStoreID = ? AND id = ?;&quot;));
+        if (sql.prepare() != SQLITE_OK
+            || sql.bindText(1, newName) != SQLITE_OK
+            || sql.bindInt64(2, objectStoreIdentifier) != SQLITE_OK
+            || sql.bindInt64(3, indexIdentifier) != SQLITE_OK
+            || sql.step() != SQLITE_DONE) {
+            LOG_ERROR(&quot;Could not update name for index id (%&quot; PRIi64 &quot;, %&quot; PRIi64 &quot;) in IndexInfo table (%i) - %s&quot;, objectStoreIdentifier, indexIdentifier, m_sqliteDB-&gt;lastError(), m_sqliteDB-&gt;lastErrorMsg());
+            return { IDBDatabaseException::UnknownError, ASCIILiteral(&quot;Could not rename index&quot;) };
+        }
+    }
+
+    indexInfo-&gt;rename(newName);
+
+    return { };
+}
+
</ins><span class="cx"> IDBError SQLiteIDBBackingStore::keyExistsInObjectStore(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreID, const IDBKeyData&amp; keyData, bool&amp; keyExists)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;SQLiteIDBBackingStore::keyExistsInObjectStore - key %s, object store %&quot; PRIu64, keyData.loggingString().utf8().data(), objectStoreID);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverSQLiteIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -62,6 +62,7 @@
</span><span class="cx">     IDBError clearObjectStore(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier) final;
</span><span class="cx">     IDBError createIndex(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBIndexInfo&amp;) final;
</span><span class="cx">     IDBError deleteIndex(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier) final;
</span><ins>+    IDBError renameIndex(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName) final;
</ins><span class="cx">     IDBError keyExistsInObjectStore(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;, bool&amp; keyExists) final;
</span><span class="cx">     IDBError deleteRange(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;) final;
</span><span class="cx">     IDBError addRecord(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBObjectStoreInfo&amp;, const IDBKeyData&amp;, const IDBValue&amp;) final;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -819,6 +819,60 @@
</span><span class="cx">     performErrorCallback(callbackIdentifier, error);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UniqueIDBDatabase::renameIndex(UniqueIDBDatabaseTransaction&amp; transaction, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName, ErrorCallback callback)
+{
+    ASSERT(isMainThread());
+    LOG(IndexedDB, &quot;(main) UniqueIDBDatabase::renameIndex&quot;);
+
+    uint64_t callbackID = storeCallbackOrFireError(callback);
+    if (!callbackID)
+        return;
+
+    auto* objectStoreInfo = m_databaseInfo-&gt;infoForExistingObjectStore(objectStoreIdentifier);
+    if (!objectStoreInfo) {
+        performErrorCallback(callbackID, { IDBDatabaseException::UnknownError, ASCIILiteral(&quot;Attempt to rename index in non-existant object store&quot;) });
+        return;
+    }
+
+    auto* indexInfo = objectStoreInfo-&gt;infoForExistingIndex(indexIdentifier);
+    if (!indexInfo) {
+        performErrorCallback(callbackID, { IDBDatabaseException::UnknownError, ASCIILiteral(&quot;Attempt to rename non-existant index&quot;) });
+        return;
+    }
+
+    postDatabaseTask(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::performRenameIndex, callbackID, transaction.info().identifier(), objectStoreIdentifier, indexIdentifier, newName));
+}
+
+void UniqueIDBDatabase::performRenameIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName)
+{
+    ASSERT(!isMainThread());
+    LOG(IndexedDB, &quot;(db) UniqueIDBDatabase::performRenameIndex&quot;);
+
+    ASSERT(m_backingStore);
+    m_backingStore-&gt;renameIndex(transactionIdentifier, objectStoreIdentifier, indexIdentifier, newName);
+
+    IDBError error;
+    postDatabaseTaskReply(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::didPerformRenameIndex, callbackIdentifier, error, objectStoreIdentifier, indexIdentifier, newName));
+}
+
+void UniqueIDBDatabase::didPerformRenameIndex(uint64_t callbackIdentifier, const IDBError&amp; error, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName)
+{
+    ASSERT(isMainThread());
+    LOG(IndexedDB, &quot;(main) UniqueIDBDatabase::didPerformRenameIndex&quot;);
+
+    if (error.isNull()) {
+        auto* objectStoreInfo = m_databaseInfo-&gt;infoForExistingObjectStore(objectStoreIdentifier);
+        ASSERT(objectStoreInfo);
+        if (objectStoreInfo) {
+            auto* indexInfo = objectStoreInfo-&gt;infoForExistingIndex(indexIdentifier);
+            ASSERT(indexInfo);
+            indexInfo-&gt;rename(newName);
+        }
+    }
+
+    performErrorCallback(callbackIdentifier, error);
+}
+
</ins><span class="cx"> void UniqueIDBDatabase::putOrAdd(const IDBRequestData&amp; requestData, const IDBKeyData&amp; keyData, const IDBValue&amp; value, 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 (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -91,6 +91,7 @@
</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><span class="cx">     void deleteIndex(UniqueIDBDatabaseTransaction&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName, ErrorCallback);
</span><ins>+    void renameIndex(UniqueIDBDatabaseTransaction&amp;, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName, ErrorCallback);
</ins><span class="cx">     void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const IDBValue&amp;, IndexedDB::ObjectStoreOverwriteMode, KeyDataCallback);
</span><span class="cx">     void getRecord(const IDBRequestData&amp;, const IDBGetRecordData&amp;, GetResultCallback);
</span><span class="cx">     void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;, CountCallback);
</span><span class="lines">@@ -149,6 +150,7 @@
</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><span class="cx">     void performDeleteIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier);
</span><ins>+    void performRenameIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName);
</ins><span class="cx">     void performPutOrAdd(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;, const IDBValue&amp;, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx">     void performGetRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&amp;);
</span><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">@@ -168,6 +170,7 @@
</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><span class="cx">     void didPerformDeleteIndex(uint64_t callbackIdentifier, const IDBError&amp;, uint64_t objectStoreIdentifier, uint64_t indexIdentifier);
</span><ins>+    void didPerformRenameIndex(uint64_t callbackIdentifier, const IDBError&amp;, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName);
</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 (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -212,6 +212,13 @@
</span><span class="cx">     m_connectionToClient.didDeleteIndex(resultData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UniqueIDBDatabaseConnection::didRenameIndex(const IDBResultData&amp; resultData)
+{
+    LOG(IndexedDB, &quot;UniqueIDBDatabaseConnection::didRenameIndex&quot;);
+
+    m_connectionToClient.didRenameIndex(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 (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -73,6 +73,7 @@
</span><span class="cx">     void didClearObjectStore(const IDBResultData&amp;);
</span><span class="cx">     void didCreateIndex(const IDBResultData&amp;);
</span><span class="cx">     void didDeleteIndex(const IDBResultData&amp;);
</span><ins>+    void didRenameIndex(const IDBResultData&amp;);
</ins><span class="cx">     void didFireVersionChangeEvent(const IDBResourceIdentifier&amp; requestIdentifier);
</span><span class="cx">     void didFinishHandlingVersionChange(const IDBResourceIdentifier&amp; transactionIdentifier);
</span><span class="cx">     void confirmDidCloseFromServer();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -204,6 +204,24 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UniqueIDBDatabaseTransaction::renameIndex(const IDBRequestData&amp; requestData, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName)
+{
+    LOG(IndexedDB, &quot;UniqueIDBDatabaseTransaction::renameIndex&quot;);
+
+    ASSERT(isVersionChange());
+    ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
+
+    RefPtr&lt;UniqueIDBDatabaseTransaction&gt; protectedThis(this);
+    m_databaseConnection-&gt;database().renameIndex(*this, objectStoreIdentifier, indexIdentifier, newName, [this, protectedThis, requestData](const IDBError&amp; error) {
+        LOG(IndexedDB, &quot;UniqueIDBDatabaseTransaction::renameIndex (callback)&quot;);
+        if (error.isNull())
+            m_databaseConnection-&gt;didRenameIndex(IDBResultData::renameIndexSuccess(requestData.requestIdentifier()));
+        else
+            m_databaseConnection-&gt;didRenameIndex(IDBResultData::error(requestData.requestIdentifier(), error));
+    });
+}
+
+
</ins><span class="cx"> void UniqueIDBDatabaseTransaction::putOrAdd(const IDBRequestData&amp; requestData, const IDBKeyData&amp; keyData, const IDBValue&amp; value, 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 (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -73,6 +73,7 @@
</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><span class="cx">     void deleteIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName);
</span><ins>+    void renameIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName);
</ins><span class="cx">     void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const IDBValue&amp;, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx">     void getRecord(const IDBRequestData&amp;, const IDBGetRecordData&amp;);
</span><span class="cx">     void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBIndexInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.h (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -47,6 +47,8 @@
</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>+    void rename(const String&amp; newName) { m_name = newName; }
+
</ins><span class="cx">     template&lt;class Encoder&gt; void encode(Encoder&amp;) const;
</span><span class="cx">     template&lt;class Decoder&gt; static bool decode(Decoder&amp;, IDBIndexInfo&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBObjectStoreInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -85,6 +85,15 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IDBIndexInfo* IDBObjectStoreInfo::infoForExistingIndex(uint64_t identifier)
+{
+    auto iterator = m_indexMap.find(identifier);
+    if (iterator == m_indexMap.end())
+        return nullptr;
+
+    return &amp;iterator-&gt;value;
+}
+
</ins><span class="cx"> IDBObjectStoreInfo IDBObjectStoreInfo::isolatedCopy() const
</span><span class="cx"> {
</span><span class="cx">     IDBObjectStoreInfo result = { m_identifier, m_name.isolatedCopy(), m_keyPath.isolatedCopy(), m_autoIncrement };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBObjectStoreInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx">     bool hasIndex(const String&amp; name) const;
</span><span class="cx">     bool hasIndex(uint64_t indexIdentifier) const;
</span><span class="cx">     IDBIndexInfo* infoForExistingIndex(const String&amp; name);
</span><ins>+    IDBIndexInfo* infoForExistingIndex(uint64_t identifier);
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;String&gt; indexNames() const;
</span><span class="cx">     const HashMap&lt;uint64_t, IDBIndexInfo&gt;&amp; indexMap() const { return m_indexMap; }
</span><span class="lines">@@ -79,7 +80,6 @@
</span><span class="cx">     uint64_t m_maxIndexID { 0 };
</span><span class="cx"> 
</span><span class="cx">     HashMap&lt;uint64_t, IDBIndexInfo&gt; m_indexMap;
</span><del>-
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template&lt;class Encoder&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBResultDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -159,6 +159,11 @@
</span><span class="cx">     return { IDBResultType::DeleteIndexSuccess, requestIdentifier };
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IDBResultData IDBResultData::renameIndexSuccess(const IDBResourceIdentifier&amp; requestIdentifier)
+{
+    return { IDBResultType::RenameIndexSuccess, 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 (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -58,6 +58,7 @@
</span><span class="cx">     OpenCursorSuccess,
</span><span class="cx">     IterateCursorSuccess,
</span><span class="cx">     RenameObjectStoreSuccess,
</span><ins>+    RenameIndexSuccess,
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> namespace IDBServer {
</span><span class="lines">@@ -77,6 +78,7 @@
</span><span class="cx">     static IDBResultData clearObjectStoreSuccess(const IDBResourceIdentifier&amp;);
</span><span class="cx">     static IDBResultData createIndexSuccess(const IDBResourceIdentifier&amp;);
</span><span class="cx">     static IDBResultData deleteIndexSuccess(const IDBResourceIdentifier&amp;);
</span><ins>+    static IDBResultData renameIndexSuccess(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 (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -174,6 +174,13 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InProcessIDBServer::didRenameIndex(const IDBResultData&amp; resultData)
+{
+    RunLoop::current().dispatch([this, protectedThis = makeRef(*this), resultData] {
+        m_connectionToServer-&gt;didRenameIndex(resultData);
+    });
+}
+
</ins><span class="cx"> void InProcessIDBServer::didPutOrAdd(const IDBResultData&amp; resultData)
</span><span class="cx"> {
</span><span class="cx">     RunLoop::current().dispatch([this, protectedThis = makeRef(*this), resultData] {
</span><span class="lines">@@ -279,6 +286,13 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InProcessIDBServer::renameIndex(const IDBRequestData&amp; requestData, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName)
+{
+    RunLoop::current().dispatch([this, protectedThis = makeRef(*this), requestData, objectStoreIdentifier, indexIdentifier, newName] {
+        m_server-&gt;renameIndex(requestData, objectStoreIdentifier, indexIdentifier, newName);
+    });
+}
+
</ins><span class="cx"> void InProcessIDBServer::putOrAdd(const IDBRequestData&amp; requestData, const IDBKeyData&amp; keyData, const IDBValue&amp; value, const IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</span><span class="cx"> {
</span><span class="cx">     RunLoop::current().dispatch([this, protectedThis = makeRef(*this), requestData, keyData, value, overwriteMode] {
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx">     void clearObjectStore(const IDBRequestData&amp;, uint64_t objectStoreIdentifier) final;
</span><span class="cx">     void createIndex(const IDBRequestData&amp;, const IDBIndexInfo&amp;) final;
</span><span class="cx">     void deleteIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName) final;
</span><ins>+    void renameIndex(const IDBRequestData&amp;, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName) final;
</ins><span class="cx">     void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const IDBValue&amp;, const IndexedDB::ObjectStoreOverwriteMode) final;
</span><span class="cx">     void getRecord(const IDBRequestData&amp;, const IDBGetRecordData&amp;) final;
</span><span class="cx">     void getCount(const IDBRequestData&amp;, const IDBKeyRangeData&amp;) final;
</span><span class="lines">@@ -94,6 +95,7 @@
</span><span class="cx">     void didClearObjectStore(const IDBResultData&amp;) final;
</span><span class="cx">     void didCreateIndex(const IDBResultData&amp;) final;
</span><span class="cx">     void didDeleteIndex(const IDBResultData&amp;) final;
</span><ins>+    void didRenameIndex(const IDBResultData&amp;) final;
</ins><span class="cx">     void didPutOrAdd(const IDBResultData&amp;) final;
</span><span class="cx">     void didGetRecord(const IDBResultData&amp;) final;
</span><span class="cx">     void didGetCount(const IDBResultData&amp;) final;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebKit2/ChangeLog        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2016-10-24  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        IndexedDB 2.0: Support IDBIndex name assignment.
+        &lt;rdar://problem/28806932&gt; and https://bugs.webkit.org/show_bug.cgi?id=163805
+
+        Reviewed by Alex Christensen.
+
+        * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
+        (WebKit::WebIDBConnectionToClient::didRenameIndex):
+        (WebKit::WebIDBConnectionToClient::renameIndex):
+        * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
+        * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
+
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
+        (WebKit::WebIDBConnectionToServer::renameIndex):
+        (WebKit::WebIDBConnectionToServer::didRenameIndex):
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
+
</ins><span class="cx"> 2016-10-23  Michael Catanzaro  &lt;mcatanzaro@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Remove DO NOT MODIFY headers from files that are no longer autogenerated
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -127,6 +127,11 @@
</span><span class="cx">     send(Messages::WebIDBConnectionToServer::DidDeleteIndex(resultData));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebIDBConnectionToClient::didRenameIndex(const WebCore::IDBResultData&amp; resultData)
+{
+    send(Messages::WebIDBConnectionToServer::DidRenameIndex(resultData));
+}
+
</ins><span class="cx"> void WebIDBConnectionToClient::didPutOrAdd(const WebCore::IDBResultData&amp; resultData)
</span><span class="cx"> {
</span><span class="cx">     send(Messages::WebIDBConnectionToServer::DidPutOrAdd(resultData));
</span><span class="lines">@@ -260,6 +265,11 @@
</span><span class="cx">     DatabaseProcess::singleton().idbServer().deleteIndex(request, objectStoreIdentifier, name);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebIDBConnectionToClient::renameIndex(const IDBRequestData&amp; request, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName)
+{
+    DatabaseProcess::singleton().idbServer().renameIndex(request, objectStoreIdentifier, indexIdentifier, newName);
+}
+
</ins><span class="cx"> void WebIDBConnectionToClient::putOrAdd(const IDBRequestData&amp; request, const IDBKeyData&amp; key, const IDBValue&amp; value, unsigned overwriteMode)
</span><span class="cx"> {
</span><span class="cx">     if (overwriteMode != static_cast&lt;unsigned&gt;(IndexedDB::ObjectStoreOverwriteMode::NoOverwrite)
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx">     void didClearObjectStore(const WebCore::IDBResultData&amp;) final;
</span><span class="cx">     void didCreateIndex(const WebCore::IDBResultData&amp;) final;
</span><span class="cx">     void didDeleteIndex(const WebCore::IDBResultData&amp;) final;
</span><ins>+    void didRenameIndex(const WebCore::IDBResultData&amp;) final;
</ins><span class="cx">     void didPutOrAdd(const WebCore::IDBResultData&amp;) final;
</span><span class="cx">     void didGetRecord(const WebCore::IDBResultData&amp;) final;
</span><span class="cx">     void didGetCount(const WebCore::IDBResultData&amp;) final;
</span><span class="lines">@@ -97,6 +98,7 @@
</span><span class="cx">     void clearObjectStore(const WebCore::IDBRequestData&amp;, uint64_t objectStoreIdentifier);
</span><span class="cx">     void createIndex(const WebCore::IDBRequestData&amp;, const WebCore::IDBIndexInfo&amp;);
</span><span class="cx">     void deleteIndex(const WebCore::IDBRequestData&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName);
</span><ins>+    void renameIndex(const WebCore::IDBRequestData&amp;, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName);
</ins><span class="cx">     void putOrAdd(const WebCore::IDBRequestData&amp;, const WebCore::IDBKeyData&amp;, const WebCore::IDBValue&amp;, unsigned overwriteMode);
</span><span class="cx">     void getRecord(const WebCore::IDBRequestData&amp;, const WebCore::IDBGetRecordData&amp;);
</span><span class="cx">     void getCount(const WebCore::IDBRequestData&amp;, const WebCore::IDBKeyRangeData&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClientmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx">     ClearObjectStore(WebCore::IDBRequestData requestData, uint64_t objectStoreIdentifier);
</span><span class="cx">     CreateIndex(WebCore::IDBRequestData requestData, WebCore::IDBIndexInfo info);
</span><span class="cx">     DeleteIndex(WebCore::IDBRequestData requestData, uint64_t objectStoreIdentifier, String indexName);
</span><ins>+    RenameIndex(WebCore::IDBRequestData requestData, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, String newName);
</ins><span class="cx">     PutOrAdd(WebCore::IDBRequestData requestData, WebCore::IDBKeyData key, WebCore::IDBValue value, unsigned overwriteMode);
</span><span class="cx">     GetRecord(WebCore::IDBRequestData requestData, struct WebCore::IDBGetRecordData getRecordData);
</span><span class="cx">     GetCount(WebCore::IDBRequestData requestData, struct WebCore::IDBKeyRangeData range);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -138,6 +138,11 @@
</span><span class="cx">     send(Messages::WebIDBConnectionToClient::DeleteIndex(requestData, objectStoreIdentifier, indexName));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebIDBConnectionToServer::renameIndex(const IDBRequestData&amp; requestData, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName)
+{
+    send(Messages::WebIDBConnectionToClient::RenameIndex(requestData, objectStoreIdentifier, indexIdentifier, newName));
+}
+
</ins><span class="cx"> void WebIDBConnectionToServer::putOrAdd(const IDBRequestData&amp; requestData, const IDBKeyData&amp; keyData, const IDBValue&amp; value, const IndexedDB::ObjectStoreOverwriteMode mode)
</span><span class="cx"> {
</span><span class="cx">     send(Messages::WebIDBConnectionToClient::PutOrAdd(requestData, keyData, value, static_cast&lt;unsigned&gt;(mode)));
</span><span class="lines">@@ -253,6 +258,11 @@
</span><span class="cx">     m_connectionToServer-&gt;didDeleteIndex(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebIDBConnectionToServer::didRenameIndex(const IDBResultData&amp; result)
+{
+    m_connectionToServer-&gt;didRenameIndex(result);
+}
+
</ins><span class="cx"> void WebIDBConnectionToServer::didPutOrAdd(const IDBResultData&amp; result)
</span><span class="cx"> {
</span><span class="cx">     m_connectionToServer-&gt;didPutOrAdd(result);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx">     void clearObjectStore(const WebCore::IDBRequestData&amp;, uint64_t objectStoreIdentifier) final;
</span><span class="cx">     void createIndex(const WebCore::IDBRequestData&amp;, const WebCore::IDBIndexInfo&amp;) final;
</span><span class="cx">     void deleteIndex(const WebCore::IDBRequestData&amp;, uint64_t objectStoreIdentifier, const String&amp; indexName) final;
</span><ins>+    void renameIndex(const WebCore::IDBRequestData&amp;, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const String&amp; newName) final;
</ins><span class="cx">     void putOrAdd(const WebCore::IDBRequestData&amp;, const WebCore::IDBKeyData&amp;, const WebCore::IDBValue&amp;, const WebCore::IndexedDB::ObjectStoreOverwriteMode) final;
</span><span class="cx">     void getRecord(const WebCore::IDBRequestData&amp;, const WebCore::IDBGetRecordData&amp;) final;
</span><span class="cx">     void getCount(const WebCore::IDBRequestData&amp;, const WebCore::IDBKeyRangeData&amp;) final;
</span><span class="lines">@@ -86,6 +87,7 @@
</span><span class="cx">     void didClearObjectStore(const WebCore::IDBResultData&amp;);
</span><span class="cx">     void didCreateIndex(const WebCore::IDBResultData&amp;);
</span><span class="cx">     void didDeleteIndex(const WebCore::IDBResultData&amp;);
</span><ins>+    void didRenameIndex(const WebCore::IDBResultData&amp;);
</ins><span class="cx">     void didPutOrAdd(const WebCore::IDBResultData&amp;);
</span><span class="cx">     void didGetRecord(const WebIDBResult&amp;);
</span><span class="cx">     void didGetCount(const WebCore::IDBResultData&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServermessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in (207760 => 207761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in        2016-10-24 15:53:22 UTC (rev 207760)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in        2016-10-24 16:24:09 UTC (rev 207761)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx">     DidClearObjectStore(WebCore::IDBResultData result)
</span><span class="cx">     DidCreateIndex(WebCore::IDBResultData result)
</span><span class="cx">     DidDeleteIndex(WebCore::IDBResultData result)
</span><ins>+    DidRenameIndex(WebCore::IDBResultData result)
</ins><span class="cx">     DidPutOrAdd(WebCore::IDBResultData result)
</span><span class="cx">     DidGetRecord(WebKit::WebIDBResult result)
</span><span class="cx">     DidGetCount(WebCore::IDBResultData result)
</span></span></pre>
</div>
</div>

</body>
</html>