Title: [290836] trunk/Source/WebCore
Revision
290836
Author
[email protected]
Date
2022-03-04 10:03:35 -0800 (Fri, 04 Mar 2022)

Log Message

IDB serialization thread should pass isolated copy of IndexIDToIndexKeyMap to storage thread
https://bugs.webkit.org/show_bug.cgi?id=237455

Reviewed by Chris Dumez.

* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::addRecord):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::generateIndexKeyMapForValueIsolatedCopy):
(WebCore::generateIndexKeyMapForValue): Deleted.
* bindings/js/IDBBindingUtilities.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (290835 => 290836)


--- trunk/Source/WebCore/ChangeLog	2022-03-04 17:44:58 UTC (rev 290835)
+++ trunk/Source/WebCore/ChangeLog	2022-03-04 18:03:35 UTC (rev 290836)
@@ -1,3 +1,19 @@
+2022-03-04  Sihui Liu  <[email protected]>
+
+        IDB serialization thread should pass isolated copy of IndexIDToIndexKeyMap to storage thread
+        https://bugs.webkit.org/show_bug.cgi?id=237455
+
+        Reviewed by Chris Dumez.
+
+        * Modules/indexeddb/server/MemoryObjectStore.cpp:
+        (WebCore::IDBServer::MemoryObjectStore::addRecord):
+        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
+        * bindings/js/IDBBindingUtilities.cpp:
+        (WebCore::generateIndexKeyMapForValueIsolatedCopy):
+        (WebCore::generateIndexKeyMapForValue): Deleted.
+        * bindings/js/IDBBindingUtilities.h:
+
 2022-03-04  Aditya Keerthi  <[email protected]>
 
         [iOS] Unable to scroll to a found text range when there is an existing selection

Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp (290835 => 290836)


--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp	2022-03-04 17:44:58 UTC (rev 290835)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp	2022-03-04 18:03:35 UTC (rev 290836)
@@ -247,7 +247,7 @@
 {
     IndexIDToIndexKeyMap indexKeys;
     callOnIDBSerializationThreadAndWait([info = m_info.isolatedCopy(), keyData = keyData.isolatedCopy(), value = value.isolatedCopy(), &indexKeys](auto& globalObject) {
-        indexKeys = generateIndexKeyMapForValue(globalObject, info, keyData, value);
+        indexKeys = generateIndexKeyMapForValueIsolatedCopy(globalObject, info, keyData, value);
     });
     return addRecord(transaction, keyData, indexKeys, value);
 }

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


--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp	2022-03-04 17:44:58 UTC (rev 290835)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp	2022-03-04 18:03:35 UTC (rev 290836)
@@ -888,7 +888,7 @@
     // Generate index keys up front for more accurate quota check.
     IndexIDToIndexKeyMap indexKeys;
     callOnIDBSerializationThreadAndWait([objectStoreInfo = objectStoreInfo->isolatedCopy(), key = usedKey.isolatedCopy(), value = value.isolatedCopy(), &indexKeys](auto& globalObject) {
-        indexKeys = generateIndexKeyMapForValue(globalObject, objectStoreInfo, key, value);
+        indexKeys = generateIndexKeyMapForValueIsolatedCopy(globalObject, objectStoreInfo, key, value);
     });
 
     generatedKeyResetter.release();

Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp (290835 => 290836)


--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp	2022-03-04 17:44:58 UTC (rev 290835)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp	2022-03-04 18:03:35 UTC (rev 290836)
@@ -481,7 +481,7 @@
     outKey = IndexKey(WTFMove(keyDatas));
 }
 
-IndexIDToIndexKeyMap generateIndexKeyMapForValue(JSC::JSGlobalObject& lexicalGlobalObject, const IDBObjectStoreInfo& storeInfo, const IDBKeyData& key, const IDBValue& value)
+IndexIDToIndexKeyMap generateIndexKeyMapForValueIsolatedCopy(JSC::JSGlobalObject& lexicalGlobalObject, const IDBObjectStoreInfo& storeInfo, const IDBKeyData& key, const IDBValue& value)
 {
     auto& indexMap = storeInfo.indexMap();
     auto indexCount = indexMap.size();
@@ -503,7 +503,7 @@
         if (indexKey.isNull())
             continue;
 
-        indexKeys.add(entry.key, WTFMove(indexKey));
+        indexKeys.add(entry.key, WTFMove(indexKey).isolatedCopy());
     }
 
     return indexKeys;

Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h (290835 => 290836)


--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h	2022-03-04 17:44:58 UTC (rev 290835)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h	2022-03-04 18:03:35 UTC (rev 290836)
@@ -52,7 +52,7 @@
 
 void generateIndexKeyForValue(JSC::JSGlobalObject&, const IDBIndexInfo&, JSC::JSValue, IndexKey& outKey, const std::optional<IDBKeyPath>&, const IDBKeyData&);
 
-IndexIDToIndexKeyMap generateIndexKeyMapForValue(JSC::JSGlobalObject&, const IDBObjectStoreInfo&, const IDBKeyData&, const IDBValue&);
+IndexIDToIndexKeyMap generateIndexKeyMapForValueIsolatedCopy(JSC::JSGlobalObject&, const IDBObjectStoreInfo&, const IDBKeyData&, const IDBValue&);
 
 Ref<IDBKey> scriptValueToIDBKey(JSC::JSGlobalObject&, JSC::JSValue);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to