Title: [183317] trunk
Revision
183317
Author
[email protected]
Date
2015-04-25 16:47:41 -0700 (Sat, 25 Apr 2015)

Log Message

Crash if IDBTransaction is aborted right after it's created
https://bugs.webkit.org/show_bug.cgi?id=144199

Reviewed by Simon Fraser.

Source/WebCore:

Test: storage/indexeddb/transaction-abort.html

* Modules/indexeddb/IDBTransactionBackend.cpp:
(WebCore::IDBTransactionBackend::IDBTransactionBackend): Don't start the
transaction if it is already complete (has been aborted).

LayoutTests:

* platform/mac-wk2/TestExpectations: Unskip storage/indexeddb/transaction-abort.html.
* storage/indexeddb/transaction-abort-expected.txt: Updated since the exact text of
the execptions is different from what was marked here as expected.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (183316 => 183317)


--- trunk/LayoutTests/ChangeLog	2015-04-25 22:03:30 UTC (rev 183316)
+++ trunk/LayoutTests/ChangeLog	2015-04-25 23:47:41 UTC (rev 183317)
@@ -1,3 +1,14 @@
+2015-04-25  Darin Adler  <[email protected]>
+
+        Crash if IDBTransaction is aborted right after it's created
+        https://bugs.webkit.org/show_bug.cgi?id=144199
+
+        Reviewed by Simon Fraser.
+
+        * platform/mac-wk2/TestExpectations: Unskip storage/indexeddb/transaction-abort.html.
+        * storage/indexeddb/transaction-abort-expected.txt: Updated since the exact text of
+        the execptions is different from what was marked here as expected.
+
 2015-04-23  Ryosuke Niwa  <[email protected]>
 
         class methods should be non-enumerable

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (183316 => 183317)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2015-04-25 22:03:30 UTC (rev 183316)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2015-04-25 23:47:41 UTC (rev 183317)
@@ -394,7 +394,6 @@
 storage/indexeddb/deleted-objects.html [ Skip ] # Crashes under WebCore::GetOperation::GetOperation
 storage/indexeddb/metadata.html [ Skip ] # Crashes under IDBDatabaseBackend::createIndex
 storage/indexeddb/persistence.html [ Skip ] # Crash under IDBDatabaseBackend::createObjectStore
-storage/indexeddb/transaction-abort.html [ Skip ] # IDBTransactionBackend::start()
 webkit.org/b/137314 storage/indexeddb/database-basics.html [ Pass Crash Timeout ] # IDBDatabaseBackend::createObjectStore()
 
 # Blink tests that crash the WebProcess under IDBDatabase::dispatchEvent or IDBRequest::dispatchEvent (possibly all related).

Modified: trunk/LayoutTests/storage/indexeddb/transaction-abort-expected.txt (183316 => 183317)


--- trunk/LayoutTests/storage/indexeddb/transaction-abort-expected.txt	2015-04-25 22:03:30 UTC (rev 183316)
+++ trunk/LayoutTests/storage/indexeddb/transaction-abort-expected.txt	2015-04-25 23:47:41 UTC (rev 183317)
@@ -25,7 +25,7 @@
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'TransactionInactiveError'
-Exception message: Failed to execute 'add' on 'IDBObjectStore': The transaction is not active.
+Exception message: TransactionInactiveError: DOM IDBDatabase Exception 0
 PASS event.target.error.name is 'AbortError'
 PASS trans.error is null
 PASS firstError is true
@@ -39,12 +39,12 @@
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'TransactionInactiveError'
-Exception message: Failed to execute 'add' on 'IDBObjectStore': The transaction has finished.
+Exception message: TransactionInactiveError: DOM IDBDatabase Exception 0
 Expecting exception from trans.abort()
 PASS Exception was thrown.
 PASS code is DOMException.INVALID_STATE_ERR
 PASS ename is 'InvalidStateError'
-Exception message: Failed to execute 'abort' on 'IDBTransaction': The transaction has finished.
+Exception message: InvalidStateError: DOM IDBDatabase Exception 11
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/Source/WebCore/ChangeLog (183316 => 183317)


--- trunk/Source/WebCore/ChangeLog	2015-04-25 22:03:30 UTC (rev 183316)
+++ trunk/Source/WebCore/ChangeLog	2015-04-25 23:47:41 UTC (rev 183317)
@@ -1,3 +1,16 @@
+2015-04-25  Darin Adler  <[email protected]>
+
+        Crash if IDBTransaction is aborted right after it's created
+        https://bugs.webkit.org/show_bug.cgi?id=144199
+
+        Reviewed by Simon Fraser.
+
+        Test: storage/indexeddb/transaction-abort.html
+
+        * Modules/indexeddb/IDBTransactionBackend.cpp:
+        (WebCore::IDBTransactionBackend::IDBTransactionBackend): Don't start the
+        transaction if it is already complete (has been aborted).
+
 2015-04-25  Martin Robinson  <[email protected]>
 
         Rename ENABLE_3D_RENDERING to ENABLE_3D_TRANSFORMS

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackend.cpp (183316 => 183317)


--- trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackend.cpp	2015-04-25 22:03:30 UTC (rev 183316)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackend.cpp	2015-04-25 23:47:41 UTC (rev 183317)
@@ -75,6 +75,10 @@
             return;
         }
 
+        // Handle the case where the transaction was aborted before the server connection finished opening the transaction.
+        if (backend->m_state == Finished)
+            return;
+
         backend->m_state = Unused;
         if (backend->hasPendingTasks())
             backend->start();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to