Modern IDB: Add basic transaction aborting.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Oct 2015 20:22:31 +0000 (20:22 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Oct 2015 20:22:31 +0000 (20:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150148

Reviewed by Alex Christensen.

Source/WebCore:

Tests: storage/indexeddb/modern/double-abort.html
       storage/indexeddb/modern/versionchange-abort-then-reopen.html

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:

* Modules/indexeddb/IndexedDB.h:

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::abortTransaction):
(WebCore::IDBClient::IDBConnectionToServer::didAbortTransaction):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:

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

* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::IDBTransaction):
(WebCore::IDBClient::IDBTransaction::abort):
(WebCore::IDBClient::IDBTransaction::isFinishedOrFinishing):
(WebCore::IDBClient::IDBTransaction::activationTimerFired):
(WebCore::IDBClient::IDBTransaction::didAbort):
* Modules/indexeddb/client/IDBTransactionImpl.h:

* Modules/indexeddb/server/IDBBackingStore.h:

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

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

* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::create):
(WebCore::IDBServer::MemoryBackingStoreTransaction::MemoryBackingStoreTransaction):
(WebCore::IDBServer::MemoryBackingStoreTransaction::~MemoryBackingStoreTransaction):
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
(WebCore::IDBServer::MemoryBackingStoreTransaction::commit):
* Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
(WebCore::IDBServer::MemoryBackingStoreTransaction::isVersionChange):

* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::setDatabaseInfo):
(WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::beginTransactionInBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::performCommitTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::performAbortTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

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

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

* Modules/indexeddb/shared/IDBError.cpp:
(WebCore::idbErrorName):
(WebCore::idbErrorDescription):
* Modules/indexeddb/shared/IDBError.h:

* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::didAbortTransaction):
(WebCore::InProcessIDBServer::abortTransaction):
* Modules/indexeddb/shared/InProcessIDBServer.h:

LayoutTests:

* storage/indexeddb/modern/double-abort-expected.txt: Added.
* storage/indexeddb/modern/double-abort.html: Added.
* storage/indexeddb/modern/versionchange-abort-then-reopen-expected.txt: Added.
* storage/indexeddb/modern/versionchange-abort-then-reopen.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191400 268f45cc-cd09-0410-ab3c-d52691b4dbfc

