<!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>[195527] 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/195527">195527</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-01-24 23:55:17 -0800 (Sun, 24 Jan 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Modern IDB: Implement deleteIndex and getCount for the SQLite backing store.
https://bugs.webkit.org/show_bug.cgi?id=153415
Reviewed by Darin Adler.
Source/WebCore:
No new tests (Handful of tests now pass, improvements on a handful of others).
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::takeIndexByIdentifier):
(WebCore::IDBServer::MemoryObjectStore::deleteIndex):
(WebCore::IDBServer::MemoryObjectStore::deleteAllIndexes):
(WebCore::IDBServer::MemoryObjectStore::takeIndexByName): Deleted.
* Modules/indexeddb/server/MemoryObjectStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::maybeCreateBackingStoreCursor):
(WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
* Modules/indexeddb/server/SQLiteIDBCursor.h:
* Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
(WebCore::IDBServer::SQLiteIDBTransaction::maybeOpenBackingStoreCursor):
* Modules/indexeddb/server/SQLiteIDBTransaction.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
(WebCore::IDBServer::UniqueIDBDatabase::performDeleteIndex):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteIndex):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
(WebCore::IDBObjectStoreInfo::deleteIndex):
* Modules/indexeddb/shared/IDBObjectStoreInfo.h:
LayoutTests:
* platform/mac-wk1/TestExpectations:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk1TestExpectations">trunk/LayoutTests/platform/mac-wk1/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBBackingStoreh">trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStorecpp">trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStoreh">trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryObjectStorecpp">trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryObjectStoreh">trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverSQLiteIDBBackingStorecpp">trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverSQLiteIDBBackingStoreh">trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverSQLiteIDBCursorcpp">trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverSQLiteIDBCursorh">trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverSQLiteIDBTransactioncpp">trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBTransaction.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverSQLiteIDBTransactionh">trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBTransaction.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="#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>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (195526 => 195527)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-01-25 07:45:39 UTC (rev 195526)
+++ trunk/LayoutTests/ChangeLog        2016-01-25 07:55:17 UTC (rev 195527)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2016-01-24 Brady Eidson <beidson@apple.com>
+
+ Modern IDB: Implement deleteIndex and getCount for the SQLite backing store.
+ https://bugs.webkit.org/show_bug.cgi?id=153415
+
+ Reviewed by Darin Adler.
+
+ * platform/mac-wk1/TestExpectations:
+
</ins><span class="cx"> 2016-01-24 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Unreviewed, update test after r195497
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk1TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (195526 => 195527)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk1/TestExpectations        2016-01-25 07:45:39 UTC (rev 195526)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations        2016-01-25 07:55:17 UTC (rev 195527)
</span><span class="lines">@@ -494,7 +494,6 @@
</span><span class="cx"> storage/indexeddb/modern/get-keyrange.html [ Failure ]
</span><span class="cx"> storage/indexeddb/modern/idbobjectstore-clear-1.html [ Failure ]
</span><span class="cx"> storage/indexeddb/modern/idbobjectstore-clear-2.html [ Failure ]
</span><del>-storage/indexeddb/modern/idbobjectstore-count-1.html [ Failure ]
</del><span class="cx"> storage/indexeddb/modern/idbobjectstore-delete-1.html [ Failure ]
</span><span class="cx"> storage/indexeddb/modern/index-1.html [ Failure ]
</span><span class="cx"> storage/indexeddb/modern/index-2.html [ Failure ]
</span><span class="lines">@@ -504,7 +503,6 @@
</span><span class="cx"> storage/indexeddb/modern/index-cursor-2.html [ Failure ]
</span><span class="cx"> storage/indexeddb/modern/index-cursor-3.html [ Failure ]
</span><span class="cx"> storage/indexeddb/modern/index-get-count-basic.html [ Failure ]
</span><del>-storage/indexeddb/modern/index-get-count-failures.html [ Failure ]
</del><span class="cx"> storage/indexeddb/modern/objectstore-cursor-advance-failures.html [ Failure ]
</span><span class="cx"> storage/indexeddb/modern/objectstore-cursor-continue-failures.html [ Failure ]
</span><span class="cx"> storage/indexeddb/modern/request-readystate.html [ Failure ]
</span><span class="lines">@@ -530,7 +528,6 @@
</span><span class="cx"> storage/indexeddb/objectstore-autoincrement.html [ Failure ]
</span><span class="cx"> storage/indexeddb/objectstore-basics.html [ Failure ]
</span><span class="cx"> storage/indexeddb/objectstore-clear.html [ Failure ]
</span><del>-storage/indexeddb/objectstore-count.html [ Failure ]
</del><span class="cx"> storage/indexeddb/objectstore-cursor.html [ Failure ]
</span><span class="cx"> storage/indexeddb/open-cursor.html [ Failure ]
</span><span class="cx"> storage/indexeddb/opencursor-key.html [ Failure ]
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (195526 => 195527)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-01-25 07:45:39 UTC (rev 195526)
+++ trunk/Source/WebCore/ChangeLog        2016-01-25 07:55:17 UTC (rev 195527)
</span><span class="lines">@@ -1,5 +1,52 @@
</span><span class="cx"> 2016-01-24 Brady Eidson <beidson@apple.com>
</span><span class="cx">
</span><ins>+ Modern IDB: Implement deleteIndex and getCount for the SQLite backing store.
+ https://bugs.webkit.org/show_bug.cgi?id=153415
+
+ Reviewed by Darin Adler.
+
+ No new tests (Handful of tests now pass, improvements on a handful of others).
+
+ * Modules/indexeddb/server/IDBBackingStore.h:
+
+ * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
+ (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
+ * Modules/indexeddb/server/MemoryIDBBackingStore.h:
+
+ * Modules/indexeddb/server/MemoryObjectStore.cpp:
+ (WebCore::IDBServer::MemoryObjectStore::takeIndexByIdentifier):
+ (WebCore::IDBServer::MemoryObjectStore::deleteIndex):
+ (WebCore::IDBServer::MemoryObjectStore::deleteAllIndexes):
+ (WebCore::IDBServer::MemoryObjectStore::takeIndexByName): Deleted.
+ * Modules/indexeddb/server/MemoryObjectStore.h:
+
+ * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
+ (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
+ (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
+ (WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
+ * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
+
+ * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
+ (WebCore::IDBServer::SQLiteIDBCursor::maybeCreateBackingStoreCursor):
+ (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
+ * Modules/indexeddb/server/SQLiteIDBCursor.h:
+
+ * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
+ (WebCore::IDBServer::SQLiteIDBTransaction::maybeOpenBackingStoreCursor):
+ * Modules/indexeddb/server/SQLiteIDBTransaction.h:
+
+ * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+ (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
+ (WebCore::IDBServer::UniqueIDBDatabase::performDeleteIndex):
+ (WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteIndex):
+ * Modules/indexeddb/server/UniqueIDBDatabase.h:
+
+ * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
+ (WebCore::IDBObjectStoreInfo::deleteIndex):
+ * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
+
+2016-01-24 Brady Eidson <beidson@apple.com>
+
</ins><span class="cx"> Unreviewed, speculative fix for:
</span><span class="cx"> Modern IDB: Some IDB tests crash in ~SQLiteIDBBackingStore
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=153418
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h (195526 => 195527)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h        2016-01-25 07:45:39 UTC (rev 195526)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h        2016-01-25 07:55:17 UTC (rev 195527)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> virtual IDBError deleteObjectStore(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier) = 0;
</span><span class="cx"> virtual IDBError clearObjectStore(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier) = 0;
</span><span class="cx"> virtual IDBError createIndex(const IDBResourceIdentifier& transactionIdentifier, const IDBIndexInfo&) = 0;
</span><del>- virtual IDBError deleteIndex(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const String& indexName) = 0;
</del><ins>+ virtual IDBError deleteIndex(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier) = 0;
</ins><span class="cx"> virtual IDBError keyExistsInObjectStore(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, bool& keyExists) = 0;
</span><span class="cx"> virtual IDBError deleteRange(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&) = 0;
</span><span class="cx"> virtual IDBError addRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, const ThreadSafeDataBuffer& value) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp (195526 => 195527)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2016-01-25 07:45:39 UTC (rev 195526)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2016-01-25 07:55:17 UTC (rev 195527)
</span><span class="lines">@@ -204,7 +204,7 @@
</span><span class="cx"> return objectStore->createIndex(*rawTransaction, info);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-IDBError MemoryIDBBackingStore::deleteIndex(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const String& indexName)
</del><ins>+IDBError MemoryIDBBackingStore::deleteIndex(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier)
</ins><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "MemoryIDBBackingStore::deleteIndex");
</span><span class="cx">
</span><span class="lines">@@ -216,7 +216,7 @@
</span><span class="cx"> if (!objectStore)
</span><span class="cx"> return IDBError(IDBDatabaseException::ConstraintError);
</span><span class="cx">
</span><del>- return objectStore->deleteIndex(*rawTransaction, indexName);
</del><ins>+ return objectStore->deleteIndex(*rawTransaction, indexIdentifier);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort(MemoryObjectStore& objectStore)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h (195526 => 195527)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h        2016-01-25 07:45:39 UTC (rev 195526)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h        2016-01-25 07:55:17 UTC (rev 195527)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx"> virtual IDBError deleteObjectStore(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier) override final;
</span><span class="cx"> virtual IDBError clearObjectStore(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier) override final;
</span><span class="cx"> virtual IDBError createIndex(const IDBResourceIdentifier& transactionIdentifier, const IDBIndexInfo&) override final;
</span><del>- virtual IDBError deleteIndex(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const String& indexName) override final;
</del><ins>+ virtual IDBError deleteIndex(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier) override final;
</ins><span class="cx"> virtual IDBError keyExistsInObjectStore(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, bool& keyExists) override final;
</span><span class="cx"> virtual IDBError deleteRange(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&) override final;
</span><span class="cx"> virtual IDBError addRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, const ThreadSafeDataBuffer& value) override final;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp (195526 => 195527)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp        2016-01-25 07:45:39 UTC (rev 195526)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp        2016-01-25 07:55:17 UTC (rev 195527)
</span><span class="lines">@@ -124,31 +124,31 @@
</span><span class="cx"> registerIndex(WTFMove(index));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<MemoryIndex> MemoryObjectStore::takeIndexByName(const String& name)
</del><ins>+RefPtr<MemoryIndex> MemoryObjectStore::takeIndexByIdentifier(uint64_t indexIdentifier)
</ins><span class="cx"> {
</span><del>- auto indexByName = m_indexesByName.take(name);
- if (!indexByName)
</del><ins>+ auto indexByIdentifier = m_indexesByIdentifier.take(indexIdentifier);
+ if (!indexByIdentifier)
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- auto index = m_indexesByIdentifier.take(indexByName->info().identifier());
</del><ins>+ auto index = m_indexesByName.take(indexByIdentifier->info().name());
</ins><span class="cx"> ASSERT(index);
</span><span class="cx">
</span><span class="cx"> return index;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-IDBError MemoryObjectStore::deleteIndex(MemoryBackingStoreTransaction& transaction, const String& indexName)
</del><ins>+IDBError MemoryObjectStore::deleteIndex(MemoryBackingStoreTransaction& transaction, uint64_t indexIdentifier)
</ins><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "MemoryObjectStore::deleteIndex");
</span><span class="cx">
</span><span class="cx"> if (!m_writeTransaction || !m_writeTransaction->isVersionChange() || m_writeTransaction != &transaction)
</span><span class="cx"> return IDBError(IDBDatabaseException::ConstraintError);
</span><span class="cx">
</span><del>- auto index = takeIndexByName(indexName);
</del><ins>+ auto index = takeIndexByIdentifier(indexIdentifier);
</ins><span class="cx"> ASSERT(index);
</span><span class="cx"> if (!index)
</span><span class="cx"> return IDBError(IDBDatabaseException::ConstraintError);
</span><span class="cx">
</span><del>- m_info.deleteIndex(indexName);
</del><ins>+ m_info.deleteIndex(indexIdentifier);
</ins><span class="cx"> transaction.indexDeleted(*index);
</span><span class="cx">
</span><span class="cx"> return { };
</span><span class="lines">@@ -156,14 +156,14 @@
</span><span class="cx">
</span><span class="cx"> void MemoryObjectStore::deleteAllIndexes(MemoryBackingStoreTransaction& transaction)
</span><span class="cx"> {
</span><del>- Vector<String> indexNames;
- indexNames.reserveInitialCapacity(m_indexesByName.size());
</del><ins>+ Vector<uint64_t> indexIdentifiers;
+ indexIdentifiers.reserveInitialCapacity(m_indexesByName.size());
</ins><span class="cx">
</span><del>- for (auto& name : m_indexesByName.keys())
- indexNames.uncheckedAppend(name);
</del><ins>+ for (auto& index : m_indexesByName.values())
+ indexIdentifiers.uncheckedAppend(index->info().identifier());
</ins><span class="cx">
</span><del>- for (auto& name : indexNames)
- deleteIndex(transaction, name);
</del><ins>+ for (auto identifier : indexIdentifiers)
+ deleteIndex(transaction, identifier);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool MemoryObjectStore::containsRecord(const IDBKeyData& key)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryObjectStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h (195526 => 195527)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h        2016-01-25 07:45:39 UTC (rev 195526)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h        2016-01-25 07:55:17 UTC (rev 195527)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx"> MemoryBackingStoreTransaction* writeTransaction() { return m_writeTransaction; }
</span><span class="cx">
</span><span class="cx"> IDBError createIndex(MemoryBackingStoreTransaction&, const IDBIndexInfo&);
</span><del>- IDBError deleteIndex(MemoryBackingStoreTransaction&, const String& indexName);
</del><ins>+ IDBError deleteIndex(MemoryBackingStoreTransaction&, uint64_t indexIdentifier);
</ins><span class="cx"> void deleteAllIndexes(MemoryBackingStoreTransaction&);
</span><span class="cx"> void registerIndex(Ref<MemoryIndex>&&);
</span><span class="cx">
</span><span class="lines">@@ -108,7 +108,7 @@
</span><span class="cx"> void updateCursorsForPutRecord(std::set<IDBKeyData>::iterator);
</span><span class="cx"> void updateCursorsForDeleteRecord(const IDBKeyData&);
</span><span class="cx">
</span><del>- RefPtr<MemoryIndex> takeIndexByName(const String& name);
</del><ins>+ RefPtr<MemoryIndex> takeIndexByIdentifier(uint64_t indexIdentifier);
</ins><span class="cx">
</span><span class="cx"> IDBObjectStoreInfo m_info;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverSQLiteIDBBackingStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp (195526 => 195527)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp        2016-01-25 07:45:39 UTC (rev 195526)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp        2016-01-25 07:55:17 UTC (rev 195527)
</span><span class="lines">@@ -720,7 +720,7 @@
</span><span class="cx">
</span><span class="cx"> // Write index records for any records that already exist in this object store.
</span><span class="cx">
</span><del>- auto cursor = transaction->maybeOpenBackingStoreCursor(info.objectStoreIdentifier());
</del><ins>+ auto cursor = transaction->maybeOpenBackingStoreCursor(info.objectStoreIdentifier(), 0, IDBKeyRangeData::allKeys());
</ins><span class="cx">
</span><span class="cx"> if (!cursor) {
</span><span class="cx"> LOG_ERROR("Cannot open cursor to populate indexes in database");
</span><span class="lines">@@ -849,9 +849,47 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><del>-IDBError SQLiteIDBBackingStore::deleteIndex(const IDBResourceIdentifier&, uint64_t, const String&)
</del><ins>+IDBError SQLiteIDBBackingStore::deleteIndex(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier)
</ins><span class="cx"> {
</span><del>- return { IDBDatabaseException::UnknownError, ASCIILiteral("Not implemented") };
</del><ins>+ LOG(IndexedDB, "SQLiteIDBBackingStore::deleteIndex - object store %" PRIu64, objectStoreIdentifier);
+
+ ASSERT(m_sqliteDB);
+ ASSERT(m_sqliteDB->isOpen());
+
+ auto* transaction = m_transactions.get(transactionIdentifier);
+ if (!transaction || !transaction->inProgress()) {
+ LOG_ERROR("Attempt to delete index without an in-progress transaction");
+ return { IDBDatabaseException::UnknownError, ASCIILiteral("Attempt to delete index without an in-progress transaction") };
+ }
+
+ if (transaction->mode() != IndexedDB::TransactionMode::VersionChange) {
+ LOG_ERROR("Attempt to delete index during a non-version-change transaction");
+ return { IDBDatabaseException::UnknownError, ASCIILiteral("Attempt to delete index during a non-version-change transaction") };
+ }
+
+ {
+ SQLiteStatement sql(*m_sqliteDB, ASCIILiteral("DELETE FROM IndexInfo WHERE id = ? AND objectStoreID = ?;"));
+ if (sql.prepare() != SQLITE_OK
+ || sql.bindInt64(1, indexIdentifier) != SQLITE_OK
+ || sql.bindInt64(2, objectStoreIdentifier) != SQLITE_OK
+ || sql.step() != SQLITE_DONE) {
+ LOG_ERROR("Could not delete index id %" PRIi64 " from IndexInfo table (%i) - %s", objectStoreIdentifier, m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg());
+ return { IDBDatabaseException::UnknownError, ASCIILiteral("Error deleting index from database") };
+ }
+ }
+
+ {
+ SQLiteStatement sql(*m_sqliteDB, ASCIILiteral("DELETE FROM IndexRecords WHERE indexID = ? AND objectStoreID = ?;"));
+ if (sql.prepare() != SQLITE_OK
+ || sql.bindInt64(1, indexIdentifier) != SQLITE_OK
+ || sql.bindInt64(2, objectStoreIdentifier) != SQLITE_OK
+ || sql.step() != SQLITE_DONE) {
+ LOG_ERROR("Could not delete index records for index id %" PRIi64 " from IndexRecords table (%i) - %s", indexIdentifier, m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg());
+ return { IDBDatabaseException::UnknownError, ASCIILiteral("Error deleting index records from database") };
+ }
+ }
+
+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> IDBError SQLiteIDBBackingStore::keyExistsInObjectStore(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreID, const IDBKeyData& keyData, bool& keyExists)
</span><span class="lines">@@ -1093,9 +1131,30 @@
</span><span class="cx"> return { IDBDatabaseException::UnknownError, ASCIILiteral("Not implemented") };
</span><span class="cx"> }
</span><span class="cx">
</span><del>-IDBError SQLiteIDBBackingStore::getCount(const IDBResourceIdentifier&, uint64_t, uint64_t, const IDBKeyRangeData&, uint64_t&)
</del><ins>+IDBError SQLiteIDBBackingStore::getCount(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData& range, uint64_t& outCount)
</ins><span class="cx"> {
</span><del>- return { IDBDatabaseException::UnknownError, ASCIILiteral("Not implemented") };
</del><ins>+ LOG(IndexedDB, "SQLiteIDBBackingStore::getCount - object store %" PRIu64, objectStoreIdentifier);
+ ASSERT(m_sqliteDB);
+ ASSERT(m_sqliteDB->isOpen());
+
+ outCount = 0;
+
+ auto* transaction = m_transactions.get(transactionIdentifier);
+ if (!transaction || !transaction->inProgress()) {
+ LOG_ERROR("Attempt to get count from database without an in-progress transaction");
+ return { IDBDatabaseException::UnknownError, ASCIILiteral("Attempt to get count from database without an in-progress transaction") };
+ }
+
+ auto cursor = transaction->maybeOpenBackingStoreCursor(objectStoreIdentifier, indexIdentifier, range);
+ if (!cursor) {
+ LOG_ERROR("Cannot open cursor to populate indexes in database");
+ return { IDBDatabaseException::UnknownError, ASCIILiteral("Unable to populate indexes in database") };
+ }
+
+ while (cursor->advance(1))
+ ++outCount;
+
+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> IDBError SQLiteIDBBackingStore::generateKeyNumber(const IDBResourceIdentifier&, uint64_t, uint64_t&)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverSQLiteIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h (195526 => 195527)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h        2016-01-25 07:45:39 UTC (rev 195526)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h        2016-01-25 07:55:17 UTC (rev 195527)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx"> virtual IDBError deleteObjectStore(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier) override final;
</span><span class="cx"> virtual IDBError clearObjectStore(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier) override final;
</span><span class="cx"> virtual IDBError createIndex(const IDBResourceIdentifier& transactionIdentifier, const IDBIndexInfo&) override final;
</span><del>- virtual IDBError deleteIndex(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const String& indexName) override final;
</del><ins>+ virtual IDBError deleteIndex(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier) override final;
</ins><span class="cx"> virtual IDBError keyExistsInObjectStore(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, bool& keyExists) override final;
</span><span class="cx"> virtual IDBError deleteRange(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&) override final;
</span><span class="cx"> virtual IDBError addRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, const ThreadSafeDataBuffer& value) override final;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverSQLiteIDBCursorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp (195526 => 195527)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp        2016-01-25 07:45:39 UTC (rev 195526)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.cpp        2016-01-25 07:55:17 UTC (rev 195527)
</span><span class="lines">@@ -51,9 +51,9 @@
</span><span class="cx"> return cursor;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-std::unique_ptr<SQLiteIDBCursor> SQLiteIDBCursor::maybeCreateBackingStoreCursor(SQLiteIDBTransaction& transaction, const uint64_t objectStoreIdentifier)
</del><ins>+std::unique_ptr<SQLiteIDBCursor> SQLiteIDBCursor::maybeCreateBackingStoreCursor(SQLiteIDBTransaction& transaction, const uint64_t objectStoreID, const uint64_t indexID, const IDBKeyRangeData& range)
</ins><span class="cx"> {
</span><del>- auto cursor = std::make_unique<SQLiteIDBCursor>(transaction, objectStoreIdentifier);
</del><ins>+ auto cursor = std::make_unique<SQLiteIDBCursor>(transaction, objectStoreID, indexID, range);
</ins><span class="cx">
</span><span class="cx"> if (!cursor->establishStatement())
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -75,11 +75,13 @@
</span><span class="cx"> ASSERT(m_objectStoreID);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-SQLiteIDBCursor::SQLiteIDBCursor(SQLiteIDBTransaction& transaction, uint64_t objectStoreID)
</del><ins>+SQLiteIDBCursor::SQLiteIDBCursor(SQLiteIDBTransaction& transaction, const uint64_t objectStoreID, const uint64_t indexID, const IDBKeyRangeData& range)
</ins><span class="cx"> : m_transaction(&transaction)
</span><span class="cx"> , m_cursorIdentifier(transaction.transactionIdentifier())
</span><span class="cx"> , m_objectStoreID(objectStoreID)
</span><ins>+ , m_indexID(indexID ? indexID : IDBIndexMetadata::InvalidId)
</ins><span class="cx"> , m_cursorDirection(IndexedDB::CursorDirection::Next)
</span><ins>+ , m_keyRange(range)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_objectStoreID);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverSQLiteIDBCursorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.h (195526 => 195527)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.h        2016-01-25 07:45:39 UTC (rev 195526)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBCursor.h        2016-01-25 07:55:17 UTC (rev 195527)
</span><span class="lines">@@ -46,10 +46,10 @@
</span><span class="cx"> WTF_MAKE_NONCOPYABLE(SQLiteIDBCursor);
</span><span class="cx"> public:
</span><span class="cx"> static std::unique_ptr<SQLiteIDBCursor> maybeCreate(SQLiteIDBTransaction&, const IDBCursorInfo&);
</span><del>- static std::unique_ptr<SQLiteIDBCursor> maybeCreateBackingStoreCursor(SQLiteIDBTransaction&, const uint64_t objectStoreIdentifier);
</del><ins>+ static std::unique_ptr<SQLiteIDBCursor> maybeCreateBackingStoreCursor(SQLiteIDBTransaction&, const uint64_t objectStoreIdentifier, const uint64_t indexIdentifier, const IDBKeyRangeData&);
</ins><span class="cx">
</span><span class="cx"> SQLiteIDBCursor(SQLiteIDBTransaction&, const IDBCursorInfo&);
</span><del>- SQLiteIDBCursor(SQLiteIDBTransaction&, uint64_t objectStoreID);
</del><ins>+ SQLiteIDBCursor(SQLiteIDBTransaction&, uint64_t objectStoreID, uint64_t indexID, const IDBKeyRangeData&);
</ins><span class="cx">
</span><span class="cx"> const IDBResourceIdentifier& identifier() const { return m_cursorIdentifier; }
</span><span class="cx"> SQLiteIDBTransaction* transaction() const { return m_transaction; }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverSQLiteIDBTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBTransaction.cpp (195526 => 195527)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBTransaction.cpp        2016-01-25 07:45:39 UTC (rev 195526)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBTransaction.cpp        2016-01-25 07:55:17 UTC (rev 195527)
</span><span class="lines">@@ -99,12 +99,12 @@
</span><span class="cx"> clearCursors();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-std::unique_ptr<SQLiteIDBCursor> SQLiteIDBTransaction::maybeOpenBackingStoreCursor(uint64_t objectStoreID)
</del><ins>+std::unique_ptr<SQLiteIDBCursor> SQLiteIDBTransaction::maybeOpenBackingStoreCursor(uint64_t objectStoreID, uint64_t indexID, const IDBKeyRangeData& range)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_sqliteTransaction);
</span><span class="cx"> ASSERT(m_sqliteTransaction->inProgress());
</span><span class="cx">
</span><del>- return SQLiteIDBCursor::maybeCreateBackingStoreCursor(*this, objectStoreID);
</del><ins>+ return SQLiteIDBCursor::maybeCreateBackingStoreCursor(*this, objectStoreID, indexID, range);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SQLiteIDBCursor* SQLiteIDBTransaction::maybeOpenCursor(const IDBCursorInfo& info)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverSQLiteIDBTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBTransaction.h (195526 => 195527)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBTransaction.h        2016-01-25 07:45:39 UTC (rev 195526)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBTransaction.h        2016-01-25 07:55:17 UTC (rev 195527)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx"> IDBError commit();
</span><span class="cx"> IDBError abort();
</span><span class="cx">
</span><del>- std::unique_ptr<SQLiteIDBCursor> maybeOpenBackingStoreCursor(uint64_t objectStoreID);
</del><ins>+ std::unique_ptr<SQLiteIDBCursor> maybeOpenBackingStoreCursor(uint64_t objectStoreID, uint64_t indexID, const IDBKeyRangeData&);
</ins><span class="cx"> SQLiteIDBCursor* maybeOpenCursor(const IDBCursorInfo&);
</span><span class="cx">
</span><span class="cx"> void closeCursor(SQLiteIDBCursor&);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (195526 => 195527)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2016-01-25 07:45:39 UTC (rev 195526)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2016-01-25 07:55:17 UTC (rev 195527)
</span><span class="lines">@@ -607,22 +607,35 @@
</span><span class="cx"> LOG(IndexedDB, "(main) UniqueIDBDatabase::deleteIndex");
</span><span class="cx">
</span><span class="cx"> uint64_t callbackID = storeCallback(callback);
</span><del>- m_server.postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::performDeleteIndex, callbackID, transaction.info().identifier(), objectStoreIdentifier, indexName));
</del><ins>+
+ auto* objectStoreInfo = m_databaseInfo->infoForExistingObjectStore(objectStoreIdentifier);
+ if (!objectStoreInfo) {
+ performErrorCallback(callbackID, { IDBDatabaseException::UnknownError, ASCIILiteral("Attempt to delete index from non-existant object store") });
+ return;
+ }
+
+ auto* indexInfo = objectStoreInfo->infoForExistingIndex(indexName);
+ if (!indexInfo) {
+ performErrorCallback(callbackID, { IDBDatabaseException::UnknownError, ASCIILiteral("Attempt to delete non-existant index") });
+ return;
+ }
+
+ m_server.postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::performDeleteIndex, callbackID, transaction.info().identifier(), objectStoreIdentifier, indexInfo->identifier()));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void UniqueIDBDatabase::performDeleteIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const String& indexName)
</del><ins>+void UniqueIDBDatabase::performDeleteIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const uint64_t indexIdentifier)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(!isMainThread());
</span><span class="cx"> LOG(IndexedDB, "(db) UniqueIDBDatabase::performDeleteIndex");
</span><span class="cx">
</span><span class="cx"> ASSERT(m_backingStore);
</span><del>- m_backingStore->deleteIndex(transactionIdentifier, objectStoreIdentifier, indexName);
</del><ins>+ m_backingStore->deleteIndex(transactionIdentifier, objectStoreIdentifier, indexIdentifier);
</ins><span class="cx">
</span><span class="cx"> IDBError error;
</span><del>- m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &UniqueIDBDatabase::didPerformDeleteIndex, callbackIdentifier, error, objectStoreIdentifier, indexName));
</del><ins>+ m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &UniqueIDBDatabase::didPerformDeleteIndex, callbackIdentifier, error, objectStoreIdentifier, indexIdentifier));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void UniqueIDBDatabase::didPerformDeleteIndex(uint64_t callbackIdentifier, const IDBError& error, uint64_t objectStoreIdentifier, const String& indexName)
</del><ins>+void UniqueIDBDatabase::didPerformDeleteIndex(uint64_t callbackIdentifier, const IDBError& error, uint64_t objectStoreIdentifier, uint64_t indexIdentifier)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(isMainThread());
</span><span class="cx"> LOG(IndexedDB, "(main) UniqueIDBDatabase::didPerformDeleteIndex");
</span><span class="lines">@@ -630,7 +643,7 @@
</span><span class="cx"> if (error.isNull()) {
</span><span class="cx"> auto* objectStoreInfo = m_databaseInfo->infoForExistingObjectStore(objectStoreIdentifier);
</span><span class="cx"> if (objectStoreInfo)
</span><del>- objectStoreInfo->deleteIndex(indexName);
</del><ins>+ objectStoreInfo->deleteIndex(indexIdentifier);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> performErrorCallback(callbackIdentifier, error);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h (195526 => 195527)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2016-01-25 07:45:39 UTC (rev 195526)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2016-01-25 07:55:17 UTC (rev 195527)
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx"> void performDeleteObjectStore(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier);
</span><span class="cx"> void performClearObjectStore(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier);
</span><span class="cx"> void performCreateIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, const IDBIndexInfo&);
</span><del>- void performDeleteIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const String& indexName);
</del><ins>+ void performDeleteIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier);
</ins><span class="cx"> void performPutOrAdd(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx"> void performGetRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&);
</span><span class="cx"> void performGetIndexRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&);
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx"> void didPerformDeleteObjectStore(uint64_t callbackIdentifier, const IDBError&, uint64_t objectStoreIdentifier);
</span><span class="cx"> void didPerformClearObjectStore(uint64_t callbackIdentifier, const IDBError&);
</span><span class="cx"> void didPerformCreateIndex(uint64_t callbackIdentifier, const IDBError&, const IDBIndexInfo&);
</span><del>- void didPerformDeleteIndex(uint64_t callbackIdentifier, const IDBError&, uint64_t objectStoreIdentifier, const String& indexName);
</del><ins>+ void didPerformDeleteIndex(uint64_t callbackIdentifier, const IDBError&, uint64_t objectStoreIdentifier, uint64_t indexIdentifier);
</ins><span class="cx"> void didPerformPutOrAdd(uint64_t callbackIdentifier, const IDBError&, const IDBKeyData&);
</span><span class="cx"> void didPerformGetRecord(uint64_t callbackIdentifier, const IDBError&, const IDBGetResult&);
</span><span class="cx"> void didPerformGetCount(uint64_t callbackIdentifier, const IDBError&, uint64_t);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBObjectStoreInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp (195526 => 195527)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp        2016-01-25 07:45:39 UTC (rev 195526)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp        2016-01-25 07:55:17 UTC (rev 195527)
</span><span class="lines">@@ -113,6 +113,11 @@
</span><span class="cx"> m_indexMap.remove(info->identifier());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBObjectStoreInfo::deleteIndex(uint64_t indexIdentifier)
+{
+ m_indexMap.remove(indexIdentifier);
+}
+
</ins><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> String IDBObjectStoreInfo::loggingString(int indent) const
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBObjectStoreInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h (195526 => 195527)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h        2016-01-25 07:45:39 UTC (rev 195526)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h        2016-01-25 07:55:17 UTC (rev 195527)
</span><span class="lines">@@ -59,6 +59,7 @@
</span><span class="cx"> Vector<String> indexNames() const;
</span><span class="cx">
</span><span class="cx"> void deleteIndex(const String& indexName);
</span><ins>+ void deleteIndex(uint64_t indexIdentifier);
</ins><span class="cx">
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> String loggingString(int indent = 0) const;
</span></span></pre>
</div>
</div>
</body>
</html>