Title: [253858] trunk/Source/WebCore
Revision
253858
Author
sihui_...@apple.com
Date
2019-12-20 17:49:05 -0800 (Fri, 20 Dec 2019)

Log Message

REGRESSION (r253807): crash in storage/indexeddb/modern/opendatabase-request-private.html
https://bugs.webkit.org/show_bug.cgi?id=205515

Reviewed by Alex Christensen.

When m_openRequests of IDBTransaction is empty, we expect all requests associated with the transactions should
be completed, but in IDBOpenDBRequest, we removed the request from m_openRequests before
m_currentlyCompletingRequest finished. This is because the order of calling ActiveDOMObject::stop() is random.

* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::cancelForStop):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::abortOnServerAndCancelRequests):
(WebCore::IDBTransaction::connectionClosedFromServer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (253857 => 253858)


--- trunk/Source/WebCore/ChangeLog	2019-12-21 01:33:10 UTC (rev 253857)
+++ trunk/Source/WebCore/ChangeLog	2019-12-21 01:49:05 UTC (rev 253858)
@@ -1,3 +1,20 @@
+2019-12-20  Sihui Liu  <sihui_...@apple.com>
+
+        REGRESSION (r253807): crash in storage/indexeddb/modern/opendatabase-request-private.html
+        https://bugs.webkit.org/show_bug.cgi?id=205515
+
+        Reviewed by Alex Christensen.
+
+        When m_openRequests of IDBTransaction is empty, we expect all requests associated with the transactions should 
+        be completed, but in IDBOpenDBRequest, we removed the request from m_openRequests before 
+        m_currentlyCompletingRequest finished. This is because the order of calling ActiveDOMObject::stop() is random.
+
+        * Modules/indexeddb/IDBOpenDBRequest.cpp:
+        (WebCore::IDBOpenDBRequest::cancelForStop):
+        * Modules/indexeddb/IDBTransaction.cpp:
+        (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
+        (WebCore::IDBTransaction::connectionClosedFromServer):
+
 2019-12-20  Megan Gardner  <megan_gard...@apple.com>
 
         Paint highlights specified in CSS Highlight API

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp (253857 => 253858)


--- trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp	2019-12-21 01:33:10 UTC (rev 253857)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp	2019-12-21 01:49:05 UTC (rev 253858)
@@ -118,9 +118,6 @@
 void IDBOpenDBRequest::cancelForStop()
 {
     connectionProxy().openDBRequestCancelled({ connectionProxy(), *this });
-
-    if (m_transaction && m_transaction->isVersionChange())
-        m_transaction->removeRequest(*this);
 }
 
 void IDBOpenDBRequest::dispatchEvent(Event& event)

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp (253857 => 253858)


--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp	2019-12-21 01:33:10 UTC (rev 253857)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp	2019-12-21 01:49:05 UTC (rev 253858)
@@ -312,6 +312,7 @@
     }
 
     m_abortQueue.clear();
+    m_openRequests.clear();
     // Since we're aborting, it should be impossible to have queued any further operations.
     ASSERT(m_pendingTransactionOperationQueue.isEmpty());
 }
@@ -1409,6 +1410,7 @@
         operation->doComplete(IDBResultData::error(operation->identifier(), error));
     }
     m_currentlyCompletingRequest = nullptr;
+    m_openRequests.clear();
     pendingTransactionOperationQueue.clear();
 
     connectionProxy().forgetActiveOperations(operations);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to