36 files changed:
LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/modern/double-abort-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/double-abort.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/versionchange-abort-then-reopen-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/versionchange-abort-then-reopen.html [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IndexedDB.h
Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp
Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h
Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h
Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.h
Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h
Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h
Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp
Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h
Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h
Source/WebCore/Modules/indexeddb/server/IDBServer.cpp
Source/WebCore/Modules/indexeddb/server/IDBServer.h
Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h [new file with mode: 0644]
Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp
Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h
Source/WebCore/Modules/indexeddb/shared/IDBError.cpp
Source/WebCore/Modules/indexeddb/shared/IDBError.h
Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp
Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h
Source/WebCore/WebCore.xcodeproj/project.pbxproj

index c54a213..a18e96d 100644 (file)
@@ -1,3 +1,15 @@
+2015-10-21  Brady Eidson  <beidson@apple.com>
+
+        Modern IDB: Add basic transaction aborting.
+        https://bugs.webkit.org/show_bug.cgi?id=150148
+
+        Reviewed by Alex Christensen.
+
+        * storage/indexeddb/modern/double-abort-expected.txt: Added.
+        * storage/indexeddb/modern/double-abort.html: Added.
+        * storage/indexeddb/modern/versionchange-abort-then-reopen-expected.txt: Added.
+        * storage/indexeddb/modern/versionchange-abort-then-reopen.html: Added.
+
 2015-10-21  Antoine Quint  <graouts@apple.com>
 
         Support for the SVG `onend` attribute
diff --git a/LayoutTests/storage/indexeddb/modern/double-abort-expected.txt b/LayoutTests/storage/indexeddb/modern/double-abort-expected.txt
new file mode 100644 (file)
index 0000000..173498f
--- /dev/null
@@ -0,0 +1,5 @@
+ALERT: Initial upgrade needed: Old version - 0 New version - 1
+ALERT: Second abort failed: Error: InvalidStateError: DOM Exception 11
+ALERT: Initial upgrade versionchange transaction aborted
+ALERT: Done
+This test aborts the same transaction twice, making the appropriate exception is thrown.
diff --git a/LayoutTests/storage/indexeddb/modern/double-abort.html b/LayoutTests/storage/indexeddb/modern/double-abort.html
new file mode 100644 (file)
index 0000000..a538835
--- /dev/null
@@ -0,0 +1,47 @@
+This test aborts the same transaction twice, making the appropriate exception is thrown.
+<script>
+
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+}
+
+function done()
+{
+    alert("Done");
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+var createRequest = window.indexedDB.open("DoubleAbortTestDatabase", 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;
+
+    versionTransaction.abort();
+    try {
+        versionTransaction.abort();
+    } catch (e) {
+        alert("Second abort failed: " + e);
+    }
+
+    versionTransaction.onabort = function(event) {
+        alert("Initial upgrade versionchange transaction aborted");
+        done();
+    }
+
+    versionTransaction.oncomplete = function(event) {
+        alert("Initial upgrade versionchange transaction unexpected complete");
+        done();
+    }
+
+    versionTransaction.onerror = function(event) {
+        alert("Initial upgrade versionchange transaction unexpected error" + event);
+        done();
+    }
+}
+
+</script>
diff --git a/LayoutTests/storage/indexeddb/modern/versionchange-abort-then-reopen-expected.txt b/LayoutTests/storage/indexeddb/modern/versionchange-abort-then-reopen-expected.txt
new file mode 100644 (file)
index 0000000..fa69783
--- /dev/null
@@ -0,0 +1,13 @@
+ALERT: Initial upgrade needed: Old version - 0 New version - 1
+ALERT: Initial upgrade versionchange transaction aborted
+ALERT: Second upgrade needed: Old version - 0 New version - 1
+ALERT: Second upgrade versionchange transaction complete
+ALERT: Third upgrade needed: Old version - 1 New version - 2
+ALERT: Third upgrade versionchange transaction aborted
+ALERT: Fourth upgrade needed: Old version - 1 New version - 2
+ALERT: Done
+This test opens a new database, then aborts the version change transaction.
+It then reopens the database, making sure it's a default, empty database, and changes the version successfully.
+It then reopens the database, upgrading it's version. It aborts this versionchange, as well.
+Finally it reopens the database again, upgrading its version, making sure things had reverted back to before the second aborted versionchange.
+
diff --git a/LayoutTests/storage/indexeddb/modern/versionchange-abort-then-reopen.html b/LayoutTests/storage/indexeddb/modern/versionchange-abort-then-reopen.html
new file mode 100644 (file)
index 0000000..b07f7e8
--- /dev/null
@@ -0,0 +1,115 @@
+This test opens a new database, then aborts the version change transaction.<br>
+It then reopens the database, making sure it's a default, empty database, and changes the version successfully.<br>
+It then reopens the database, upgrading it's version. It aborts this versionchange, as well.<br>
+Finally it reopens the database again, upgrading its version, making sure things had reverted back to before the second aborted versionchange.<br>
+<script>
+
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+}
+
+function done()
+{
+    alert("Done");
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+var createRequest = window.indexedDB.open("VersionChangeAbortTestDatabase", 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;
+
+    versionTransaction.abort();
+
+    versionTransaction.onabort = function(event) {
+        alert("Initial upgrade versionchange transaction aborted");
+        continueTest1();
+        database.close();
+    }
+
+    versionTransaction.oncomplete = function(event) {
+        alert("Initial upgrade versionchange transaction unexpected complete");
+        done();
+    }
+
+    versionTransaction.onerror = function(event) {
+        alert("Initial upgrade versionchange transaction unexpected error" + event);
+        done();
+    }
+}
+
+function continueTest1()
+{
+    createRequest = window.indexedDB.open("VersionChangeAbortTestDatabase", 1);
+
+    createRequest.onupgradeneeded = function(event) {
+        alert("Second upgrade needed: Old version - " + event.oldVersion + " New version - " + event.newVersion);
+
+        var versionTransaction = createRequest.transaction;
+        var database = event.target.result;
+
+        versionTransaction.onabort = function(event) {
+            alert("Second upgrade versionchange transaction unexpected abort");
+            done();
+        }
+
+        versionTransaction.oncomplete = function(event) {
+            alert("Second upgrade versionchange transaction complete");
+            continueTest2();
+            database.close();
+        }
+
+        versionTransaction.onerror = function(event) {
+            alert("Second upgrade versionchange transaction unexpected error" + event);
+            done();
+        }
+    }
+}
+
+function continueTest2()
+{
+    createRequest = window.indexedDB.open("VersionChangeAbortTestDatabase", 2);
+
+    createRequest.onupgradeneeded = function(event) {
+        alert("Third upgrade needed: Old version - " + event.oldVersion + " New version - " + event.newVersion);
+
+        var versionTransaction = createRequest.transaction;
+        var database = event.target.result;
+
+        versionTransaction.abort();
+    
+        versionTransaction.onabort = function(event) {
+            alert("Third upgrade versionchange transaction aborted");
+            continueTest3();
+            database.close();
+        }
+
+        versionTransaction.oncomplete = function(event) {
+            alert("Third upgrade versionchange transaction unexpected complete");
+            done();
+        }
+
+        versionTransaction.onerror = function(event) {
+            alert("Third upgrade versionchange transaction unexpected error" + event);
+            done();
+        }
+    }
+}
+
+function continueTest3()
+{
+    createRequest = window.indexedDB.open("VersionChangeAbortTestDatabase", 2);
+
+    createRequest.onupgradeneeded = function(event) {
+        alert("Fourth upgrade needed: Old version - " + event.oldVersion + " New version - " + event.newVersion);
+        var database = event.target.result;
+        done();
+    }
+}
+
+</script>
\ No newline at end of file
index 976d97b..154b750 100644 (file)
@@ -904,6 +904,7 @@ set(WebCore_SOURCES
     Modules/indexeddb/server/IDBConnectionToClient.cpp
     Modules/indexeddb/server/IDBServer.cpp
     Modules/indexeddb/server/IDBServerOperation.cpp
+    Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp
     Modules/indexeddb/server/MemoryIDBBackingStore.cpp
     Modules/indexeddb/server/UniqueIDBDatabase.cpp
     Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp
index 2ae1b99..c5dae3a 100644 (file)
@@ -1,3 +1,95 @@
+2015-10-21  Brady Eidson  <beidson@apple.com>
+
+        Modern IDB: Add basic transaction aborting.
+        https://bugs.webkit.org/show_bug.cgi?id=150148
+
+        Reviewed by Alex Christensen.
+
+        Tests: storage/indexeddb/modern/double-abort.html
+               storage/indexeddb/modern/versionchange-abort-then-reopen.html
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        
+        * Modules/indexeddb/IndexedDB.h:
+        
+        * Modules/indexeddb/client/IDBConnectionToServer.cpp:
+        (WebCore::IDBClient::IDBConnectionToServer::abortTransaction):
+        (WebCore::IDBClient::IDBConnectionToServer::didAbortTransaction):
+        * Modules/indexeddb/client/IDBConnectionToServer.h:
+        * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
+        
+        * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
+        (WebCore::IDBClient::IDBDatabase::abortTransaction):
+        (WebCore::IDBClient::IDBDatabase::didCommitOrAbortTransaction):
+        * Modules/indexeddb/client/IDBDatabaseImpl.h:
+        
+        * Modules/indexeddb/client/IDBTransactionImpl.cpp:
+        (WebCore::IDBClient::IDBTransaction::IDBTransaction):
+        (WebCore::IDBClient::IDBTransaction::abort):
+        (WebCore::IDBClient::IDBTransaction::isFinishedOrFinishing):
+        (WebCore::IDBClient::IDBTransaction::activationTimerFired):
+        (WebCore::IDBClient::IDBTransaction::didAbort):
+        * Modules/indexeddb/client/IDBTransactionImpl.h:
+        
+        * Modules/indexeddb/server/IDBBackingStore.h:
+        
+        * Modules/indexeddb/server/IDBConnectionToClient.cpp:
+        (WebCore::IDBServer::IDBConnectionToClient::didAbortTransaction):
+        * Modules/indexeddb/server/IDBConnectionToClient.h:
+        * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
+        
+        * Modules/indexeddb/server/IDBServer.cpp:
+        (WebCore::IDBServer::IDBServer::abortTransaction):
+        * Modules/indexeddb/server/IDBServer.h:
+        
+        * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::create):
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::MemoryBackingStoreTransaction):
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::~MemoryBackingStoreTransaction):
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::commit):
+        * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::isVersionChange):
+        
+        * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
+        (WebCore::IDBServer::MemoryIDBBackingStore::setDatabaseInfo):
+        (WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
+        (WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
+        (WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
+        * Modules/indexeddb/server/MemoryIDBBackingStore.h:
+
+        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
+        (WebCore::IDBServer::UniqueIDBDatabase::beginTransactionInBackingStore):
+        (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
+        (WebCore::IDBServer::UniqueIDBDatabase::performCommitTransaction):
+        (WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction):
+        (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
+        (WebCore::IDBServer::UniqueIDBDatabase::performAbortTransaction):
+        (WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction):
+        * Modules/indexeddb/server/UniqueIDBDatabase.h:
+        
+        * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
+        * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
+        
+        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::originalDatabaseInfo):
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::abort):
+        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
+        
+        * Modules/indexeddb/shared/IDBError.cpp:
+        (WebCore::idbErrorName):
+        (WebCore::idbErrorDescription):
+        * Modules/indexeddb/shared/IDBError.h:
+
+        * Modules/indexeddb/shared/InProcessIDBServer.cpp:
+        (WebCore::InProcessIDBServer::didAbortTransaction):
+        (WebCore::InProcessIDBServer::abortTransaction):
+        * Modules/indexeddb/shared/InProcessIDBServer.h:
+
 2015-10-21  Chris Dumez  <cdumez@apple.com>
 
         bgsound should use HTMLUnknownElement interface
index 7fc51da..558bba7 100644 (file)
@@ -43,6 +43,7 @@ enum class TransactionState {
     Unstarted,
     Running,
     Committing,
+    Aborting,
     Finished,
 };
 
index ae87442..130d594 100644 (file)
@@ -113,6 +113,26 @@ void IDBConnectionToServer::didCommitTransaction(const IDBResourceIdentifier& tr
     transaction->didCommit(error);
 }
 
+void IDBConnectionToServer::abortTransaction(IDBTransaction& transaction)
+{
+    LOG(IndexedDB, "IDBConnectionToServer::abortTransaction");
+    ASSERT(!m_abortingTransactions.contains(transaction.info().identifier()));
+    m_abortingTransactions.set(transaction.info().identifier(), &transaction);
+
+    auto identifier = transaction.info().identifier();
+    m_delegate->abortTransaction(identifier);
+}
+
+void IDBConnectionToServer::didAbortTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError& error)
+{
+    LOG(IndexedDB, "IDBConnectionToServer::didAbortTransaction");
+
+    auto transaction = m_abortingTransactions.take(transactionIdentifier);
+    ASSERT(transaction);
+
+    transaction->didAbort(error);
+}
+
 void IDBConnectionToServer::fireVersionChangeEvent(uint64_t databaseConnectionIdentifier, uint64_t requestedVersion)
 {
     LOG(IndexedDB, "IDBConnectionToServer::fireVersionChangeEvent");
index cc4e392..bbfd229 100644 (file)
@@ -61,6 +61,9 @@ public:
     void commitTransaction(IDBTransaction&);
     void didCommitTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError&);
 
+    void abortTransaction(IDBTransaction&);
+    void didAbortTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError&);
+
     void fireVersionChangeEvent(uint64_t databaseConnectionIdentifier, uint64_t requestedVersion);
 
     void databaseConnectionClosed(IDBDatabase&);
@@ -75,6 +78,7 @@ private:
     HashMap<IDBResourceIdentifier, RefPtr<IDBClient::IDBOpenDBRequest>> m_openDBRequestMap;
     HashMap<uint64_t, IDBDatabase*> m_databaseConnectionMap;
     HashMap<IDBResourceIdentifier, RefPtr<IDBTransaction>> m_committingTransactions;
+    HashMap<IDBResourceIdentifier, RefPtr<IDBTransaction>> m_abortingTransactions;
 };
 
 } // namespace IDBClient
index 5607bbb..16dadc3 100644 (file)
@@ -42,6 +42,7 @@ public:
     virtual uint64_t identifier() const = 0;
     virtual void deleteDatabase(IDBRequestData&) = 0;
     virtual void openDatabase(IDBRequestData&) = 0;
+    virtual void abortTransaction(IDBResourceIdentifier&) = 0;
     virtual void commitTransaction(IDBResourceIdentifier&) = 0;
     virtual void databaseConnectionClosed(uint64_t databaseConnectionIdentifier) = 0;
 
