Title: [239960] trunk/Source/WebCore
Revision
239960
Author
[email protected]
Date
2019-01-14 16:19:17 -0800 (Mon, 14 Jan 2019)

Log Message

IndexedDB: When deleting databases, some open databases might be missed
https://bugs.webkit.org/show_bug.cgi?id=193090

Reviewed by Brady Eidson.

We should close all databases with an open backing store instead of looking at which ones have an open database
connection. This is because a database might be in the process of getting a backing store before its connection
has been created.

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
(WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (239959 => 239960)


--- trunk/Source/WebCore/ChangeLog	2019-01-15 00:00:04 UTC (rev 239959)
+++ trunk/Source/WebCore/ChangeLog	2019-01-15 00:19:17 UTC (rev 239960)
@@ -1,3 +1,18 @@
+2019-01-14  Sihui Liu  <[email protected]>
+
+        IndexedDB: When deleting databases, some open databases might be missed
+        https://bugs.webkit.org/show_bug.cgi?id=193090
+
+        Reviewed by Brady Eidson.
+
+        We should close all databases with an open backing store instead of looking at which ones have an open database
+        connection. This is because a database might be in the process of getting a backing store before its connection
+        has been created.
+
+        * Modules/indexeddb/server/IDBServer.cpp:
+        (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
+        (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
+
 2019-01-14  Ryosuke Niwa  <[email protected]>
 
         Remove redundant check for alignAttr and hiddenAttr in various isPresentationAttribute overrides

Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp (239959 => 239960)


--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp	2019-01-15 00:00:04 UTC (rev 239959)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp	2019-01-15 00:19:17 UTC (rev 239960)
@@ -509,8 +509,8 @@
     }
 
     HashSet<UniqueIDBDatabase*> openDatabases;
-    for (auto* connection : m_databaseConnections.values())
-        openDatabases.add(connection->database());
+    for (auto& database : m_uniqueIDBDatabaseMap.values())
+        openDatabases.add(database.get());
 
     for (auto& database : openDatabases)
         database->immediateCloseForUserDelete();
@@ -525,14 +525,11 @@
     ASSERT_UNUSED(addResult, addResult.isNewEntry);
 
     HashSet<UniqueIDBDatabase*> openDatabases;
-    for (auto* connection : m_databaseConnections.values()) {
-        auto database = connection->database();
-        ASSERT(database);
-
+    for (auto& database : m_uniqueIDBDatabaseMap.values()) {
         const auto& identifier = database->identifier();
         for (auto& origin : origins) {
             if (identifier.isRelatedToOrigin(origin)) {
-                openDatabases.add(database);
+                openDatabases.add(database.get());
                 break;
             }
         }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to