Modern IDB: storage/indexeddb/lazy-index-population.html fails.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Jan 2016 20:18:29 +0000 (20:18 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Jan 2016 20:18:29 +0000 (20:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=152976

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (At least one failing test now passes).

We were restoring objectstores/indexes incorrectly on transaction abort.

* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort):

LayoutTests:

* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194859 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac-wk1/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp
Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp

index 012fa4c..3b53c3f 100644 (file)
@@ -1,3 +1,12 @@
+2016-01-11  Brady Eidson  <beidson@apple.com>
+
+        Modern IDB: storage/indexeddb/lazy-index-population.html fails.
+        https://bugs.webkit.org/show_bug.cgi?id=152976
+
+        Reviewed by Alex Christensen.
+
+        * platform/mac-wk1/TestExpectations:
+
 2016-01-11  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         [GTK] Update test expectations after r194845
index 6a3375d..5e67eba 100644 (file)
@@ -79,9 +79,6 @@ imported/w3c/indexeddb/idbindex_openKeyCursor3.htm [ Failure ]
 # Modern IDB doesn't properly handle 2^53 as a key generator value
 storage/indexeddb/key-generator.html [ Skip ]
 
-# ASSERT in MemoryIDBBackingStore::restoreObjectStoreForVersionChangeAbort
-storage/indexeddb/lazy-index-population.html [ Skip ]
-
 # Crashes with GuardMalloc or ASan
 storage/indexeddb/index-multientry.html [ Skip ]
 
index de45a35..85f39a0 100644 (file)
@@ -1,5 +1,21 @@
 2016-01-11  Brady Eidson  <beidson@apple.com>
 
+        Modern IDB: storage/indexeddb/lazy-index-population.html fails.
+        https://bugs.webkit.org/show_bug.cgi?id=152976
+
+        Reviewed by Alex Christensen.
+
+        No new tests (At least one failing test now passes).
+
+        We were restoring objectstores/indexes incorrectly on transaction abort.
+
+        * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
+        * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
+        (WebCore::IDBServer::MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort):
+
+2016-01-11  Brady Eidson  <beidson@apple.com>
+
         Modern IDB: Make MemoryIndex and MemoryObjectStore RefCounted.
         https://bugs.webkit.org/show_bug.cgi?id=152966
 
index 178cd99..40637ab 100644 (file)
@@ -180,6 +180,10 @@ void MemoryBackingStoreTransaction::abort()
 
     TemporaryChange<bool> change(m_isAborting, true);
 
+    for (auto objectStore : m_versionChangeAddedObjectStores)
+        m_backingStore.removeObjectStoreForVersionChangeAbort(*objectStore);
+    m_versionChangeAddedObjectStores.clear();
+
     for (auto& objectStore : m_deletedObjectStores.values()) {
         m_backingStore.restoreObjectStoreForVersionChangeAbort(*objectStore);
         ASSERT(!m_objectStores.contains(objectStore.get()));
@@ -223,9 +227,6 @@ void MemoryBackingStoreTransaction::abort()
     m_deletedIndexes.clear();
 
     finish();
-
-    for (auto objectStore : m_versionChangeAddedObjectStores)
-        m_backingStore.removeObjectStoreForVersionChangeAbort(*objectStore);
 }
 
 void MemoryBackingStoreTransaction::commit()
index 4a09076..bcc67e9 100644 (file)
@@ -220,7 +220,9 @@ void MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort(MemoryObjectS
 {
     LOG(IndexedDB, "MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort");
 
-    ASSERT(m_objectStoresByIdentifier.contains(objectStore.info().identifier()));
+    if (!m_objectStoresByIdentifier.contains(objectStore.info().identifier()))
+        return;
+
     ASSERT(m_objectStoresByIdentifier.get(objectStore.info().identifier()) == &objectStore);
 
     unregisterObjectStore(objectStore);