index aab637e..49a4d3c 100644 (file)
@@ -175,6 +175,17 @@ void IDBDatabase::didCommitTransaction(IDBTransaction& transaction)
     didCommitOrAbortTransaction(transaction);
 }
 
+void IDBDatabase::abortTransaction(IDBTransaction& transaction)
+{
+    LOG(IndexedDB, "IDBDatabase::abortTransaction");
+
+    auto refTransaction = m_activeTransactions.take(transaction.info().identifier());
+    ASSERT(refTransaction);
+    m_abortingTransactions.set(transaction.info().identifier(), WTF::move(refTransaction));
+
+    m_serverConnection->abortTransaction(transaction);
+}
+
 void IDBDatabase::didAbortTransaction(IDBTransaction& transaction)
 {
     LOG(IndexedDB, "IDBDatabase::didAbortTransaction");
@@ -187,11 +198,22 @@ void IDBDatabase::didCommitOrAbortTransaction(IDBTransaction& transaction)
 
     if (m_versionChangeTransaction == &transaction)
         m_versionChangeTransaction = nullptr;
-    
-    ASSERT(m_activeTransactions.contains(transaction.info().identifier()) || m_committingTransactions.contains(transaction.info().identifier()));
+
+#ifndef NDBEBUG
+    unsigned count = 0;
+    if (m_activeTransactions.contains(transaction.info().identifier()))
+        ++count;
+    if (m_committingTransactions.contains(transaction.info().identifier()))
+        ++count;
+    if (m_abortingTransactions.contains(transaction.info().identifier()))
+        ++count;
+
+    ASSERT(count == 1);
+#endif
 
     m_activeTransactions.remove(transaction.info().identifier());
     m_committingTransactions.remove(transaction.info().identifier());
+    m_abortingTransactions.remove(transaction.info().identifier());
 }
 
 void IDBDatabase::fireVersionChangeEvent(uint64_t requestedVersion)
index bf60481..2bfb11b 100644 (file)
@@ -75,6 +75,7 @@ public:
     Ref<IDBTransaction> startVersionChangeTransaction(const IDBTransactionInfo&);
     void commitTransaction(IDBTransaction&);
     void didCommitTransaction(IDBTransaction&);
+    void abortTransaction(IDBTransaction&);
     void didAbortTransaction(IDBTransaction&);
 
     void fireVersionChangeEvent(uint64_t requestedVersion);
@@ -96,6 +97,7 @@ private:
     RefPtr<IDBTransaction> m_versionChangeTransaction;
     HashMap<IDBResourceIdentifier, RefPtr<IDBTransaction>> m_activeTransactions;
     HashMap<IDBResourceIdentifier, RefPtr<IDBTransaction>> m_committingTransactions;
+    HashMap<IDBResourceIdentifier, RefPtr<IDBTransaction>> m_abortingTransactions;
 };
 
 } // namespace IDBClient
index d937aaa..541e5d8 100644 (file)
@@ -31,6 +31,7 @@
 #include "DOMError.h"
 #include "EventQueue.h"
 #include "IDBDatabaseImpl.h"
+#include "IDBError.h"
 #include "IDBEventDispatcher.h"
 #include "IDBObjectStore.h"
 #include "Logging.h"
@@ -51,8 +52,13 @@ IDBTransaction::IDBTransaction(IDBDatabase& database, const IDBTransactionInfo&
     , m_operationTimer(*this, &IDBTransaction::operationTimerFired)
 
 {
+    m_activationTimer = std::make_unique<Timer>(*this, &IDBTransaction::activationTimerFired);
+    m_activationTimer->startOneShot(0);
+
+    if (m_info.mode() == IndexedDB::TransactionMode::VersionChange)
+        m_originalDatabaseInfo = std::make_unique<IDBDatabaseInfo>(m_database->info());
+
     suspendIfNeeded();
-    scheduleOperationTimer();
     m_state = IndexedDB::TransactionState::Running;
 }
 
@@ -91,9 +97,18 @@ RefPtr<IDBObjectStore> IDBTransaction::objectStore(const String&, ExceptionCode&
     return nullptr;
 }
 
-void IDBTransaction::abort(ExceptionCode&)
+void IDBTransaction::abort(ExceptionCode& ec)
 {
-    ASSERT_NOT_REACHED();
+    LOG(IndexedDB, "IDBTransaction::abort");
+
+    if (isFinishedOrFinishing()) {
+        ec = INVALID_STATE_ERR;
+        return;
+    }
+
+    m_state = IndexedDB::TransactionState::Aborting;
+
+    m_database->abortTransaction(*this);
 }
 
 const char* IDBTransaction::activeDOMObjectName() const
@@ -116,6 +131,19 @@ bool IDBTransaction::isActive() const
     return m_state == IndexedDB::TransactionState::Running;
 }
 
+bool IDBTransaction::isFinishedOrFinishing() const
+{
+    return m_state == IndexedDB::TransactionState::Committing
+        || m_state == IndexedDB::TransactionState::Aborting
+        || m_state == IndexedDB::TransactionState::Finished;
+}
+
+void IDBTransaction::activationTimerFired()
+{
+    scheduleOperationTimer();
+    m_activationTimer = nullptr;
+}
+
 void IDBTransaction::scheduleOperationTimer()
 {
     if (!m_operationTimer.isActive())
@@ -151,6 +179,20 @@ void IDBTransaction::commit()
     m_database->commitTransaction(*this);
 }
 
+void IDBTransaction::didAbort(const IDBError& error)
+{
+    LOG(IndexedDB, "IDBTransaction::didAbort");
+
+    ASSERT(m_state == IndexedDB::TransactionState::Aborting || m_state == IndexedDB::TransactionState::Running);
+
+    m_database->didAbortTransaction(*this);
+
+    m_idbError = error;
+    fireOnAbort();
+
+    m_state = IndexedDB::TransactionState::Finished;
+}
+
 void IDBTransaction::didCommit(const IDBError& error)
 {
     LOG(IndexedDB, "IDBTransaction::didCommit");
index 0d3606c..072c28b 100644 (file)
@@ -28,6 +28,7 @@
 
 #if ENABLE(INDEXED_DATABASE)
 
+#include "IDBDatabaseInfo.h"
 #include "IDBError.h"
 #include "IDBTransaction.h"
 #include "IDBTransactionInfo.h"
@@ -68,16 +69,19 @@ public:
     IDBDatabase& database() { return m_database.get(); }
     const IDBDatabase& database() const { return m_database.get(); }
 
+    void didAbort(const IDBError&);
     void didCommit(const IDBError&);
 
 private:
     IDBTransaction(IDBDatabase&, const IDBTransactionInfo&);
 
     bool isActive() const;
+    bool isFinishedOrFinishing() const;
     void commit();
 
     void scheduleOperationTimer();
     void operationTimerFired();
+    void activationTimerFired();
 
     void fireOnComplete();
     void fireOnAbort();
@@ -85,11 +89,13 @@ private:
 
     Ref<IDBDatabase> m_database;
     IDBTransactionInfo m_info;
+    std::unique_ptr<IDBDatabaseInfo> m_originalDatabaseInfo;
 
     IndexedDB::TransactionState m_state { IndexedDB::TransactionState::Unstarted };
     IDBError m_idbError;
 
     Timer m_operationTimer;
+    std::unique_ptr<Timer> m_activationTimer;
 };
 
 } // namespace IDBClient
index a5a48c1..6ff1ec1 100644 (file)
 #if ENABLE(INDEXED_DATABASE)
 
 #include "IDBDatabaseInfo.h"
+#include "IDBError.h"
 
 namespace WebCore {
+
+class IDBResourceIdentifier;
+class IDBTransactionInfo;
+
 namespace IDBServer {
 
 class IDBBackingStore {
@@ -38,6 +43,10 @@ public:
     virtual ~IDBBackingStore() { }
 
     virtual const IDBDatabaseInfo& getOrEstablishDatabaseInfo() = 0;
+
+    virtual IDBError beginTransaction(const IDBTransactionInfo&) = 0;
+    virtual IDBError abortTransaction(const IDBResourceIdentifier& transactionIdentifier) = 0;
+    virtual IDBError commitTransaction(const IDBResourceIdentifier& transactionIdentifier) = 0;
 };
 
 } // namespace IDBServer
index 4cf36f7..34a01e8 100644 (file)
@@ -58,6 +58,11 @@ void IDBConnectionToClient::didOpenDatabase(const IDBResultData& result)
     m_delegate->didOpenDatabase(result);
 }
 
