<!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>[191758] 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/191758">191758</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2015-10-29 15:08:51 -0700 (Thu, 29 Oct 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Modern IDB: deleteObjectStore support.
https://bugs.webkit.org/show_bug.cgi?id=150673
Reviewed by Alex Christensen.
Source/JavaScriptCore:
* runtime/VM.h:
Source/WebCore:
Tests: storage/indexeddb/modern/deleteobjectstore-1.html
storage/indexeddb/modern/idbdatabase-deleteobjectstore-failures.html
storage/indexeddb/modern/idbobjectstore-get-failures.html
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::deleteObjectStore):
(WebCore::IDBClient::IDBConnectionToServer::didDeleteObjectStore):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
* Modules/indexeddb/client/IDBDatabaseImpl.cpp:
(WebCore::IDBClient::IDBDatabase::deleteObjectStore):
(WebCore::IDBClient::IDBDatabase::willCommitTransaction):
(WebCore::IDBClient::IDBDatabase::willAbortTransaction):
(WebCore::IDBClient::IDBDatabase::commitTransaction): Deleted.
(WebCore::IDBClient::IDBDatabase::abortTransaction): Deleted.
* Modules/indexeddb/client/IDBDatabaseImpl.h:
* Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
(WebCore::IDBClient::IDBObjectStore::markAsDeleted):
* Modules/indexeddb/client/IDBObjectStoreImpl.h:
* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::IDBTransaction):
(WebCore::IDBClient::IDBTransaction::abort):
(WebCore::IDBClient::IDBTransaction::abortOnServer):
(WebCore::IDBClient::IDBTransaction::commit):
(WebCore::IDBClient::IDBTransaction::commitOnServer):
(WebCore::IDBClient::IDBTransaction::deleteObjectStore):
(WebCore::IDBClient::IDBTransaction::deleteObjectStoreOnServer):
(WebCore::IDBClient::IDBTransaction::didDeleteObjectStoreOnServer):
(WebCore::IDBClient::IDBTransaction::activate):
(WebCore::IDBClient::IDBTransaction::activationTimerFired): Deleted.
(WebCore::IDBClient::IDBTransaction::createObjectStoreOnServer): Deleted.
(WebCore::IDBClient::IDBTransaction::didCreateObjectStoreOnServer): Deleted.
(WebCore::IDBClient::IDBTransaction::getRecordOnServer): Deleted.
(WebCore::IDBClient::IDBTransaction::putOrAddOnServer): Deleted.
* Modules/indexeddb/client/IDBTransactionImpl.h:
* Modules/indexeddb/client/TransactionOperation.h:
(WebCore::IDBClient::TransactionOperation::completed):
(WebCore::IDBClient::createTransactionOperation):
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::didDeleteObjectStore):
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::deleteObjectStore):
* Modules/indexeddb/server/IDBServer.h:
* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreDeleted):
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
(WebCore::IDBServer::MemoryBackingStoreTransaction::finish):
* Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::restoreObjectStoreForVersionChangeAbort):
(WebCore::IDBServer::MemoryIDBBackingStore::takeObjectStoreByName):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performCreateObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::performDeleteObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::createObjectStore): Deleted.
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteObjectStore):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteObjectStore):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
* Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
(WebCore::IDBDatabaseInfo::deleteObjectStore):
* Modules/indexeddb/shared/IDBDatabaseInfo.h:
* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::deleteObjectStoreSuccess):
* Modules/indexeddb/shared/IDBResultData.h:
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::didDeleteObjectStore):
(WebCore::InProcessIDBServer::deleteObjectStore):
* Modules/indexeddb/shared/InProcessIDBServer.h:
LayoutTests:
* storage/indexeddb/modern/deleteobjectstore-1-expected.txt: Added.
* storage/indexeddb/modern/deleteobjectstore-1.html: Added.
* storage/indexeddb/modern/idbdatabase-deleteobjectstore-failures-expected.txt: Added.
* storage/indexeddb/modern/idbdatabase-deleteobjectstore-failures.html: Added.
* storage/indexeddb/modern/idbobjectstore-get-failures-expected.txt: Added.
* storage/indexeddb/modern/idbobjectstore-get-failures.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMh">trunk/Source/JavaScriptCore/runtime/VM.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerDelegateh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBDatabaseImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBDatabaseImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBObjectStoreImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBObjectStoreImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h</a></li>
<li><a href="#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="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseConnectioncpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseConnectionh">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactioncpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactionh">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBDatabaseInfocpp">trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBDatabaseInfoh">trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBResultDatacpp">trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBResultDatah">trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServercpp">trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServerh">trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsstorageindexeddbmoderndeleteobjectstore1expectedtxt">trunk/LayoutTests/storage/indexeddb/modern/deleteobjectstore-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmoderndeleteobjectstore1html">trunk/LayoutTests/storage/indexeddb/modern/deleteobjectstore-1.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbdatabasedeleteobjectstorefailuresexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/idbdatabase-deleteobjectstore-failures-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbdatabasedeleteobjectstorefailureshtml">trunk/LayoutTests/storage/indexeddb/modern/idbdatabase-deleteobjectstore-failures.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetfailuresexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-get-failures-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetfailureshtml">trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-get-failures.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/LayoutTests/ChangeLog        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-10-29 Brady Eidson <beidson@apple.com>
+
+ Modern IDB: deleteObjectStore support.
+ https://bugs.webkit.org/show_bug.cgi?id=150673
+
+ Reviewed by Alex Christensen.
+
+ * storage/indexeddb/modern/deleteobjectstore-1-expected.txt: Added.
+ * storage/indexeddb/modern/deleteobjectstore-1.html: Added.
+ * storage/indexeddb/modern/idbdatabase-deleteobjectstore-failures-expected.txt: Added.
+ * storage/indexeddb/modern/idbdatabase-deleteobjectstore-failures.html: Added.
+ * storage/indexeddb/modern/idbobjectstore-get-failures-expected.txt: Added.
+ * storage/indexeddb/modern/idbobjectstore-get-failures.html: Added.
+
</ins><span class="cx"> 2015-10-29 Wenson Hsieh <wenson_hsieh@apple.com>
</span><span class="cx">
</span><span class="cx"> Date input values should not overlap with menu list dropdown button on iOS
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmoderndeleteobjectstore1expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/deleteobjectstore-1-expected.txt (0 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/deleteobjectstore-1-expected.txt         (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/deleteobjectstore-1-expected.txt        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+ALERT: Initial upgrade needed: Old version - 0 New version - 1
+ALERT: Initial upgrade versionchange transaction complete
+ALERT: Second upgrade needed: Old version - 1 New version - 2
+ALERT: Deleting object store
+ALERT: Second version change transaction abort
+ALERT: Success opening database connection - Starting final transaction
+ALERT: Value gotten was AH AH AH AH AH
+ALERT: Value gotten was AH AH AH AH AH
+ALERT: Value gotten was AH AH AH AH AH
+ALERT: Value gotten was AH AH AH AH AH
+ALERT: Value gotten was AH AH AH AH AH
+ALERT: Value gotten was AH AH AH AH AH
+ALERT: Value gotten was AH AH AH AH AH
+ALERT: Value gotten was AH AH AH AH AH
+ALERT: Value gotten was AH AH AH AH AH
+ALERT: Value gotten was AH AH AH AH AH
+ALERT: Final transaction complete
+ALERT: Done
+This test creates an object store then populates it, then commits that transaction.
+It then deletes it, but aborts that transaction.
+Finally it checks to make sure everything from step 1 is there as expected.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmoderndeleteobjectstore1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/deleteobjectstore-1.html (0 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/deleteobjectstore-1.html         (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/deleteobjectstore-1.html        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -0,0 +1,141 @@
</span><ins>+This test creates an object store then populates it, then commits that transaction.<br>
+It then deletes it, but aborts that transaction.<br>
+Finally it checks to make sure everything from step 1 is there as expected.<br>
+<script>
+
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
+
+function done()
+{
+ alert("Done");
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+var createRequest = window.indexedDB.open("DeleteObjectStore1Database", 1);
+
+createRequest.onupgradeneeded = function(event) {
+ alert("Initial upgrade needed: Old version - " + event.oldVersion + " New version - " + event.newVersion);
+
+ var versionTransaction = createRequest.transaction;
+ var database = event.target.result;
+ var objectStore = database.createObjectStore("TestObjectStore");
+ for (var i = 0; i < 10; ++i)
+ objectStore.put("AH AH AH AH AH", i + " puts");
+
+ versionTransaction.onabort = function(event) {
+ alert("Initial upgrade versionchange transaction unexpected aborted");
+ done();
+ }
+
+ versionTransaction.oncomplete = function(event) {
+ alert("Initial upgrade versionchange transaction complete");
+ continueTest1();
+ database.close();
+ }
+
+ versionTransaction.onerror = function(event) {
+ alert("Initial upgrade versionchange transaction unexpected error" + event);
+ done();
+ }
+}
+
+function getChecker(event) {
+ alert("Value gotten was " + event.target.result);
+}
+
+function continueTest1()
+{
+ var openRequest = window.indexedDB.open("DeleteObjectStore1Database", 2);
+
+ openRequest.onerror = function(event) {
+ alert("Request unexpected error - " + event);
+ done();
+ }
+ openRequest.onblocked = function(event) {
+ alert("Request unexpected blocked - " + event);
+ done();
+ }
+ openRequest.onsuccess = function(event) {
+ alert("Request unexpected success - " + event);
+ done();
+ }
+
+ openRequest.onupgradeneeded = function(event) {
+ alert("Second upgrade needed: Old version - " + event.oldVersion + " New version - " + event.newVersion);
+ var versionTransaction = openRequest.transaction;
+ var database = event.target.result;
+ var objectStore = versionTransaction.objectStore("TestObjectStore");
+
+ alert("Deleting object store");
+ database.deleteObjectStore("TestObjectStore");
+
+ versionTransaction.abort();
+
+ versionTransaction.onabort = function(event) {
+ alert("Second version change transaction abort");
+ continueTest2();
+ database.close();
+ }
+
+ versionTransaction.oncomplete = function(event) {
+ alert("Second version change transaction unexpected complete");
+ done();
+ }
+
+ versionTransaction.onerror = function(event) {
+ alert("Second version change transaction unexpected error - " + event);
+ done();
+ }
+ }
+}
+
+function continueTest2()
+{
+ var openRequest = window.indexedDB.open("DeleteObjectStore1Database", 1);
+
+ openRequest.onerror = function(event) {
+ alert("Request unexpected error - " + event);
+ done();
+ }
+ openRequest.onblocked = function(event) {
+ alert("Request unexpected blocked - " + event);
+ done();
+ }
+ openRequest.onupgradeneeded = function(event) {
+ alert("Request unexpected upgradeneeded - " + event);
+ done();
+ }
+
+ openRequest.onsuccess = function(event) {
+ alert("Success opening database connection - Starting final transaction");
+ var database = event.target.result;
+ var transaction = database.transaction("TestObjectStore", "readwrite");
+ var objectStore = transaction.objectStore("TestObjectStore");
+
+ var request;
+ for (var i = 0; i < 10; ++i) {
+ request = objectStore.get(i + " puts");
+ request.onsuccess = getChecker;
+ }
+
+ transaction.onabort = function(event) {
+ alert("Final transaction unexpected abort");
+ done();
+ }
+
+ transaction.oncomplete = function(event) {
+ alert("Final transaction complete");
+ done();
+ }
+
+ transaction.onerror = function(event) {
+ alert("Final transaction unexpected error - " + event);
+ done();
+ }
+ }
+}
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbdatabasedeleteobjectstorefailuresexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbdatabase-deleteobjectstore-failures-expected.txt (0 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbdatabase-deleteobjectstore-failures-expected.txt         (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbdatabase-deleteobjectstore-failures-expected.txt        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+ALERT: Initial upgrade needed: Old version - 0 New version - 1
+ALERT: Initial upgrade versionchange transaction complete
+ALERT: readwrite put success - about to try to delete an objectstore
+ALERT: Failed to deleteObjectStore without a versionchange transaction - Error: InvalidStateError: DOM Exception 11
+ALERT: readwrite transaction complete
+ALERT: Second upgrade needed: Old version - 1 New version - 2
+ALERT: Failed to deleteObjectStore with a non-existent objectstore - Error: NotFoundError: DOM IDBDatabase Exception 8
+ALERT: Failed to deleteObjectStore with an in-progress versionchange transaction that is inactive - Error: TransactionInactiveError: DOM IDBDatabase Exception 0
+ALERT: Second version change transaction complete
+ALERT: Done
+This tests some obvious failures that can happen while calling IDBDatabase.deleteObjectStore()
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbdatabasedeleteobjectstorefailureshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbdatabase-deleteobjectstore-failures.html (0 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbdatabase-deleteobjectstore-failures.html         (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbdatabase-deleteobjectstore-failures.html        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -0,0 +1,137 @@
</span><ins>+This tests some obvious failures that can happen while calling IDBDatabase.deleteObjectStore()
+<script>
+
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
+
+function done()
+{
+ alert("Done");
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+var createRequest = window.indexedDB.open("IDBDatabaseDeleteObjectStoreFailuresDatabase", 1);
+var database;
+
+createRequest.onupgradeneeded = function(event) {
+ alert("Initial upgrade needed: Old version - " + event.oldVersion + " New version - " + event.newVersion);
+
+ var versionTransaction = createRequest.transaction;
+ database = event.target.result;
+ var objectStore = database.createObjectStore("TestObjectStore");
+ var request = objectStore.put("bar", "foo");
+
+ versionTransaction.onabort = function(event) {
+ alert("Initial upgrade versionchange transaction unexpected aborted");
+ done();
+ }
+
+ versionTransaction.oncomplete = function(event) {
+ alert("Initial upgrade versionchange transaction complete");
+ continueTest1();
+ }
+
+ versionTransaction.onerror = function(event) {
+ alert("Initial upgrade versionchange transaction unexpected error" + event);
+ done();
+ }
+}
+
+function continueTest1()
+{
+ var transaction = database.transaction("TestObjectStore", "readwrite");
+ var objectStore = transaction.objectStore("TestObjectStore");
+ var request = objectStore.put("baz", "foo");
+
+ request.onsuccess = function() {
+ alert("readwrite put success - about to try to delete an objectstore");
+ try {
+ database.deleteObjectStore("TestObjectStore");
+ } catch(e) {
+ alert("Failed to deleteObjectStore without a versionchange transaction - " + e);
+ }
+ }
+
+ transaction.onabort = function(event) {
+ alert("readwrite transaction unexpected aborted");
+ done();
+ }
+
+ transaction.oncomplete = function(event) {
+ alert("readwrite transaction complete");
+ continueTest2();
+ database.close();
+ }
+
+ transaction.onerror = function(event) {
+ alert("readwrite transaction unexpected error" + event);
+ done();
+ }
+}
+
+function continueTest2()
+{
+ var openRequest = window.indexedDB.open("IDBDatabaseDeleteObjectStoreFailuresDatabase", 2);
+
+ openRequest.onerror = function(event) {
+ alert("Request unexpected error - " + event);
+ done();
+ }
+ openRequest.onblocked = function(event) {
+ alert("Request unexpected blocked - " + event);
+ done();
+ }
+ openRequest.onsuccess = function(event) {
+ alert("Request unexpected success - " + event);
+ done();
+ }
+
+ openRequest.onupgradeneeded = function(event) {
+ alert("Second upgrade needed: Old version - " + event.oldVersion + " New version - " + event.newVersion);
+
+ var versionTransaction = openRequest.transaction;
+ database = event.target.result;
+
+ try {
+ database.deleteObjectStore("NonexistentObjectStore");
+ } catch(e) {
+ alert("Failed to deleteObjectStore with a non-existent objectstore - " + e);
+ }
+
+ // Queue up a whole bunch of puts to keep the transaction alive for awhile
+ var objectStore = versionTransaction.objectStore("TestObjectStore");
+ for (var i = 0; i < 10; ++i)
+ objectStore.put("AH AH AH AH AH", i + " puts");
+
+ // After the versionChange transaction becomes inactive, but while it's still in-progress, try to delete the objectstore
+ var tryInactiveDelete = function()
+ {
+ try {
+ database.deleteObjectStore("TestObjectStore");
+ } catch(e) {
+ alert("Failed to deleteObjectStore with an in-progress versionchange transaction that is inactive - " + e);
+ }
+ }
+
+ setTimeout(tryInactiveDelete, 0);
+
+ versionTransaction.onabort = function(event) {
+ alert("Second version change transaction unexpected abort");
+ done();
+ }
+
+ versionTransaction.oncomplete = function(event) {
+ alert("Second version change transaction complete");
+ done();
+ }
+
+ versionTransaction.onerror = function(event) {
+ alert("Second version change transaction unexpected error - " + event);
+ done();
+ }
+ }
+}
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetfailuresexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-get-failures-expected.txt (0 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-get-failures-expected.txt         (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-get-failures-expected.txt        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+ALERT: Initial upgrade needed: Old version - 0 New version - 1
+ALERT: Failed to get record from object store with an invalid key
+ALERT: Failed to get record from object store that has been deleted
+ALERT: Initial upgrade versionchange transaction complete
+ALERT: Failed to get record from object store while the transaction is inactive
+ALERT: readonly transaction complete
+ALERT: Done
+This tests some obvious failures that can happen while calling IDBObjectStore.get().
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbobjectstoregetfailureshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-get-failures.html (0 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-get-failures.html         (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-get-failures.html        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -0,0 +1,98 @@
</span><ins>+This tests some obvious failures that can happen while calling IDBObjectStore.get().
+<script>
+
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
+
+function done()
+{
+ alert("Done");
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+var createRequest = window.indexedDB.open("IDBObjectStoreGetFailuresDatabase", 1);
+var database;
+
+createRequest.onupgradeneeded = function(event) {
+ alert("Initial upgrade needed: Old version - " + event.oldVersion + " New version - " + event.newVersion);
+
+ var versionTransaction = createRequest.transaction;
+ database = event.target.result;
+ var objectStore = database.createObjectStore("TestObjectStore");
+ var request = objectStore.put("bar", "foo");
+
+ request.onsuccess = function() {
+ try {
+ objectStore.get(NaN);
+ } catch(e) {
+ alert("Failed to get record from object store with an invalid key");
+ }
+
+ database.deleteObjectStore("TestObjectStore");
+
+ try {
+ objectStore.get("foo");
+ } catch(e) {
+ alert("Failed to get record from object store that has been deleted");
+ }
+
+ // Recreate the objectstore because we'll need it in phase 2.
+ var objectStore = database.createObjectStore("TestObjectStore");
+ objectStore.put("bar", "foo");
+ }
+
+ versionTransaction.onabort = function(event) {
+ alert("Initial upgrade versionchange transaction unexpected aborted");
+ done();
+ }
+
+ versionTransaction.oncomplete = function(event) {
+ alert("Initial upgrade versionchange transaction complete");
+ continueTest1();
+ }
+
+ versionTransaction.onerror = function(event) {
+ alert("Initial upgrade versionchange transaction unexpected error" + event);
+ done();
+ }
+}
+
+function continueTest1()
+{
+ var transaction = database.transaction("TestObjectStore", "readonly");
+ var objectStore = transaction.objectStore("TestObjectStore");
+
+ // Queue up a whole bunch of gets to keep the transaction alive for awhile
+ for (var i = 0; i < 10; ++i)
+ objectStore.get("foo");
+
+ var getWhileInactive = function() {
+ try {
+ objectStore.get("foo");
+ } catch(e) {
+ alert("Failed to get record from object store while the transaction is inactive");
+ }
+ }
+
+ setTimeout(getWhileInactive, 0);
+
+ transaction.onabort = function(event) {
+ alert("readonly transaction unexpected abort" + event);
+ done();
+ }
+
+ transaction.oncomplete = function(event) {
+ alert("readonly transaction complete");
+ done();
+ }
+
+ transaction.onerror = function(event) {
+ alert("readonly transaction unexpected error" + event);
+ done();
+ }
+}
+
+</script>
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2015-10-29 Brady Eidson <beidson@apple.com>
+
+ Modern IDB: deleteObjectStore support.
+ https://bugs.webkit.org/show_bug.cgi?id=150673
+
+ Reviewed by Alex Christensen.
+
+ * runtime/VM.h:
+
</ins><span class="cx"> 2015-10-29 Mark Lam <mark.lam@apple.com>
</span><span class="cx">
</span><span class="cx"> cdjs-tests.yaml/main.js.ftl fails due to FTL ArithSub code for supporting UntypedUse operands.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.h (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.h        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/JavaScriptCore/runtime/VM.h        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -556,7 +556,7 @@
</span><span class="cx"> JSLock& apiLock() { return *m_apiLock; }
</span><span class="cx"> CodeCache* codeCache() { return m_codeCache.get(); }
</span><span class="cx">
</span><del>- void whenIdle(std::function<void()>);
</del><ins>+ JS_EXPORT_PRIVATE void whenIdle(std::function<void()>);
</ins><span class="cx">
</span><span class="cx"> JS_EXPORT_PRIVATE void deleteAllCode();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/ChangeLog        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -1,3 +1,106 @@
</span><ins>+2015-10-29 Brady Eidson <beidson@apple.com>
+
+ Modern IDB: deleteObjectStore support.
+ https://bugs.webkit.org/show_bug.cgi?id=150673
+
+ Reviewed by Alex Christensen.
+
+ Tests: storage/indexeddb/modern/deleteobjectstore-1.html
+ storage/indexeddb/modern/idbdatabase-deleteobjectstore-failures.html
+ storage/indexeddb/modern/idbobjectstore-get-failures.html
+
+ * Modules/indexeddb/client/IDBConnectionToServer.cpp:
+ (WebCore::IDBClient::IDBConnectionToServer::deleteObjectStore):
+ (WebCore::IDBClient::IDBConnectionToServer::didDeleteObjectStore):
+ * Modules/indexeddb/client/IDBConnectionToServer.h:
+ * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
+
+ * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
+ (WebCore::IDBClient::IDBDatabase::deleteObjectStore):
+ (WebCore::IDBClient::IDBDatabase::willCommitTransaction):
+ (WebCore::IDBClient::IDBDatabase::willAbortTransaction):
+ (WebCore::IDBClient::IDBDatabase::commitTransaction): Deleted.
+ (WebCore::IDBClient::IDBDatabase::abortTransaction): Deleted.
+ * Modules/indexeddb/client/IDBDatabaseImpl.h:
+
+ * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
+ (WebCore::IDBClient::IDBObjectStore::markAsDeleted):
+ * Modules/indexeddb/client/IDBObjectStoreImpl.h:
+
+ * Modules/indexeddb/client/IDBTransactionImpl.cpp:
+ (WebCore::IDBClient::IDBTransaction::IDBTransaction):
+ (WebCore::IDBClient::IDBTransaction::abort):
+ (WebCore::IDBClient::IDBTransaction::abortOnServer):
+ (WebCore::IDBClient::IDBTransaction::commit):
+ (WebCore::IDBClient::IDBTransaction::commitOnServer):
+ (WebCore::IDBClient::IDBTransaction::deleteObjectStore):
+ (WebCore::IDBClient::IDBTransaction::deleteObjectStoreOnServer):
+ (WebCore::IDBClient::IDBTransaction::didDeleteObjectStoreOnServer):
+ (WebCore::IDBClient::IDBTransaction::activate):
+ (WebCore::IDBClient::IDBTransaction::activationTimerFired): Deleted.
+ (WebCore::IDBClient::IDBTransaction::createObjectStoreOnServer): Deleted.
+ (WebCore::IDBClient::IDBTransaction::didCreateObjectStoreOnServer): Deleted.
+ (WebCore::IDBClient::IDBTransaction::getRecordOnServer): Deleted.
+ (WebCore::IDBClient::IDBTransaction::putOrAddOnServer): Deleted.
+ * Modules/indexeddb/client/IDBTransactionImpl.h:
+
+ * Modules/indexeddb/client/TransactionOperation.h:
+ (WebCore::IDBClient::TransactionOperation::completed):
+ (WebCore::IDBClient::createTransactionOperation):
+
+ * Modules/indexeddb/server/IDBBackingStore.h:
+
+ * Modules/indexeddb/server/IDBConnectionToClient.cpp:
+ (WebCore::IDBServer::IDBConnectionToClient::didDeleteObjectStore):
+ * Modules/indexeddb/server/IDBConnectionToClient.h:
+ * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
+
+ * Modules/indexeddb/server/IDBServer.cpp:
+ (WebCore::IDBServer::IDBServer::deleteObjectStore):
+ * Modules/indexeddb/server/IDBServer.h:
+
+ * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
+ (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreDeleted):
+ (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
+ (WebCore::IDBServer::MemoryBackingStoreTransaction::finish):
+ * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
+
+ * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
+ (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
+ (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
+ (WebCore::IDBServer::MemoryIDBBackingStore::restoreObjectStoreForVersionChangeAbort):
+ (WebCore::IDBServer::MemoryIDBBackingStore::takeObjectStoreByName):
+ * Modules/indexeddb/server/MemoryIDBBackingStore.h:
+
+ * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+ (WebCore::IDBServer::UniqueIDBDatabase::performCreateObjectStore):
+ (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
+ (WebCore::IDBServer::UniqueIDBDatabase::performDeleteObjectStore):
+ (WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteObjectStore):
+ (WebCore::IDBServer::UniqueIDBDatabase::createObjectStore): Deleted.
+ * Modules/indexeddb/server/UniqueIDBDatabase.h:
+
+ * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
+ (WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteObjectStore):
+ * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
+
+ * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
+ (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteObjectStore):
+ * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
+
+ * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
+ (WebCore::IDBDatabaseInfo::deleteObjectStore):
+ * Modules/indexeddb/shared/IDBDatabaseInfo.h:
+
+ * Modules/indexeddb/shared/IDBResultData.cpp:
+ (WebCore::IDBResultData::deleteObjectStoreSuccess):
+ * Modules/indexeddb/shared/IDBResultData.h:
+
+ * Modules/indexeddb/shared/InProcessIDBServer.cpp:
+ (WebCore::InProcessIDBServer::didDeleteObjectStore):
+ (WebCore::InProcessIDBServer::deleteObjectStore):
+ * Modules/indexeddb/shared/InProcessIDBServer.h:
+
</ins><span class="cx"> 2015-10-29 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><span class="cx"> Very slow typing on pages with wheel event handlers on the body, and deep content
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -109,6 +109,21 @@
</span><span class="cx"> completeOperation(resultData);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBConnectionToServer::deleteObjectStore(TransactionOperation& operation, const String& objectStoreName)
+{
+ LOG(IndexedDB, "IDBConnectionToServer::deleteObjectStore");
+
+ saveOperation(operation);
+
+ m_delegate->deleteObjectStore(IDBRequestData(operation), objectStoreName);
+}
+
+void IDBConnectionToServer::didDeleteObjectStore(const IDBResultData& resultData)
+{
+ LOG(IndexedDB, "IDBConnectionToServer::didDeleteObjectStore");
+ completeOperation(resultData);
+}
+
</ins><span class="cx"> void IDBConnectionToServer::putOrAdd(TransactionOperation& operation, RefPtr<IDBKey>& key, RefPtr<SerializedScriptValue>& value, const IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBConnectionToServer::putOrAdd");
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -64,6 +64,9 @@
</span><span class="cx"> void createObjectStore(TransactionOperation&, const IDBObjectStoreInfo&);
</span><span class="cx"> void didCreateObjectStore(const IDBResultData&);
</span><span class="cx">
</span><ins>+ void deleteObjectStore(TransactionOperation&, const String& objectStoreName);
+ void didDeleteObjectStore(const IDBResultData&);
+
</ins><span class="cx"> void putOrAdd(TransactionOperation&, RefPtr<IDBKey>&, RefPtr<SerializedScriptValue>&, const IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx"> void didPutOrAdd(const IDBResultData&);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerDelegateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -28,6 +28,8 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx">
</span><ins>+#include <wtf/text/WTFString.h>
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class IDBKey;
</span><span class="lines">@@ -53,6 +55,7 @@
</span><span class="cx"> virtual void abortTransaction(IDBResourceIdentifier&) = 0;
</span><span class="cx"> virtual void commitTransaction(IDBResourceIdentifier&) = 0;
</span><span class="cx"> virtual void createObjectStore(const IDBRequestData&, const IDBObjectStoreInfo&) = 0;
</span><ins>+ virtual void deleteObjectStore(const IDBRequestData&, const String& objectStoreName) = 0;
</ins><span class="cx"> virtual void putOrAdd(const IDBRequestData&, IDBKey*, SerializedScriptValue&, const IndexedDB::ObjectStoreOverwriteMode) = 0;
</span><span class="cx"> virtual void getRecord(const IDBRequestData&, IDBKey*) = 0;
</span><span class="cx"> virtual void establishTransaction(uint64_t databaseConnectionIdentifier, const IDBTransactionInfo&) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBDatabaseImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -178,9 +178,27 @@
</span><span class="cx"> return transaction(context, objectStores, mode, ec);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void IDBDatabase::deleteObjectStore(const String&, ExceptionCode&)
</del><ins>+void IDBDatabase::deleteObjectStore(const String& objectStoreName, ExceptionCode& ec)
</ins><span class="cx"> {
</span><del>- ASSERT_NOT_REACHED();
</del><ins>+ LOG(IndexedDB, "IDBDatabase::deleteObjectStore");
+
+ if (!m_versionChangeTransaction) {
+ ec = INVALID_STATE_ERR;
+ return;
+ }
+
+ if (!m_versionChangeTransaction->isActive()) {
+ ec = IDBDatabaseException::TransactionInactiveError;
+ return;
+ }
+
+ if (!m_info.hasObjectStore(objectStoreName)) {
+ ec = IDBDatabaseException::NotFoundError;
+ return;
+ }
+
+ m_info.deleteObjectStore(objectStoreName);
+ m_versionChangeTransaction->deleteObjectStore(objectStoreName);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBDatabase::close()
</span><span class="lines">@@ -239,15 +257,13 @@
</span><span class="cx"> m_activeTransactions.set(transaction.info().identifier(), &transaction);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void IDBDatabase::commitTransaction(IDBTransaction& transaction)
</del><ins>+void IDBDatabase::willCommitTransaction(IDBTransaction& transaction)
</ins><span class="cx"> {
</span><del>- LOG(IndexedDB, "IDBDatabase::commitTransaction");
</del><ins>+ LOG(IndexedDB, "IDBDatabase::willCommitTransaction");
</ins><span class="cx">
</span><span class="cx"> auto refTransaction = m_activeTransactions.take(transaction.info().identifier());
</span><span class="cx"> ASSERT(refTransaction);
</span><span class="cx"> m_committingTransactions.set(transaction.info().identifier(), WTF::move(refTransaction));
</span><del>-
- m_serverConnection->commitTransaction(transaction);
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBDatabase::didCommitTransaction(IDBTransaction& transaction)
</span><span class="lines">@@ -260,15 +276,13 @@
</span><span class="cx"> didCommitOrAbortTransaction(transaction);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void IDBDatabase::abortTransaction(IDBTransaction& transaction)
</del><ins>+void IDBDatabase::willAbortTransaction(IDBTransaction& transaction)
</ins><span class="cx"> {
</span><del>- LOG(IndexedDB, "IDBDatabase::abortTransaction");
</del><ins>+ LOG(IndexedDB, "IDBDatabase::willAbortTransaction");
</ins><span class="cx">
</span><span class="cx"> auto refTransaction = m_activeTransactions.take(transaction.info().identifier());
</span><span class="cx"> ASSERT(refTransaction);
</span><span class="cx"> m_abortingTransactions.set(transaction.info().identifier(), WTF::move(refTransaction));
</span><del>-
- m_serverConnection->abortTransaction(transaction);
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBDatabase::didAbortTransaction(IDBTransaction& transaction)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBDatabaseImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.h (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.h        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.h        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -75,9 +75,9 @@
</span><span class="cx"> Ref<IDBTransaction> startVersionChangeTransaction(const IDBTransactionInfo&);
</span><span class="cx"> void didStartTransaction(IDBTransaction&);
</span><span class="cx">
</span><del>- void commitTransaction(IDBTransaction&);
</del><ins>+ void willCommitTransaction(IDBTransaction&);
</ins><span class="cx"> void didCommitTransaction(IDBTransaction&);
</span><del>- void abortTransaction(IDBTransaction&);
</del><ins>+ void willAbortTransaction(IDBTransaction&);
</ins><span class="cx"> void didAbortTransaction(IDBTransaction&);
</span><span class="cx">
</span><span class="cx"> void fireVersionChangeEvent(uint64_t requestedVersion);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBObjectStoreImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -294,6 +294,11 @@
</span><span class="cx"> RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBObjectStore::markAsDeleted()
+{
+ m_deleted = true;
+}
+
</ins><span class="cx"> } // namespace IDBClient
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBObjectStoreImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.h (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.h        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.h        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -75,6 +75,8 @@
</span><span class="cx"> virtual RefPtr<WebCore::IDBRequest> count(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&) override final;
</span><span class="cx"> virtual RefPtr<WebCore::IDBRequest> count(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) override final;
</span><span class="cx">
</span><ins>+ void markAsDeleted();
+
</ins><span class="cx"> const IDBObjectStoreInfo& info() const { return m_info; }
</span><span class="cx">
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include "IDBObjectStore.h"
</span><span class="cx"> #include "IDBRequestImpl.h"
</span><span class="cx"> #include "IDBResultData.h"
</span><ins>+#include "JSDOMWindowBase.h"
</ins><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "ScriptExecutionContext.h"
</span><span class="cx"> #include "TransactionOperation.h"
</span><span class="lines">@@ -58,13 +59,19 @@
</span><span class="cx"> relaxAdoptionRequirement();
</span><span class="cx">
</span><span class="cx"> if (m_info.mode() == IndexedDB::TransactionMode::VersionChange) {
</span><del>- m_activationTimer = std::make_unique<Timer>(*this, &IDBTransaction::activationTimerFired);
- m_activationTimer->startOneShot(0);
</del><span class="cx"> m_originalDatabaseInfo = std::make_unique<IDBDatabaseInfo>(m_database->info());
</span><del>- m_state = IndexedDB::TransactionState::Inactive;
</del><span class="cx"> m_startedOnServer = true;
</span><del>- } else
</del><ins>+ } else {
+ activate();
+
+ RefPtr<IDBTransaction> self;
+ JSC::VM& vm = JSDOMWindowBase::commonVM();
+ vm.whenIdle([self, this]() {
+ deactivate();
+ });
+
</ins><span class="cx"> establishOnServer();
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> suspendIfNeeded();
</span><span class="cx"> }
</span><span class="lines">@@ -157,10 +164,18 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> m_state = IndexedDB::TransactionState::Aborting;
</span><ins>+ m_database->willAbortTransaction(*this);
</ins><span class="cx">
</span><del>- m_database->abortTransaction(*this);
</del><ins>+ auto operation = createTransactionOperation(*this, nullptr, &IDBTransaction::abortOnServer);
+ scheduleOperation(WTF::move(operation));
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBTransaction::abortOnServer(TransactionOperation&)
+{
+ LOG(IndexedDB, "IDBTransaction::abortOnServer");
+ serverConnection().abortTransaction(*this);
+}
+
</ins><span class="cx"> const char* IDBTransaction::activeDOMObjectName() const
</span><span class="cx"> {
</span><span class="cx"> return "IDBTransaction";
</span><span class="lines">@@ -191,12 +206,6 @@
</span><span class="cx"> || m_state == IndexedDB::TransactionState::Finished;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void IDBTransaction::activationTimerFired()
-{
- scheduleOperationTimer();
- m_activationTimer = nullptr;
-}
-
</del><span class="cx"> void IDBTransaction::scheduleOperation(RefPtr<TransactionOperation>&& operation)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!m_transactionOperationMap.contains(operation->identifier()));
</span><span class="lines">@@ -235,14 +244,21 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::commit");
</span><span class="cx">
</span><del>- if (isFinishedOrFinishing())
- return;
</del><ins>+ ASSERT(!isFinishedOrFinishing());
</ins><span class="cx">
</span><span class="cx"> m_state = IndexedDB::TransactionState::Committing;
</span><ins>+ m_database->willCommitTransaction(*this);
</ins><span class="cx">
</span><del>- m_database->commitTransaction(*this);
</del><ins>+ auto operation = createTransactionOperation(*this, nullptr, &IDBTransaction::commitOnServer);
+ scheduleOperation(WTF::move(operation));
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBTransaction::commitOnServer(TransactionOperation&)
+{
+ LOG(IndexedDB, "IDBTransaction::commitOnServer");
+ serverConnection().commitTransaction(*this);
+}
+
</ins><span class="cx"> void IDBTransaction::finishAbortOrCommit()
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_state != IndexedDB::TransactionState::Finished);
</span><span class="lines">@@ -359,9 +375,6 @@
</span><span class="cx">
</span><span class="cx"> ASSERT(isVersionChange());
</span><span class="cx">
</span><del>- if (isFinishedOrFinishing())
- return;
-
</del><span class="cx"> m_database->serverConnection().createObjectStore(operation, info);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -370,8 +383,6 @@
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::didCreateObjectStoreOnServer");
</span><span class="cx">
</span><span class="cx"> ASSERT_UNUSED(resultData, resultData.type() == IDBResultType::CreateObjectStoreSuccess);
</span><del>-
- scheduleOperationTimer();
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Ref<IDBRequest> IDBTransaction::requestGetRecord(ScriptExecutionContext& context, IDBObjectStore& objectStore, IDBKey& key)
</span><span class="lines">@@ -392,8 +403,6 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::getRecordOnServer");
</span><span class="cx">
</span><del>- ASSERT(!isFinishedOrFinishing());
-
</del><span class="cx"> serverConnection().getRecord(operation, key);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -424,7 +433,6 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::putOrAddOnServer");
</span><span class="cx">
</span><del>- ASSERT(!isFinishedOrFinishing());
</del><span class="cx"> ASSERT(!isReadOnly());
</span><span class="cx">
</span><span class="cx"> serverConnection().putOrAdd(operation, key, value, overwriteMode);
</span><span class="lines">@@ -438,6 +446,33 @@
</span><span class="cx"> request.requestCompleted(resultData);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBTransaction::deleteObjectStore(const String& objectStoreName)
+{
+ LOG(IndexedDB, "IDBTransaction::deleteObjectStore");
+
+ ASSERT(isVersionChange());
+
+ if (auto objectStore = m_referencedObjectStores.take(objectStoreName))
+ objectStore->markAsDeleted();
+
+ auto operation = createTransactionOperation(*this, &IDBTransaction::didDeleteObjectStoreOnServer, &IDBTransaction::deleteObjectStoreOnServer, objectStoreName);
+ scheduleOperation(WTF::move(operation));
+}
+
+void IDBTransaction::deleteObjectStoreOnServer(TransactionOperation& operation, const String& objectStoreName)
+{
+ LOG(IndexedDB, "IDBTransaction::deleteObjectStoreOnServer");
+ ASSERT(isVersionChange());
+
+ serverConnection().deleteObjectStore(operation, objectStoreName);
+}
+
+void IDBTransaction::didDeleteObjectStoreOnServer(const IDBResultData& resultData)
+{
+ LOG(IndexedDB, "IDBTransaction::didDeleteObjectStoreOnServer");
+ ASSERT_UNUSED(resultData, resultData.type() == IDBResultType::DeleteObjectStoreSuccess);
+}
+
</ins><span class="cx"> void IDBTransaction::establishOnServer()
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::establishOnServer");
</span><span class="lines">@@ -447,7 +482,9 @@
</span><span class="cx">
</span><span class="cx"> void IDBTransaction::activate()
</span><span class="cx"> {
</span><del>- ASSERT(!isFinishedOrFinishing());
</del><ins>+ if (isFinishedOrFinishing())
+ return;
+
</ins><span class="cx"> m_state = IndexedDB::TransactionState::Active;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -90,11 +90,15 @@
</span><span class="cx"> Ref<IDBRequest> requestPutOrAdd(ScriptExecutionContext&, IDBObjectStore&, IDBKey*, SerializedScriptValue&, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx"> Ref<IDBRequest> requestGetRecord(ScriptExecutionContext&, IDBObjectStore&, IDBKey&);
</span><span class="cx">
</span><ins>+ void deleteObjectStore(const String& objectStoreName);
+
</ins><span class="cx"> IDBConnectionToServer& serverConnection();
</span><span class="cx">
</span><span class="cx"> void activate();
</span><span class="cx"> void deactivate();
</span><span class="cx">
</span><ins>+ void scheduleOperationTimer();
+
</ins><span class="cx"> private:
</span><span class="cx"> IDBTransaction(IDBDatabase&, const IDBTransactionInfo&);
</span><span class="cx">
</span><span class="lines">@@ -105,14 +109,15 @@
</span><span class="cx"> void finishAbortOrCommit();
</span><span class="cx">
</span><span class="cx"> void scheduleOperation(RefPtr<TransactionOperation>&&);
</span><del>- void scheduleOperationTimer();
</del><span class="cx"> void operationTimerFired();
</span><del>- void activationTimerFired();
</del><span class="cx">
</span><span class="cx"> void fireOnComplete();
</span><span class="cx"> void fireOnAbort();
</span><span class="cx"> void enqueueEvent(Ref<Event>);
</span><span class="cx">
</span><ins>+ void commitOnServer(TransactionOperation&);
+ void abortOnServer(TransactionOperation&);
+
</ins><span class="cx"> void createObjectStoreOnServer(TransactionOperation&, const IDBObjectStoreInfo&);
</span><span class="cx"> void didCreateObjectStoreOnServer(const IDBResultData&);
</span><span class="cx">
</span><span class="lines">@@ -122,13 +127,16 @@
</span><span class="cx"> void getRecordOnServer(TransactionOperation&, RefPtr<IDBKey>);
</span><span class="cx"> void didGetRecordOnServer(IDBRequest&, const IDBResultData&);
</span><span class="cx">
</span><ins>+ void deleteObjectStoreOnServer(TransactionOperation&, const String& objectStoreName);
+ void didDeleteObjectStoreOnServer(const IDBResultData&);
+
</ins><span class="cx"> void establishOnServer();
</span><span class="cx">
</span><span class="cx"> Ref<IDBDatabase> m_database;
</span><span class="cx"> IDBTransactionInfo m_info;
</span><span class="cx"> std::unique_ptr<IDBDatabaseInfo> m_originalDatabaseInfo;
</span><span class="cx">
</span><del>- IndexedDB::TransactionState m_state { IndexedDB::TransactionState::Active };
</del><ins>+ IndexedDB::TransactionState m_state { IndexedDB::TransactionState::Inactive };
</ins><span class="cx"> bool m_startedOnServer { false };
</span><span class="cx">
</span><span class="cx"> IDBError m_idbError;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientTransactionOperationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> void completed(const IDBResultData& data)
</span><span class="cx"> {
</span><span class="cx"> m_completeFunction(data);
</span><ins>+ m_transaction->scheduleOperationTimer();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const IDBResourceIdentifier& identifier() const { return m_identifier; }
</span><span class="lines">@@ -84,7 +85,8 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> m_completeFunction = [self, this, completeMethod](const IDBResultData& resultData) {
</span><del>- (&m_transaction.get()->*completeMethod)(resultData);
</del><ins>+ if (completeMethod)
+ (&m_transaction.get()->*completeMethod)(resultData);
</ins><span class="cx"> };
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -100,11 +102,21 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<IDBRequest> refRequest(&request);
</span><span class="cx"> m_completeFunction = [self, this, refRequest, completeMethod](const IDBResultData& resultData) {
</span><del>- (&m_transaction.get()->*completeMethod)(*refRequest, resultData);
</del><ins>+ if (completeMethod)
+ (&m_transaction.get()->*completeMethod)(*refRequest, resultData);
</ins><span class="cx"> };
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+inline RefPtr<TransactionOperation> createTransactionOperation(
+ IDBTransaction& transaction,
+ void (IDBTransaction::*complete)(const IDBResultData&),
+ void (IDBTransaction::*perform)(TransactionOperation&))
+{
+ auto operation = new TransactionOperationImpl<>(transaction, complete, perform);
+ return adoptRef(operation);
+}
+
</ins><span class="cx"> template<typename MP1, typename P1>
</span><span class="cx"> RefPtr<TransactionOperation> createTransactionOperation(
</span><span class="cx"> IDBTransaction& transaction,
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -52,6 +52,7 @@
</span><span class="cx"> virtual IDBError commitTransaction(const IDBResourceIdentifier& transactionIdentifier) = 0;
</span><span class="cx">
</span><span class="cx"> virtual IDBError createObjectStore(const IDBResourceIdentifier& transactionIdentifier, const IDBObjectStoreInfo&) = 0;
</span><ins>+ virtual IDBError deleteObjectStore(const IDBResourceIdentifier& transactionIdentifier, const String& objectStoreName) = 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 deleteRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&) = 0;
</span><span class="cx"> virtual IDBError putRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, const ThreadSafeDataBuffer& value) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -68,6 +68,11 @@
</span><span class="cx"> m_delegate->didCreateObjectStore(result);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBConnectionToClient::didDeleteObjectStore(const IDBResultData& result)
+{
+ m_delegate->didDeleteObjectStore(result);
+}
+
</ins><span class="cx"> void IDBConnectionToClient::didPutOrAdd(const IDBResultData& result)
</span><span class="cx"> {
</span><span class="cx"> m_delegate->didPutOrAdd(result);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx"> void didAbortTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError&);
</span><span class="cx"> void didCommitTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError&);
</span><span class="cx"> void didCreateObjectStore(const IDBResultData&);
</span><ins>+ void didDeleteObjectStore(const IDBResultData&);
</ins><span class="cx"> void didPutOrAdd(const IDBResultData&);
</span><span class="cx"> void didGetRecord(const IDBResultData&);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClientDelegateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx"> virtual void didAbortTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError&) = 0;
</span><span class="cx"> virtual void didCommitTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError&) = 0;
</span><span class="cx"> virtual void didCreateObjectStore(const IDBResultData&) = 0;
</span><ins>+ virtual void didDeleteObjectStore(const IDBResultData&) = 0;
</ins><span class="cx"> virtual void didPutOrAdd(const IDBResultData&) = 0;
</span><span class="cx"> virtual void didGetRecord(const IDBResultData&) = 0;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -168,6 +168,18 @@
</span><span class="cx"> transaction->createObjectStore(requestData, info);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBServer::deleteObjectStore(const IDBRequestData& requestData, const String& objectStoreName)
+{
+ LOG(IndexedDB, "IDBServer::deleteObjectStore");
+
+ auto transaction = m_transactions.get(requestData.transactionIdentifier());
+ if (!transaction)
+ return;
+
+ ASSERT(transaction->isVersionChange());
+ transaction->deleteObjectStore(requestData, objectStoreName);
+}
+
</ins><span class="cx"> void IDBServer::putOrAdd(const IDBRequestData& requestData, const IDBKeyData& keyData, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBServer::putOrAdd");
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx"> void abortTransaction(const IDBResourceIdentifier&);
</span><span class="cx"> void commitTransaction(const IDBResourceIdentifier&);
</span><span class="cx"> void createObjectStore(const IDBRequestData&, const IDBObjectStoreInfo&);
</span><ins>+ void deleteObjectStore(const IDBRequestData&, const String& objectStoreName);
</ins><span class="cx"> void putOrAdd(const IDBRequestData&, const IDBKeyData&, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx"> void getRecord(const IDBRequestData&, const IDBKeyData&);
</span><span class="cx"> void establishTransaction(uint64_t databaseConnectionIdentifier, const IDBTransactionInfo&);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryBackingStoreTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -80,6 +80,17 @@
</span><span class="cx"> objectStore.writeTransactionStarted(*this);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void MemoryBackingStoreTransaction::objectStoreDeleted(std::unique_ptr<MemoryObjectStore> objectStore)
+{
+ ASSERT(objectStore);
+ ASSERT(m_objectStores.contains(objectStore.get()));
+ m_objectStores.remove(objectStore.get());
+
+ auto addResult = m_deletedObjectStores.add(objectStore->info().name(), nullptr);
+ if (addResult.isNewEntry)
+ addResult.iterator->value = WTF::move(objectStore);
+}
+
</ins><span class="cx"> void MemoryBackingStoreTransaction::recordValueChanged(MemoryObjectStore& objectStore, const IDBKeyData& key)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_objectStores.contains(&objectStore));
</span><span class="lines">@@ -106,6 +117,19 @@
</span><span class="cx">
</span><span class="cx"> TemporaryChange<bool> change(m_isAborting, true);
</span><span class="cx">
</span><ins>+ // This loop moves the underlying unique_ptrs from out of the m_deleteObjectStores map,
+ // but the entries in the map still remain.
+ for (auto& objectStore : m_deletedObjectStores.values()) {
+ MemoryObjectStore* rawObjectStore = objectStore.get();
+ m_backingStore.restoreObjectStoreForVersionChangeAbort(WTF::move(objectStore));
+
+ ASSERT(!m_objectStores.contains(rawObjectStore));
+ m_objectStores.add(rawObjectStore);
+ }
+
+ // This clears the entries from the map.
+ m_deletedObjectStores.clear();
+
</ins><span class="cx"> if (m_originalDatabaseInfo) {
</span><span class="cx"> ASSERT(m_info.mode() == IndexedDB::TransactionMode::VersionChange);
</span><span class="cx"> m_backingStore.setDatabaseInfo(*m_originalDatabaseInfo);
</span><span class="lines">@@ -145,8 +169,10 @@
</span><span class="cx"> if (!isWriting())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- for (auto objectStore : m_objectStores)
</del><ins>+ for (auto& objectStore : m_objectStores)
</ins><span class="cx"> objectStore->writeTransactionFinished(*this);
</span><ins>+ for (auto& objectStore : m_deletedObjectStores.values())
+ objectStore->writeTransactionFinished(*this);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace IDBServer
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryBackingStoreTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -58,6 +58,7 @@
</span><span class="cx"> void addNewObjectStore(MemoryObjectStore&);
</span><span class="cx"> void addExistingObjectStore(MemoryObjectStore&);
</span><span class="cx"> void recordValueChanged(MemoryObjectStore&, const IDBKeyData&);
</span><ins>+ void objectStoreDeleted(std::unique_ptr<MemoryObjectStore>);
</ins><span class="cx">
</span><span class="cx"> void abort();
</span><span class="cx"> void commit();
</span><span class="lines">@@ -78,6 +79,7 @@
</span><span class="cx"> HashSet<MemoryObjectStore*> m_objectStores;
</span><span class="cx"> HashSet<MemoryObjectStore*> m_versionChangeAddedObjectStores;
</span><span class="cx">
</span><ins>+ HashMap<String, std::unique_ptr<MemoryObjectStore>> m_deletedObjectStores;
</ins><span class="cx"> HashMap<MemoryObjectStore*, std::unique_ptr<KeyValueMap>> m_originalValues;
</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 (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx">
</span><span class="cx"> IDBError MemoryIDBBackingStore::createObjectStore(const IDBResourceIdentifier& transactionIdentifier, const IDBObjectStoreInfo& info)
</span><span class="cx"> {
</span><del>- LOG(IndexedDB, "MemoryIDBBackingStore::createObjectStore");
</del><ins>+ LOG(IndexedDB, "MemoryIDBBackingStore::createObjectStore - adding OS %s with ID %llu", info.name().utf8().data(), info.identifier());
</ins><span class="cx">
</span><span class="cx"> ASSERT(m_databaseInfo);
</span><span class="cx"> if (m_databaseInfo->hasObjectStore(info.name()))
</span><span class="lines">@@ -138,6 +138,29 @@
</span><span class="cx"> return IDBError();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+IDBError MemoryIDBBackingStore::deleteObjectStore(const IDBResourceIdentifier& transactionIdentifier, const String& objectStoreName)
+{
+ LOG(IndexedDB, "MemoryIDBBackingStore::deleteObjectStore");
+
+ ASSERT(m_databaseInfo);
+ if (!m_databaseInfo->hasObjectStore(objectStoreName))
+ return IDBError(IDBExceptionCode::ConstraintError);
+
+ auto transaction = m_transactions.get(transactionIdentifier);
+ ASSERT(transaction);
+ ASSERT(transaction->isVersionChange());
+
+ auto objectStore = takeObjectStoreByName(objectStoreName);
+ ASSERT(objectStore);
+ if (!objectStore)
+ return IDBError(IDBExceptionCode::ConstraintError);
+
+ m_databaseInfo->deleteObjectStore(objectStoreName);
+ transaction->objectStoreDeleted(WTF::move(objectStore));
+
+ return IDBError();
+}
+
</ins><span class="cx"> void MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort(MemoryObjectStore& objectStore)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort");
</span><span class="lines">@@ -148,6 +171,11 @@
</span><span class="cx"> unregisterObjectStore(objectStore);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void MemoryIDBBackingStore::restoreObjectStoreForVersionChangeAbort(std::unique_ptr<MemoryObjectStore>&& objectStore)
+{
+ registerObjectStore(WTF::move(objectStore));
+}
+
</ins><span class="cx"> IDBError MemoryIDBBackingStore::keyExistsInObjectStore(const IDBResourceIdentifier&, uint64_t objectStoreIdentifier, const IDBKeyData& keyData, bool& keyExists)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "MemoryIDBBackingStore::keyExistsInObjectStore");
</span><span class="lines">@@ -229,6 +257,18 @@
</span><span class="cx"> m_objectStoresByIdentifier.remove(objectStore.info().identifier());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+std::unique_ptr<MemoryObjectStore> MemoryIDBBackingStore::takeObjectStoreByName(const String& name)
+{
+ auto rawObjectStore = m_objectStoresByName.take(name);
+ if (!rawObjectStore)
+ return nullptr;
+
+ auto objectStore = m_objectStoresByIdentifier.take(rawObjectStore->info().identifier());
+ ASSERT(objectStore);
+
+ return objectStore;
+}
+
</ins><span class="cx"> } // namespace IDBServer
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -53,16 +53,20 @@
</span><span class="cx"> virtual IDBError abortTransaction(const IDBResourceIdentifier& transactionIdentifier) override final;
</span><span class="cx"> virtual IDBError commitTransaction(const IDBResourceIdentifier& transactionIdentifier) override final;
</span><span class="cx"> virtual IDBError createObjectStore(const IDBResourceIdentifier& transactionIdentifier, const IDBObjectStoreInfo&) override final;
</span><ins>+ virtual IDBError deleteObjectStore(const IDBResourceIdentifier& transactionIdentifier, const String& objectStoreName) 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 deleteRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&) override final;
</span><span class="cx"> virtual IDBError putRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, const ThreadSafeDataBuffer& value) override final;
</span><span class="cx"> virtual IDBError getRecord(const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, ThreadSafeDataBuffer& outValue) override final;
</span><span class="cx">
</span><span class="cx"> void removeObjectStoreForVersionChangeAbort(MemoryObjectStore&);
</span><ins>+ void restoreObjectStoreForVersionChangeAbort(std::unique_ptr<MemoryObjectStore>&&);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> MemoryIDBBackingStore(const IDBDatabaseIdentifier&);
</span><span class="cx">
</span><ins>+ std::unique_ptr<MemoryObjectStore> takeObjectStoreByName(const String& name);
+
</ins><span class="cx"> IDBDatabaseIdentifier m_identifier;
</span><span class="cx"> std::unique_ptr<IDBDatabaseInfo> m_databaseInfo;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -237,19 +237,17 @@
</span><span class="cx"> ASSERT(isMainThread());
</span><span class="cx"> LOG(IndexedDB, "(main) UniqueIDBDatabase::createObjectStore");
</span><span class="cx">
</span><del>- ASSERT(m_backingStore);
- m_backingStore->createObjectStore(transaction.info().identifier(), info);
-
</del><span class="cx"> uint64_t callbackID = storeCallback(callback);
</span><span class="cx"> m_server.postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::performCreateObjectStore, callbackID, transaction.info().identifier(), info));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void UniqueIDBDatabase::performCreateObjectStore(uint64_t callbackIdentifier, const IDBResourceIdentifier&, const IDBObjectStoreInfo& info)
</del><ins>+void UniqueIDBDatabase::performCreateObjectStore(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, const IDBObjectStoreInfo& info)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(!isMainThread());
</span><span class="cx"> LOG(IndexedDB, "(db) UniqueIDBDatabase::performCreateObjectStore");
</span><span class="cx">
</span><del>- // FIXME: Create object store in backing store, once that exists.
</del><ins>+ ASSERT(m_backingStore);
+ m_backingStore->createObjectStore(transactionIdentifier, info);
</ins><span class="cx">
</span><span class="cx"> IDBError error;
</span><span class="cx"> m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &UniqueIDBDatabase::didPerformCreateObjectStore, callbackIdentifier, error, info));
</span><span class="lines">@@ -266,6 +264,38 @@
</span><span class="cx"> performErrorCallback(callbackIdentifier, error);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void UniqueIDBDatabase::deleteObjectStore(UniqueIDBDatabaseTransaction& transaction, const String& objectStoreName, ErrorCallback callback)
+{
+ ASSERT(isMainThread());
+ LOG(IndexedDB, "(main) UniqueIDBDatabase::deleteObjectStore");
+
+ uint64_t callbackID = storeCallback(callback);
+ m_server.postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::performDeleteObjectStore, callbackID, transaction.info().identifier(), objectStoreName));
+}
+
+void UniqueIDBDatabase::performDeleteObjectStore(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, const String& objectStoreName)
+{
+ ASSERT(!isMainThread());
+ LOG(IndexedDB, "(db) UniqueIDBDatabase::performDeleteObjectStore");
+
+ ASSERT(m_backingStore);
+ m_backingStore->deleteObjectStore(transactionIdentifier, objectStoreName);
+
+ IDBError error;
+ m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &UniqueIDBDatabase::didPerformDeleteObjectStore, callbackIdentifier, error, objectStoreName));
+}
+
+void UniqueIDBDatabase::didPerformDeleteObjectStore(uint64_t callbackIdentifier, const IDBError& error, const String& objectStoreName)
+{
+ ASSERT(isMainThread());
+ LOG(IndexedDB, "(main) UniqueIDBDatabase::didPerformDeleteObjectStore");
+
+ if (error.isNull())
+ m_databaseInfo->deleteObjectStore(objectStoreName);
+
+ performErrorCallback(callbackIdentifier, error);
+}
+
</ins><span class="cx"> void UniqueIDBDatabase::putOrAdd(const IDBRequestData& requestData, const IDBKeyData& keyData, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode overwriteMode, KeyDataCallback callback)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(isMainThread());
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -70,6 +70,7 @@
</span><span class="cx"> IDBServer& server() { return m_server; }
</span><span class="cx">
</span><span class="cx"> void createObjectStore(UniqueIDBDatabaseTransaction&, const IDBObjectStoreInfo&, ErrorCallback);
</span><ins>+ void deleteObjectStore(UniqueIDBDatabaseTransaction&, const String& objectStoreName, ErrorCallback);
</ins><span class="cx"> void putOrAdd(const IDBRequestData&, const IDBKeyData&, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode, KeyDataCallback);
</span><span class="cx"> void getRecord(const IDBRequestData&, const IDBKeyData&, ValueDataCallback);
</span><span class="cx"> void commitTransaction(UniqueIDBDatabaseTransaction&, ErrorCallback);
</span><span class="lines">@@ -98,6 +99,7 @@
</span><span class="cx"> void performAbortTransaction(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier);
</span><span class="cx"> void beginTransactionInBackingStore(const IDBTransactionInfo&);
</span><span class="cx"> void performCreateObjectStore(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, const IDBObjectStoreInfo&);
</span><ins>+ void performDeleteObjectStore(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, const String& objectStoreName);
</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 IDBKeyData&);
</span><span class="cx"> void performActivateTransactionInBackingStore(uint64_t callbackIdentifier, const IDBTransactionInfo&);
</span><span class="lines">@@ -105,6 +107,7 @@
</span><span class="cx"> // Main thread callbacks
</span><span class="cx"> void didOpenBackingStore(const IDBDatabaseInfo&);
</span><span class="cx"> void didPerformCreateObjectStore(uint64_t callbackIdentifier, const IDBError&, const IDBObjectStoreInfo&);
</span><ins>+ void didPerformDeleteObjectStore(uint64_t callbackIdentifier, const IDBError&, const String& objectStoreName);
</ins><span class="cx"> void didPerformPutOrAdd(uint64_t callbackIdentifier, const IDBError&, const IDBKeyData&);
</span><span class="cx"> void didPerformGetRecord(uint64_t callbackIdentifier, const IDBError&, const ThreadSafeDataBuffer&);
</span><span class="cx"> void didPerformCommitTransaction(uint64_t callbackIdentifier, const IDBError&, const IDBResourceIdentifier& transactionIdentifier);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -139,6 +139,13 @@
</span><span class="cx"> m_connectionToClient.didCreateObjectStore(resultData);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void UniqueIDBDatabaseConnection::didDeleteObjectStore(const IDBResultData& resultData)
+{
+ LOG(IndexedDB, "UniqueIDBDatabaseConnection::didDeleteObjectStore");
+
+ m_connectionToClient.didDeleteObjectStore(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 (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -67,6 +67,7 @@
</span><span class="cx"> void didAbortTransaction(UniqueIDBDatabaseTransaction&, const IDBError&);
</span><span class="cx"> void didCommitTransaction(UniqueIDBDatabaseTransaction&, const IDBError&);
</span><span class="cx"> void didCreateObjectStore(const IDBResultData&);
</span><ins>+ void didDeleteObjectStore(const IDBResultData&);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> UniqueIDBDatabaseConnection(UniqueIDBDatabase&, IDBConnectionToClient&);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -113,6 +113,24 @@
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void UniqueIDBDatabaseTransaction::deleteObjectStore(const IDBRequestData& requestData, const String& objectStoreName)
+{
+ LOG(IndexedDB, "UniqueIDBDatabaseTransaction::deleteObjectStore");
+
+ ASSERT(isVersionChange());
+ ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
+
+ RefPtr<UniqueIDBDatabaseTransaction> self(this);
+ m_databaseConnection->database().deleteObjectStore(*this, objectStoreName, [this, self, requestData](const IDBError& error) {
+ LOG(IndexedDB, "UniqueIDBDatabaseTransaction::deleteObjectStore (callback)");
+ if (error.isNull())
+ m_databaseConnection->didDeleteObjectStore(IDBResultData::deleteObjectStoreSuccess(requestData.requestIdentifier()));
+ else
+ m_databaseConnection->didDeleteObjectStore(IDBResultData::error(requestData.requestIdentifier(), error));
+ });
+}
+
+
</ins><span class="cx"> void UniqueIDBDatabaseTransaction::putOrAdd(const IDBRequestData& requestData, const IDBKeyData& keyData, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "UniqueIDBDatabaseTransaction::putOrAdd");
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -63,6 +63,7 @@
</span><span class="cx"> void commit();
</span><span class="cx">
</span><span class="cx"> void createObjectStore(const IDBRequestData&, const IDBObjectStoreInfo&);
</span><ins>+ void deleteObjectStore(const IDBRequestData&, const String& objectStoreName);
</ins><span class="cx"> void putOrAdd(const IDBRequestData&, const IDBKeyData&, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx"> void getRecord(const IDBRequestData&, const IDBKeyData&);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBDatabaseInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -106,6 +106,15 @@
</span><span class="cx"> return WTF::move(names);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBDatabaseInfo::deleteObjectStore(const String& objectStoreName)
+{
+ auto* info = infoForExistingObjectStore(objectStoreName);
+ if (!info)
+ return;
+
+ m_objectStoreMap.remove(info->identifier());
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBDatabaseInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -54,6 +54,8 @@
</span><span class="cx">
</span><span class="cx"> Vector<String> objectStoreNames() const;
</span><span class="cx">
</span><ins>+ void deleteObjectStore(const String& objectStoreName);
+
</ins><span class="cx"> private:
</span><span class="cx"> IDBDatabaseInfo();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBResultDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -93,6 +93,11 @@
</span><span class="cx"> return { IDBResultType::CreateObjectStoreSuccess, requestIdentifier };
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+IDBResultData IDBResultData::deleteObjectStoreSuccess(const IDBResourceIdentifier& requestIdentifier)
+{
+ return { IDBResultType::DeleteObjectStoreSuccess, requestIdentifier };
+}
+
</ins><span class="cx"> IDBResultData IDBResultData::putOrAddSuccess(const IDBResourceIdentifier& requestIdentifier, const IDBKeyData& resultKey)
</span><span class="cx"> {
</span><span class="cx"> IDBResultData result(IDBResultType::PutOrAddSuccess, requestIdentifier);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBResultDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> OpenDatabaseSuccess,
</span><span class="cx"> OpenDatabaseUpgradeNeeded,
</span><span class="cx"> CreateObjectStoreSuccess,
</span><ins>+ DeleteObjectStoreSuccess,
</ins><span class="cx"> PutOrAddSuccess,
</span><span class="cx"> GetRecordSuccess,
</span><span class="cx"> };
</span><span class="lines">@@ -60,6 +61,7 @@
</span><span class="cx"> static IDBResultData openDatabaseSuccess(const IDBResourceIdentifier&, IDBServer::UniqueIDBDatabaseConnection&);
</span><span class="cx"> static IDBResultData openDatabaseUpgradeNeeded(const IDBResourceIdentifier&, IDBServer::UniqueIDBDatabaseTransaction&);
</span><span class="cx"> static IDBResultData createObjectStoreSuccess(const IDBResourceIdentifier&);
</span><ins>+ static IDBResultData deleteObjectStoreSuccess(const IDBResourceIdentifier&);
</ins><span class="cx"> static IDBResultData putOrAddSuccess(const IDBResourceIdentifier&, const IDBKeyData&);
</span><span class="cx"> static IDBResultData getRecordSuccess(const IDBResourceIdentifier&, const ThreadSafeDataBuffer& valueData);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -127,6 +127,14 @@
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void InProcessIDBServer::didDeleteObjectStore(const IDBResultData& resultData)
+{
+ RefPtr<InProcessIDBServer> self(this);
+ RunLoop::current().dispatch([this, self, resultData] {
+ m_connectionToServer->didDeleteObjectStore(resultData);
+ });
+}
+
</ins><span class="cx"> void InProcessIDBServer::didPutOrAdd(const IDBResultData& resultData)
</span><span class="cx"> {
</span><span class="cx"> RefPtr<InProcessIDBServer> self(this);
</span><span class="lines">@@ -167,6 +175,14 @@
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void InProcessIDBServer::deleteObjectStore(const IDBRequestData& requestData, const String& objectStoreName)
+{
+ RefPtr<InProcessIDBServer> self(this);
+ RunLoop::current().dispatch([this, self, requestData, objectStoreName] {
+ m_server->deleteObjectStore(requestData, objectStoreName);
+ });
+}
+
</ins><span class="cx"> void InProcessIDBServer::putOrAdd(const IDBRequestData& requestData, IDBKey* key, SerializedScriptValue& value, const IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</span><span class="cx"> {
</span><span class="cx"> RefPtr<InProcessIDBServer> self(this);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h (191757 => 191758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h        2015-10-29 22:07:42 UTC (rev 191757)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h        2015-10-29 22:08:51 UTC (rev 191758)
</span><span class="lines">@@ -59,6 +59,7 @@
</span><span class="cx"> virtual void abortTransaction(IDBResourceIdentifier&) override final;
</span><span class="cx"> virtual void commitTransaction(IDBResourceIdentifier&) override final;
</span><span class="cx"> virtual void createObjectStore(const IDBRequestData&, const IDBObjectStoreInfo&) override final;
</span><ins>+ virtual void deleteObjectStore(const IDBRequestData&, const String& objectStoreName) override final;
</ins><span class="cx"> virtual void putOrAdd(const IDBRequestData&, IDBKey*, SerializedScriptValue&, const IndexedDB::ObjectStoreOverwriteMode) override final;
</span><span class="cx"> virtual void getRecord(const IDBRequestData&, IDBKey*) override final;
</span><span class="cx"> virtual void establishTransaction(uint64_t databaseConnectionIdentifier, const IDBTransactionInfo&) override final;
</span><span class="lines">@@ -71,6 +72,7 @@
</span><span class="cx"> virtual void didAbortTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError&) override final;
</span><span class="cx"> virtual void didCommitTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError&) override final;
</span><span class="cx"> virtual void didCreateObjectStore(const IDBResultData&) override final;
</span><ins>+ virtual void didDeleteObjectStore(const IDBResultData&) override final;
</ins><span class="cx"> virtual void didPutOrAdd(const IDBResultData&) override final;
</span><span class="cx"> virtual void didGetRecord(const IDBResultData&) override final;
</span><span class="cx"> virtual void fireVersionChangeEvent(IDBServer::UniqueIDBDatabaseConnection&, uint64_t requestedVersion) override final;
</span></span></pre>
</div>
</div>
</body>
</html>