Title: [243157] trunk/Source/WebCore
Revision
243157
Author
[email protected]
Date
2019-03-19 11:54:58 -0700 (Tue, 19 Mar 2019)

Log Message

REGRESSION: Layout Test http/tests/security/cross-origin-indexeddb.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=195779

Reviewed by Chris Dumez.

When requesting space, we might delay execution of the task.
In such a case, a task to close the database might be done before the task continues.
Check that the database is not closing to continue the task.
This should ensure that the cross thread queue is not already killed.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::requestSpace):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (243156 => 243157)


--- trunk/Source/WebCore/ChangeLog	2019-03-19 18:44:18 UTC (rev 243156)
+++ trunk/Source/WebCore/ChangeLog	2019-03-19 18:54:58 UTC (rev 243157)
@@ -1,3 +1,18 @@
+2019-03-19  Youenn Fablet  <[email protected]>
+
+        REGRESSION: Layout Test http/tests/security/cross-origin-indexeddb.html is crashing
+        https://bugs.webkit.org/show_bug.cgi?id=195779
+
+        Reviewed by Chris Dumez.
+
+        When requesting space, we might delay execution of the task.
+        In such a case, a task to close the database might be done before the task continues.
+        Check that the database is not closing to continue the task.
+        This should ensure that the cross thread queue is not already killed.
+
+        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabase::requestSpace):
+
 2019-03-19  Zalan Bujtas  <[email protected]>
 
         RenderElement::startAnimation should take const Animation&

Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (243156 => 243157)


--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp	2019-03-19 18:44:18 UTC (rev 243156)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp	2019-03-19 18:54:58 UTC (rev 243157)
@@ -177,11 +177,18 @@
 
 void UniqueIDBDatabase::requestSpace(uint64_t taskSize, const char* taskName, CompletionHandler<void(Optional<IDBError>&&)>&& callback)
 {
-    m_server->requestSpace(m_identifier.origin(), taskSize, [weakThis = makeWeakPtr(this), taskName, callback = WTFMove(callback)](auto decision) mutable {
+    m_server->requestSpace(m_identifier.origin(), taskSize, [weakThis = makeWeakPtr(this), this, taskName, callback = WTFMove(callback)](auto decision) mutable {
         if (!weakThis) {
             callback(IDBError { UnknownError });
             return;
         }
+
+        if (m_owningPointerForClose) {
+            // We are closing the database, there is no point in trying to modify the database at that point.
+            callback(IDBError { UnknownError });
+            return;
+        }
+
         switch (decision) {
         case StorageQuotaManager::Decision::Deny:
             callback(IDBError { QuotaExceededError, quotaErrorMessageName(taskName) });
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to