+void IDBConnectionToClient::didAbortTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError& error)
+{
+    m_delegate->didAbortTransaction(transactionIdentifier, error);
+}
+
 void IDBConnectionToClient::didCommitTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError& error)
 {
     m_delegate->didCommitTransaction(transactionIdentifier, error);
index 1f0e534..e3df94f 100644 (file)
@@ -50,6 +50,7 @@ public:
 
     void didDeleteDatabase(const IDBResultData&);
     void didOpenDatabase(const IDBResultData&);
+    void didAbortTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError&);
     void didCommitTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError&);
 
     void fireVersionChangeEvent(UniqueIDBDatabaseConnection&, uint64_t requestedVersion);
index 28eccb2..eeb8e1e 100644 (file)
@@ -46,6 +46,7 @@ public:
 
     virtual void didDeleteDatabase(const IDBResultData&) = 0;
     virtual void didOpenDatabase(const IDBResultData&) = 0;
+    virtual void didAbortTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError&) = 0;
     virtual void didCommitTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError&) = 0;
 
     virtual void fireVersionChangeEvent(UniqueIDBDatabaseConnection&, uint64_t requestedVersion) = 0;
index 45e16fe..30dec42 100644 (file)
@@ -142,6 +142,20 @@ void IDBServer::deleteDatabase(const IDBRequestData& requestData)
     connection->didDeleteDatabase(result);
 }
 
+void IDBServer::abortTransaction(const IDBResourceIdentifier& transactionIdentifier)
+{
+    LOG(IndexedDB, "IDBServer::abortTransaction");
+
+    auto transaction = m_transactions.get(transactionIdentifier);
+    if (!transaction) {
+        // If there is no transaction there is nothing to abort.
+        // We also have no access to a connection over which to message failure-to-abort.
+        return;
+    }
+
+    transaction->abort();
+}
+
 void IDBServer::commitTransaction(const IDBResourceIdentifier& transactionIdentifier)
 {
     LOG(IndexedDB, "IDBServer::commitTransaction");
index f07e87d..061a425 100644 (file)
@@ -57,6 +57,7 @@ public:
     // Operations requested by the client.
     void openDatabase(const IDBRequestData&);
     void deleteDatabase(const IDBRequestData&);
+    void abortTransaction(const IDBResourceIdentifier&);
     void commitTransaction(const IDBResourceIdentifier&);
     void databaseConnectionClosed(uint64_t databaseConnectionIdentifier);
 
diff --git a/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp b/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp
new file mode 100644 (file)
index 0000000..ec2a3e8
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "MemoryBackingStoreTransaction.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IndexedDB.h"
+#include "Logging.h"
+#include "MemoryIDBBackingStore.h"
+
+namespace WebCore {
+namespace IDBServer {
+
+std::unique_ptr<MemoryBackingStoreTransaction> MemoryBackingStoreTransaction::create(MemoryIDBBackingStore& backingStore, const IDBTransactionInfo& info)
+{
+    return std::make_unique<MemoryBackingStoreTransaction>(backingStore, info);
+}
+
+MemoryBackingStoreTransaction::MemoryBackingStoreTransaction(MemoryIDBBackingStore& backingStore, const IDBTransactionInfo& info)
+    : m_backingStore(backingStore)
+    , m_info(info)
+{
+    if (m_info.mode() == IndexedDB::TransactionMode::VersionChange)
+        m_originalDatabaseInfo = std::make_unique<IDBDatabaseInfo>(m_backingStore.getOrEstablishDatabaseInfo());
+}
+
+MemoryBackingStoreTransaction::~MemoryBackingStoreTransaction()
+{
+    ASSERT(!m_inProgress);
+}
+
+void MemoryBackingStoreTransaction::abort()
+{
+    LOG(IndexedDB, "MemoryBackingStoreTransaction::abort()");
+
+    if (m_originalDatabaseInfo) {
+        ASSERT(m_info.mode() == IndexedDB::TransactionMode::VersionChange);
+        m_backingStore.setDatabaseInfo(*m_originalDatabaseInfo);
+    }
+
+    m_inProgress = false;
+}
+
+void MemoryBackingStoreTransaction::commit()
+{
+    LOG(IndexedDB, "MemoryBackingStoreTransaction::commit()");
+
+    m_inProgress = false;
+}
+
+} // namespace IDBServer
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h b/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h
new file mode 100644 (file)
index 0000000..f539161
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MemoryBackingStoreTransaction_h
+#define MemoryBackingStoreTransaction_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBDatabaseInfo.h"
+#include "IDBTransactionInfo.h"
+
+namespace WebCore {
+namespace IDBServer {
+
+class MemoryIDBBackingStore;
+
+class MemoryBackingStoreTransaction {
+    friend std::unique_ptr<MemoryBackingStoreTransaction> std::make_unique<MemoryBackingStoreTransaction>(WebCore::IDBServer::MemoryIDBBackingStore&, const WebCore::IDBTransactionInfo&);
+public:
+    static std::unique_ptr<MemoryBackingStoreTransaction> create(MemoryIDBBackingStore&, const IDBTransactionInfo&);
+
+    ~MemoryBackingStoreTransaction();
+
+    bool isVersionChange() const { return m_info.mode() == IndexedDB::TransactionMode::VersionChange; }
+
+    const IDBDatabaseInfo& originalDatabaseInfo() const;
+
+    void abort();
+    void commit();
+
+private:
+    MemoryBackingStoreTransaction(MemoryIDBBackingStore&, const IDBTransactionInfo&);
+
+    MemoryIDBBackingStore& m_backingStore;
+    IDBTransactionInfo m_info;
+
+    std::unique_ptr<IDBDatabaseInfo> m_originalDatabaseInfo;
+
+    bool m_inProgress { true };
+};
+
+} // namespace IDBServer
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+#endif // MemoryBackingStoreTransaction_h
index b074207..aae067a 100644 (file)
@@ -28,6 +28,8 @@
 
 #if ENABLE(INDEXED_DATABASE)
 
+#include "Logging.h"
+
 namespace WebCore {
 namespace IDBServer {
 
@@ -53,6 +55,53 @@ const IDBDatabaseInfo& MemoryIDBBackingStore::getOrEstablishDatabaseInfo()
     return *m_databaseInfo;
 }
 
+void MemoryIDBBackingStore::setDatabaseInfo(const IDBDatabaseInfo& info)
+{
+    // It is not valid to directly set database info on a backing store that hasn't already set its own database info.
+    ASSERT(m_databaseInfo);
+
+    m_databaseInfo = std::make_unique<IDBDatabaseInfo>(info);
+}
+
+IDBError MemoryIDBBackingStore::beginTransaction(const IDBTransactionInfo& info)
+{
+    LOG(IndexedDB, "MemoryIDBBackingStore::beginTransaction");
+
+    if (m_transactions.contains(info.identifier()))
+        return IDBError(IDBExceptionCode::InvalidStateError, "Backing store asked to create transaction it already has a record of");
+
+    auto transaction = MemoryBackingStoreTransaction::create(*this, info);
+    m_transactions.set(info.identifier(), WTF::move(transaction));
+
+    return IDBError();
+}
+
+IDBError MemoryIDBBackingStore::abortTransaction(const IDBResourceIdentifier& transactionIdentifier)
+{
+    LOG(IndexedDB, "MemoryIDBBackingStore::abortTransaction");
+
+    auto transaction = m_transactions.take(transactionIdentifier);
+    if (!transaction)
+        return IDBError(IDBExceptionCode::InvalidStateError, "Backing store asked to abort transaction it didn't have record of");
+
+    transaction->abort();
+
+    return IDBError();
+}
+
+IDBError MemoryIDBBackingStore::commitTransaction(const IDBResourceIdentifier& transactionIdentifier)
+{
+    LOG(IndexedDB, "MemoryIDBBackingStore::commitTransaction");
+
+    auto transaction = m_transactions.take(transactionIdentifier);
+    if (!transaction)
+        return IDBError(IDBExceptionCode::InvalidStateError, "Backing store asked to commit transaction it didn't have record of");
+
+    transaction->commit();
+
+    return IDBError();
+}
+
 } // namespace IDBServer
 } // namespace WebCore
 
index 8762de4..25499f4 100644 (file)
@@ -30,6 +30,9 @@
 
 #include "IDBBackingStore.h"
 #include "IDBDatabaseIdentifier.h"
+#include "IDBResourceIdentifier.h"
+#include "MemoryBackingStoreTransaction.h"
+#include <wtf/HashMap.h>
 
 namespace WebCore {
 namespace IDBServer {
@@ -42,12 +45,20 @@ public:
     virtual ~MemoryIDBBackingStore() override final;
 
     virtual const IDBDatabaseInfo& getOrEstablishDatabaseInfo() override final;
-    
+    void setDatabaseInfo(const IDBDatabaseInfo&);
+
+    virtual IDBError beginTransaction(const IDBTransactionInfo&) override final;
+    virtual IDBError abortTransaction(const IDBResourceIdentifier& transactionIdentifier) override final;
+    virtual IDBError commitTransaction(const IDBResourceIdentifier& transactionIdentifier) override final;
+
 private:
     MemoryIDBBackingStore(const IDBDatabaseIdentifier&);
 
     IDBDatabaseIdentifier m_identifier;
     std::unique_ptr<IDBDatabaseInfo> m_databaseInfo;
+
+    HashMap<IDBResourceIdentifier, std::unique_ptr<MemoryBackingStoreTransaction>> m_transactions;
+
 };
 
 } // namespace IDBServer
index 877f4dd..926dab9 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "IDBResultData.h"
 #include "IDBServer.h"
+#include "IDBTransactionInfo.h"
 #include "Logging.h"
 #include "UniqueIDBDatabaseConnection.h"
 #include <wtf/MainThread.h>
@@ -156,11 +157,18 @@ void UniqueIDBDatabase::startVersionChangeTransaction()
     addOpenDatabaseConnection(*m_versionChangeDatabaseConnection);
 
     m_versionChangeTransaction = &m_versionChangeDatabaseConnection->createVersionChangeTransaction(requestedVersion);
+    m_server.postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::beginTransactionInBackingStore, m_versionChangeTransaction->info()));
 
     auto result = IDBResultData::openDatabaseUpgradeNeeded(operation->requestData().requestIdentifier(), *m_versionChangeTransaction);
     operation->connection().didOpenDatabase(result);
 }
 
