Modern IDB: Memory indexes aren't deleted when their owning memory object stores...
[WebKit-https.git] / Source / WebCore / Modules / indexeddb / server / MemoryObjectStore.cpp
index a48ce8b..38ea578 100644 (file)
@@ -156,6 +156,18 @@ IDBError MemoryObjectStore::deleteIndex(MemoryBackingStoreTransaction& transacti
     return { };
 }
 
+void MemoryObjectStore::deleteAllIndexes(MemoryBackingStoreTransaction& transaction)
+{
+    Vector<String> indexNames;
+    indexNames.reserveInitialCapacity(m_indexesByName.size());
+
+    for (auto& name : m_indexesByName.keys())
+        indexNames.uncheckedAppend(name);
+
+    for (auto& name : indexNames)
+        deleteIndex(transaction, name);
+}
+
 bool MemoryObjectStore::containsRecord(const IDBKeyData& key)
 {
     if (!m_keyValueStore)