+void UniqueIDBDatabase::beginTransactionInBackingStore(const IDBTransactionInfo& info)
+{
+    LOG(IndexedDB, "(db) UniqueIDBDatabase::beginTransactionInBackingStore");
+    m_backingStore->beginTransaction(info);
+}
+
 void UniqueIDBDatabase::notifyConnectionsOfVersionChange()
 {
     ASSERT(m_versionChangeOperation);
@@ -214,6 +222,8 @@ void UniqueIDBDatabase::commitTransaction(UniqueIDBDatabaseTransaction& transact
     ASSERT(isMainThread());
     LOG(IndexedDB, "(main) UniqueIDBDatabase::commitTransaction");
 
+    ASSERT(&transaction.databaseConnection().database() == this);
+
     if (m_versionChangeTransaction == &transaction) {
         ASSERT(&m_versionChangeTransaction->databaseConnection() == m_versionChangeDatabaseConnection);
         m_databaseInfo->setVersion(transaction.info().newVersion());
@@ -225,16 +235,13 @@ void UniqueIDBDatabase::commitTransaction(UniqueIDBDatabaseTransaction& transact
     m_server.postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::performCommitTransaction, callbackID, transaction.info().identifier()));
 }
 
-void UniqueIDBDatabase::performCommitTransaction(uint64_t callbackIdentifier, const IDBResourceIdentifier&)
+void UniqueIDBDatabase::performCommitTransaction(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier)
 {
     ASSERT(!isMainThread());
     LOG(IndexedDB, "(db) UniqueIDBDatabase::performCommitTransaction");
 
-    // FIXME: Commit transaction in backing store, once that exists.
-
-    IDBError error;
+    IDBError error = m_backingStore->commitTransaction(transactionIdentifier);
     m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &UniqueIDBDatabase::didPerformCommitTransaction, callbackIdentifier, error));
-
 }
 
 void UniqueIDBDatabase::didPerformCommitTransaction(uint64_t callbackIdentifier, const IDBError& error)
@@ -242,6 +249,48 @@ void UniqueIDBDatabase::didPerformCommitTransaction(uint64_t callbackIdentifier,
     ASSERT(isMainThread());
     LOG(IndexedDB, "(main) UniqueIDBDatabase::didPerformCommitTransaction");
 
+    // Previously blocked transactions might now be unblocked.
+    invokeTransactionScheduler();
+
+    performErrorCallback(callbackIdentifier, error);
+}
+
+void UniqueIDBDatabase::abortTransaction(UniqueIDBDatabaseTransaction& transaction, ErrorCallback callback)
+{
+    ASSERT(isMainThread());
+    LOG(IndexedDB, "(main) UniqueIDBDatabase::abortTransaction");
+
+    ASSERT(&transaction.databaseConnection().database() == this);
+
+    if (m_versionChangeTransaction == &transaction) {
+        ASSERT(&m_versionChangeTransaction->databaseConnection() == m_versionChangeDatabaseConnection);
+        ASSERT(transaction.originalDatabaseInfo());
+        m_databaseInfo = std::make_unique<IDBDatabaseInfo>(*transaction.originalDatabaseInfo());
+        m_versionChangeTransaction = nullptr;
+        m_versionChangeDatabaseConnection = nullptr;
+    }
+
+    uint64_t callbackID = storeCallback(callback);
+    m_server.postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::performAbortTransaction, callbackID, transaction.info().identifier()));
+}
+
+void UniqueIDBDatabase::performAbortTransaction(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier)
+{
+    ASSERT(!isMainThread());
+    LOG(IndexedDB, "(db) UniqueIDBDatabase::performAbortTransaction");
+
+    IDBError error = m_backingStore->abortTransaction(transactionIdentifier);
+    m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &UniqueIDBDatabase::didPerformAbortTransaction, callbackIdentifier, error));
+}
+
+void UniqueIDBDatabase::didPerformAbortTransaction(uint64_t callbackIdentifier, const IDBError& error)
+{
+    ASSERT(isMainThread());
+    LOG(IndexedDB, "(main) UniqueIDBDatabase::didPerformAbortTransaction");
+
+    // Previously blocked transactions might now be unblocked.
+    invokeTransactionScheduler();
+
     performErrorCallback(callbackIdentifier, error);
 }
 
index f625c08..effa62f 100644 (file)
@@ -44,6 +44,7 @@ namespace WebCore {
 
 class IDBError;
 class IDBRequestData;
+class IDBTransactionInfo;
 
 namespace IDBServer {
 
@@ -65,6 +66,7 @@ public:
     IDBServer& server() { return m_server; }
 
     void commitTransaction(UniqueIDBDatabaseTransaction&, ErrorCallback);
+    void abortTransaction(UniqueIDBDatabaseTransaction&, ErrorCallback);
     void transactionDestroyed(UniqueIDBDatabaseTransaction&);
     void connectionClosedFromClient(UniqueIDBDatabaseConnection&);
 
@@ -83,10 +85,13 @@ private:
     // Database thread operations
     void openBackingStore(const IDBDatabaseIdentifier&);
     void performCommitTransaction(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier);
+    void performAbortTransaction(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier);
+    void beginTransactionInBackingStore(const IDBTransactionInfo&);
 
     // Main thread callbacks
     void didOpenBackingStore(const IDBDatabaseInfo&);
     void didPerformCommitTransaction(uint64_t callbackIdentifier, const IDBError&);
+    void didPerformAbortTransaction(uint64_t callbackIdentifier, const IDBError&);
 
     void performErrorCallback(uint64_t callbackIdentifier, const IDBError&);
 
index 2b0bbc6..43351be 100644 (file)
@@ -93,6 +93,18 @@ UniqueIDBDatabaseTransaction& UniqueIDBDatabaseConnection::createVersionChangeTr
     return transaction.get();
 }
 
+void UniqueIDBDatabaseConnection::didAbortTransaction(UniqueIDBDatabaseTransaction& transaction, const IDBError& error)
+{
+    LOG(IndexedDB, "UniqueIDBDatabaseConnection::didAbortTransaction");
+
+    auto transactionIdentifier = transaction.info().identifier();
+
+    ASSERT(m_transactionMap.contains(transactionIdentifier));
+    m_transactionMap.remove(transactionIdentifier);
+
+    m_connectionToClient.didAbortTransaction(transactionIdentifier, error);
+}
+
 void UniqueIDBDatabaseConnection::didCommitTransaction(UniqueIDBDatabaseTransaction& transaction, const IDBError& error)
 {
     LOG(IndexedDB, "UniqueIDBDatabaseConnection::didCommitTransaction");
index 6ee8e7f..1f50e7f 100644 (file)
@@ -62,6 +62,7 @@ public:
     void fireVersionChangeEvent(uint64_t requestedVersion);
     UniqueIDBDatabaseTransaction& createVersionChangeTransaction(uint64_t newVersion);
 
+    void didAbortTransaction(UniqueIDBDatabaseTransaction&, const IDBError&);
     void didCommitTransaction(UniqueIDBDatabaseTransaction&, const IDBError&);
 
 private:
index c8b2fde..b63aec2 100644 (file)
@@ -44,6 +44,9 @@ UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction(UniqueIDBDatabaseConn
     : m_databaseConnection(connection)
     , m_transactionInfo(info)
 {
+    if (m_transactionInfo.mode() == IndexedDB::TransactionMode::VersionChange)
+        m_originalDatabaseInfo = std::make_unique<IDBDatabaseInfo>(m_databaseConnection->database().info());
+
     m_databaseConnection->database().server().registerTransaction(*this);
 }
 
@@ -53,6 +56,23 @@ UniqueIDBDatabaseTransaction::~UniqueIDBDatabaseTransaction()
     m_databaseConnection->database().server().unregisterTransaction(*this);
 }
 
+IDBDatabaseInfo* UniqueIDBDatabaseTransaction::originalDatabaseInfo() const
+{
+    ASSERT(m_transactionInfo.mode() == IndexedDB::TransactionMode::VersionChange);
+    return m_originalDatabaseInfo.get();
+}
+
+void UniqueIDBDatabaseTransaction::abort()
+{
+    LOG(IndexedDB, "UniqueIDBDatabaseTransaction::abort");
+
+    RefPtr<UniqueIDBDatabaseTransaction> self(this);
+    m_databaseConnection->database().abortTransaction(*this, [this, self](const IDBError& error) {
+        LOG(IndexedDB, "UniqueIDBDatabaseTransaction::abort (callback)");
+        m_databaseConnection->didAbortTransaction(*this, error);
+    });
+}
+
 void UniqueIDBDatabaseTransaction::commit()
 {
     LOG(IndexedDB, "UniqueIDBDatabaseTransaction::commit");
index b2cacca..be3956c 100644 (file)
@@ -34,6 +34,9 @@
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
+
+class IDBDatabaseInfo;
+
 namespace IDBServer {
 
 class UniqueIDBDatabaseConnection;
@@ -47,6 +50,9 @@ public:
     UniqueIDBDatabaseConnection& databaseConnection() { return m_databaseConnection.get(); }
     const IDBTransactionInfo& info() const { return m_transactionInfo; }
 
+    IDBDatabaseInfo* originalDatabaseInfo() const;
+
+    void abort();
     void commit();
 
 private:
@@ -54,6 +60,8 @@ private:
 
     Ref<UniqueIDBDatabaseConnection> m_databaseConnection;
     IDBTransactionInfo m_transactionInfo;
+
+    std::unique_ptr<IDBDatabaseInfo> m_originalDatabaseInfo;
 };
 
 } // namespace IDBServer
index 97333f6..8a875a7 100644 (file)
@@ -43,6 +43,10 @@ static const String& idbErrorName(IDBExceptionCode code)
         static NeverDestroyed<String> entry = ASCIILiteral("VersionError");
         return entry;
     }
+    case IDBExceptionCode::InvalidStateError: {
+        static NeverDestroyed<String> entry = ASCIILiteral("InvalidStateError");
+        return entry;
+    }
     case IDBExceptionCode::None:
         RELEASE_ASSERT_NOT_REACHED();
     }
@@ -54,13 +58,17 @@ static const String& idbErrorDescription(IDBExceptionCode code)
 {
     switch (code) {
     case IDBExceptionCode::Unknown: {
-        NeverDestroyed<String> entry = ASCIILiteral("Operation failed for reasons unrelated to the database itself and not covered by any other errors.");
+        static NeverDestroyed<String> entry = ASCIILiteral("Operation failed for reasons unrelated to the database itself and not covered by any other errors.");
         return entry.get();
     }
     case IDBExceptionCode::VersionError: {
-        NeverDestroyed<String> entry = ASCIILiteral("An attempt was made to open a database using a lower version than the existing version.");
+        static NeverDestroyed<String> entry = ASCIILiteral("An attempt was made to open a database using a lower version than the existing version.");
         return entry.get();
     }
+    case IDBExceptionCode::InvalidStateError: {
+        static NeverDestroyed<String> entry = ASCIILiteral("Operation was called on an object on which it is not allowed or at a time when it is not allowed.");
+        return entry;
+    }
     case IDBExceptionCode::None:
         RELEASE_ASSERT_NOT_REACHED();
     }
index 407034c..6e775f8 100644 (file)
@@ -36,6 +36,9 @@ enum class IDBExceptionCode {
     None = 0,
     Unknown,
     VersionError,
+
+    // Indexed DB existing exception codes with IDB-specific error messages:
+    InvalidStateError,
 };
 
 class IDBError {
index 7c2f9bf..d7fde93 100644 (file)
@@ -102,6 +102,14 @@ void InProcessIDBServer::didOpenDatabase(const IDBResultData& resultData)
     });
 }
 
+void InProcessIDBServer::didAbortTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError& error)
+{
+    RefPtr<InProcessIDBServer> self(this);
+    RunLoop::current().dispatch([this, self, transactionIdentifier, error] {
+        m_connectionToServer->didAbortTransaction(transactionIdentifier, error);
+    });
+}
+
 void InProcessIDBServer::didCommitTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError& error)
 {
     RefPtr<InProcessIDBServer> self(this);
@@ -110,6 +118,14 @@ void InProcessIDBServer::didCommitTransaction(const IDBResourceIdentifier& trans
     });
 }
 
+void InProcessIDBServer::abortTransaction(IDBResourceIdentifier& resourceIdentifier)
+{
+    RefPtr<InProcessIDBServer> self(this);
+    RunLoop::current().dispatch([this, self, resourceIdentifier] {
+        m_server->abortTransaction(resourceIdentifier);
+    });
+}
+
 void InProcessIDBServer::commitTransaction(IDBResourceIdentifier& resourceIdentifier)
 {
     RefPtr<InProcessIDBServer> self(this);
index dc09451..bd3cb73 100644 (file)
@@ -56,6 +56,7 @@ public:
     // IDBConnectionToServer
     virtual void deleteDatabase(IDBRequestData&) override final;
     virtual void openDatabase(IDBRequestData&) override final;
+    virtual void abortTransaction(IDBResourceIdentifier&) override final;
     virtual void commitTransaction(IDBResourceIdentifier&) override final;
     virtual void databaseConnectionClosed(uint64_t databaseConnectionIdentifier) override final;
 
@@ -63,6 +64,7 @@ public:
     virtual uint64_t identifier() const override;
     virtual void didDeleteDatabase(const IDBResultData&) override final;
     virtual void didOpenDatabase(const IDBResultData&) override final;
+    virtual void didAbortTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError&) override final;
     virtual void didCommitTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError&) override final;
     virtual void fireVersionChangeEvent(IDBServer::UniqueIDBDatabaseConnection&, uint64_t requestedVersion) override final;
 
index 54c48ed..49253d4 100644 (file)
                4162A4581011464700DFF3ED /* JSDedicatedWorkerGlobalScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 4162A4561011464700DFF3ED /* JSDedicatedWorkerGlobalScope.h */; };
                416E29A6102FA962007FC14E /* WorkerReportingProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 416E29A5102FA962007FC14E /* WorkerReportingProxy.h */; };
                416E6FE81BBD12DF000A6033 /* StreamInternalsBuiltins.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8061BB3110D00B764C9 /* StreamInternalsBuiltins.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               416E6FEA1BBD1684000A6034 /* StreamInternalsBuiltinsWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8071BB3110D00B764CA /* StreamInternalsBuiltinsWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
                416E6FE81BBD12DF000A6043 /* ReadableStreamInternalsBuiltins.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8061BB3110D00B764D9 /* ReadableStreamInternalsBuiltins.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               416E6FE91BBD12E5000A6043 /* ReadableStreamBuiltins.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8061BB3110D00B764D8 /* ReadableStreamBuiltins.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               416E6FEA1BBD1684000A6044 /* ReadableStreamInternalsBuiltinsWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8071BB3110D00B764DA /* ReadableStreamInternalsBuiltinsWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
                416E6FE81BBD12DF000A6053 /* WritableStreamInternalsBuiltins.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8061BB3110D00B764E9 /* WritableStreamInternalsBuiltins.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               416E6FE91BBD12E5000A6043 /* ReadableStreamBuiltins.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8061BB3110D00B764D8 /* ReadableStreamBuiltins.h */; settings = {ATTRIBUTES = (Private, ); }; };
                416E6FE91BBD12E5000A6053 /* WritableStreamBuiltins.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8061BB3110D00B764E8 /* WritableStreamBuiltins.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               416E6FEA1BBD1684000A6034 /* StreamInternalsBuiltinsWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8071BB3110D00B764CA /* StreamInternalsBuiltinsWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               416E6FEA1BBD1684000A6044 /* ReadableStreamInternalsBuiltinsWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8071BB3110D00B764DA /* ReadableStreamInternalsBuiltinsWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
                416E6FEA1BBD1684000A6054 /* WritableStreamInternalsBuiltinsWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8071BB3110D00B764EA /* WritableStreamInternalsBuiltinsWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
                417253AA1354BBBC00360F2A /* MediaControlElements.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 417253A81354BBBC00360F2A /* MediaControlElements.cpp */; };
                417253AB1354BBBC00360F2A /* MediaControlElements.h in Headers */ = {isa = PBXBuildFile; fileRef = 417253A91354BBBC00360F2A /* MediaControlElements.h */; };
                51E0BAEB0DA55D4A00A9E417 /* JSStorageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E0BAE90DA55D4A00A9E417 /* JSStorageEvent.h */; };
                51E0BB380DA5ACB600A9E417 /* StorageMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E0BB360DA5ACB600A9E417 /* StorageMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51E0BB390DA5ACB600A9E417 /* StorageMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E0BB370DA5ACB600A9E417 /* StorageMap.cpp */; };
+               51E1BAC21BD8064E0055D81F /* MemoryBackingStoreTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E1BAC01BD806470055D81F /* MemoryBackingStoreTransaction.cpp */; };
+               51E1BAC31BD8064E0055D81F /* MemoryBackingStoreTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E1BAC11BD806470055D81F /* MemoryBackingStoreTransaction.h */; };
                51E1ECBE0C91C90400DC255B /* IconDatabaseClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E1ECB80C91C90400DC255B /* IconDatabaseClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51E1ECC00C91C90400DC255B /* IconRecord.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E1ECBA0C91C90400DC255B /* IconRecord.cpp */; };
                51E1ECC10C91C90400DC255B /* IconRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E1ECBB0C91C90400DC255B /* IconRecord.h */; };
                7C48A6D1191C9D6500026674 /* WebKitNamespace.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C48A6CF191C9D6500026674 /* WebKitNamespace.h */; };
                7C4902A218B825F8007D9298 /* DOMWheelEventInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85989DCA0ACC8BBD00A0BC51 /* DOMWheelEventInternal.h */; };
                7C4C96DC1AD4483500365A50 /* JSReadableStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4C96D81AD4483500365A50 /* JSReadableStream.cpp */; };
+               7C4C96DC1AD4483500365A60 /* JSWritableStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4C96D81AD4483500365A60 /* JSWritableStream.cpp */; };
                7C4C96DD1AD4483500365A50 /* JSReadableStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4C96D91AD4483500365A50 /* JSReadableStream.h */; };
+               7C4C96DD1AD4483500365A60 /* JSWritableStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4C96D91AD4483500365A60 /* JSWritableStream.h */; };
                7C4C96DE1AD4483500365A50 /* JSReadableStreamReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4C96DA1AD4483500365A50 /* JSReadableStreamReader.cpp */; };
                7C4C96DF1AD4483500365A50 /* JSReadableStreamReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4C96DB1AD4483500365A50 /* JSReadableStreamReader.h */; };
-               7C4C96DC1AD4483500365A60 /* JSWritableStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4C96D81AD4483500365A60 /* JSWritableStream.cpp */; };
-               7C4C96DD1AD4483500365A60 /* JSWritableStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4C96D91AD4483500365A60 /* JSWritableStream.h */; };
                7C4C96E31AD44ABF00365A50 /* LaunchServicesSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4C96E21AD44ABF00365A50 /* LaunchServicesSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7C4EDD741A7B607800198C4D /* FontCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7C4EDD731A7B607800198C4D /* FontCocoa.mm */; };
                7C522D4B15B477E8009B7C95 /* InspectorOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */; };
                51E0BAE90DA55D4A00A9E417 /* JSStorageEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStorageEvent.h; sourceTree = "<group>"; };
                51E0BB360DA5ACB600A9E417 /* StorageMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageMap.h; sourceTree = "<group>"; };
                51E0BB370DA5ACB600A9E417 /* StorageMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageMap.cpp; sourceTree = "<group>"; };
+               51E1BAC01BD806470055D81F /* MemoryBackingStoreTransaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryBackingStoreTransaction.cpp; sourceTree = "<group>"; };
+               51E1BAC11BD806470055D81F /* MemoryBackingStoreTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryBackingStoreTransaction.h; sourceTree = "<group>"; };
                51E1ECB80C91C90400DC255B /* IconDatabaseClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IconDatabaseClient.h; sourceTree = "<group>"; };
                51E1ECBA0C91C90400DC255B /* IconRecord.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IconRecord.cpp; sourceTree = "<group>"; };
                51E1ECBB0C91C90400DC255B /* IconRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IconRecord.h; sourceTree = "<group>"; };
                7C48A6CF191C9D6500026674 /* WebKitNamespace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitNamespace.h; sourceTree = "<group>"; };
                7C48A6D2191C9D8E00026674 /* WebKitNamespace.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebKitNamespace.idl; sourceTree = "<group>"; };
                7C4C96D81AD4483500365A50 /* JSReadableStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReadableStream.cpp; sourceTree = "<group>"; };
+               7C4C96D81AD4483500365A60 /* JSWritableStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWritableStream.cpp; sourceTree = "<group>"; };
                7C4C96D91AD4483500365A50 /* JSReadableStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStream.h; sourceTree = "<group>"; };
+               7C4C96D91AD4483500365A60 /* JSWritableStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWritableStream.h; sourceTree = "<group>"; };
                7C4C96DA1AD4483500365A50 /* JSReadableStreamReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReadableStreamReader.cpp; sourceTree = "<group>"; };
                7C4C96DB1AD4483500365A50 /* JSReadableStreamReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStreamReader.h; sourceTree = "<group>"; };
-               7C4C96D81AD4483500365A60 /* JSWritableStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWritableStream.cpp; sourceTree = "<group>"; };
-               7C4C96D91AD4483500365A60 /* JSWritableStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWritableStream.h; sourceTree = "<group>"; };
                7C4C96E21AD44ABF00365A50 /* LaunchServicesSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LaunchServicesSPI.h; sourceTree = "<group>"; };
                7C4EDD731A7B607800198C4D /* FontCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FontCocoa.mm; sourceTree = "<group>"; };
                7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorOverlay.cpp; sourceTree = "<group>"; };
                9908B0EC1BCACF1F00ED0F65 /* generate-js-builtins */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = "generate-js-builtins"; sourceTree = "<group>"; };
                9908B0ED1BCACF9100ED0F65 /* ByteLengthQueuingStrategy.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = ByteLengthQueuingStrategy.js; sourceTree = "<group>"; };
                9908B0EE1BCACF9100ED0F65 /* CountQueuingStrategy.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = CountQueuingStrategy.js; sourceTree = "<group>"; };
-               9908B0F11BCACF9100ED0F55 /* StreamInternals.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = StreamInternals.js; sourceTree = "<group>"; };
-               9908B0FD1BCAD07D00ED0F55 /* StreamInternalsBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StreamInternalsBuiltins.cpp; sourceTree = "<group>"; };
                9908B0EF1BCACF9100ED0F65 /* ReadableStream.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = ReadableStream.js; sourceTree = "<group>"; };
+               9908B0EF1BCACF9100ED0F75 /* WritableStream.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = WritableStream.js; sourceTree = "<group>"; };
                9908B0F01BCACF9100ED0F65 /* ReadableStreamController.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = ReadableStreamController.js; sourceTree = "<group>"; };
+               9908B0F11BCACF9100ED0F55 /* StreamInternals.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = StreamInternals.js; sourceTree = "<group>"; };
                9908B0F11BCACF9100ED0F65 /* ReadableStreamInternals.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = ReadableStreamInternals.js; sourceTree = "<group>"; };
-               9908B0F21BCACF9100ED0F65 /* ReadableStreamReader.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = ReadableStreamReader.js; sourceTree = "<group>"; };
-               9908B0EF1BCACF9100ED0F75 /* WritableStream.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = WritableStream.js; sourceTree = "<group>"; };
                9908B0F11BCACF9100ED0F75 /* WritableStreamInternals.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = WritableStreamInternals.js; sourceTree = "<group>"; };
+               9908B0F21BCACF9100ED0F65 /* ReadableStreamReader.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = ReadableStreamReader.js; sourceTree = "<group>"; };
                9908B0F31BCACFFE00ED0F65 /* ByteLengthQueuingStrategyBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ByteLengthQueuingStrategyBuiltins.cpp; sourceTree = "<group>"; };
                9908B0F41BCACFFE00ED0F65 /* ByteLengthQueuingStrategyBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ByteLengthQueuingStrategyBuiltinsWrapper.h; sourceTree = "<group>"; };
                9908B0F51BCAD07D00ED0F65 /* ByteLengthQueuingStrategyBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ByteLengthQueuingStrategyBuiltins.h; sourceTree = "<group>"; };
                9908B0F71BCAD07D00ED0F65 /* CountQueuingStrategyBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountQueuingStrategyBuiltins.h; sourceTree = "<group>"; };
                9908B0F81BCAD07D00ED0F65 /* CountQueuingStrategyBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountQueuingStrategyBuiltinsWrapper.h; sourceTree = "<group>"; };
                9908B0F91BCAD07D00ED0F65 /* ReadableStreamBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReadableStreamBuiltins.cpp; sourceTree = "<group>"; };
+               9908B0F91BCAD07D00ED0F75 /* WritableStreamBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WritableStreamBuiltins.cpp; sourceTree = "<group>"; };
                9908B0FA1BCAD07D00ED0F65 /* ReadableStreamControllerBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReadableStreamControllerBuiltins.cpp; sourceTree = "<group>"; };
                9908B0FB1BCAD07D00ED0F65 /* ReadableStreamControllerBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamControllerBuiltins.h; sourceTree = "<group>"; };
                9908B0FC1BCAD07D00ED0F65 /* ReadableStreamControllerBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamControllerBuiltinsWrapper.h; sourceTree = "<group>"; };
+               9908B0FD1BCAD07D00ED0F55 /* StreamInternalsBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StreamInternalsBuiltins.cpp; sourceTree = "<group>"; };
                9908B0FD1BCAD07D00ED0F65 /* ReadableStreamInternalsBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReadableStreamInternalsBuiltins.cpp; sourceTree = "<group>"; };
+               9908B0FD1BCAD07D00ED0F75 /* WritableStreamInternalsBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WritableStreamInternalsBuiltins.cpp; sourceTree = "<group>"; };
                9908B0FE1BCAD07D00ED0F65 /* ReadableStreamReaderBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReadableStreamReaderBuiltins.cpp; sourceTree = "<group>"; };
                9908B0FF1BCAD07D00ED0F65 /* ReadableStreamReaderBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamReaderBuiltins.h; sourceTree = "<group>"; };
                9908B1001BCAD07D00ED0F65 /* ReadableStreamReaderBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamReaderBuiltinsWrapper.h; sourceTree = "<group>"; };
-               9908B0F91BCAD07D00ED0F75 /* WritableStreamBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WritableStreamBuiltins.cpp; sourceTree = "<group>"; };
-               9908B0FD1BCAD07D00ED0F75 /* WritableStreamInternalsBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WritableStreamInternalsBuiltins.cpp; sourceTree = "<group>"; };
                9920398018B95BC600B39AF9 /* UserInputBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserInputBridge.cpp; sourceTree = "<group>"; };
                9920398118B95BC600B39AF9 /* UserInputBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInputBridge.h; sourceTree = "<group>"; };
                99C7CCB218C663E40032E413 /* MemoizedDOMResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoizedDOMResult.h; sourceTree = "<group>"; };
                9AB1F37E18E2489A00534743 /* CSSToLengthConversionData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSToLengthConversionData.h; sourceTree = "<group>"; };
                9AB1F37F18E2489A00534743 /* CSSToLengthConversionData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSToLengthConversionData.cpp; sourceTree = "<group>"; };
                9B03D8061BB3110D00B764C9 /* StreamInternalsBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StreamInternalsBuiltins.h; sourceTree = "<group>"; };
-               9B03D8071BB3110D00B764CA /* StreamInternalsBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StreamInternalsBuiltinsWrapper.h; sourceTree = "<group>"; };
                9B03D8061BB3110D00B764D8 /* ReadableStreamBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamBuiltins.h; sourceTree = "<group>"; };
                9B03D8061BB3110D00B764D9 /* ReadableStreamInternalsBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamInternalsBuiltins.h; sourceTree = "<group>"; };
-               9B03D8071BB3110D00B764D8 /* ReadableStreamBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamBuiltinsWrapper.h; sourceTree = "<group>"; };
-               9B03D8071BB3110D00B764DA /* ReadableStreamInternalsBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamInternalsBuiltinsWrapper.h; sourceTree = "<group>"; };
                9B03D8061BB3110D00B764E8 /* WritableStreamBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WritableStreamBuiltins.h; sourceTree = "<group>"; };
                9B03D8061BB3110D00B764E9 /* WritableStreamInternalsBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WritableStreamInternalsBuiltins.h; sourceTree = "<group>"; };
+               9B03D8071BB3110D00B764CA /* StreamInternalsBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StreamInternalsBuiltinsWrapper.h; sourceTree = "<group>"; };
+               9B03D8071BB3110D00B764D8 /* ReadableStreamBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamBuiltinsWrapper.h; sourceTree = "<group>"; };
+               9B03D8071BB3110D00B764DA /* ReadableStreamInternalsBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamInternalsBuiltinsWrapper.h; sourceTree = "<group>"; };
                9B03D8071BB3110D00B764E8 /* WritableStreamBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WritableStreamBuiltinsWrapper.h; sourceTree = "<group>"; };
                9B03D8071BB3110D00B764EA /* WritableStreamInternalsBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WritableStreamInternalsBuiltinsWrapper.h; sourceTree = "<group>"; };
                9B19B67E1B964E5200348745 /* ShadowRoot.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ShadowRoot.idl; sourceTree = "<group>"; };
                                41A023ED1A39DB7900F722DF /* WritableStream.idl */,
                                9908B0EF1BCACF9100ED0F75 /* WritableStream.js */,
                                9908B0F11BCACF9100ED0F75 /* WritableStreamInternals.js */,
-
                        );
                        path = streams;
                        sourceTree = "<group>";
                                510A58F01BAB720F00C19282 /* IDBServer.h */,
                                518864E41BBB4B7E00E540C9 /* IDBServerOperation.cpp */,
                                518864E51BBB4B7E00E540C9 /* IDBServerOperation.h */,
+                               51E1BAC01BD806470055D81F /* MemoryBackingStoreTransaction.cpp */,
+                               51E1BAC11BD806470055D81F /* MemoryBackingStoreTransaction.h */,
                                51BA4AC81BBC5B9E00DF3D6D /* MemoryIDBBackingStore.cpp */,
                                51BA4AC91BBC5B9E00DF3D6D /* MemoryIDBBackingStore.h */,
                                518864DE1BBAF30F00E540C9 /* UniqueIDBDatabase.cpp */,
                                439046DE12DA25E800AF80A2 /* RenderMathMLMath.h in Headers */,
                                439046E012DA25E800AF80A2 /* RenderMathMLOperator.h in Headers */,
                                439046E012DA25E800BF80A3 /* RenderMathMLRadicalOperator.h in Headers */,
+                               51E1BAC31BD8064E0055D81F /* MemoryBackingStoreTransaction.h in Headers */,
                                439046E212DA25E800AF80A2 /* RenderMathMLRoot.h in Headers */,
                                439046E412DA25E800AF80A2 /* RenderMathMLRow.h in Headers */,
                                439046E812DA25E800AF80A2 /* RenderMathMLScripts.h in Headers */,
                                B2FA3DBC0AB75A6F000E5AC4 /* JSSVGPathSegClosePath.cpp in Sources */,
                                B2FA3DBE0AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicAbs.cpp in Sources */,
                                B2FA3DC00AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicRel.cpp in Sources */,
+                               51E1BAC21BD8064E0055D81F /* MemoryBackingStoreTransaction.cpp in Sources */,
                                B2FA3DC20AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicSmoothAbs.cpp in Sources */,
                                B2FA3DC40AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicSmoothRel.cpp in Sources */,
                                B2FA3DC60AB75A6F000E5AC4 /* JSSVGPathSegCurvetoQuadraticAbs.cpp in Sources */,