Modern IDB: Simplify the relationship between IDBObjectStore and IDBIndex.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Feb 2016 23:01:20 +0000 (23:01 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Feb 2016 23:01:20 +0000 (23:01 +0000)
commitcfcff895d9a5fbe63ea5e99626961cbe34cea15a
tree649c871b333184219eced7068a0e677a8c90084e
parent328ae68e69fcfc8ed59a73864f2481094cb9a720
Modern IDB: Simplify the relationship between IDBObjectStore and IDBIndex.
https://bugs.webkit.org/show_bug.cgi?id=154187

Reviewed by Alex Christensen.

Source/WebCore:

Tests: storage/indexeddb/modern/deleteindex-3-private.html
       storage/indexeddb/modern/deleteindex-3.html

Instead of allowing IDBIndex to have two different lifecycle modes, it is now always
owned by an IDBObjectStore.

To support the case where an IDBIndex is deleted from its IDBObjectStore, the object
store simply hangs on to deleted indexes until it is destroyed itself.

* Modules/indexeddb/client/IDBIndexImpl.cpp:
(WebCore::IDBClient::IDBIndex::markAsDeleted):
(WebCore::IDBClient::IDBIndex::ref):
(WebCore::IDBClient::IDBIndex::deref):
* Modules/indexeddb/client/IDBIndexImpl.h:

* Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
(WebCore::IDBClient::IDBObjectStore::deleteIndex):
* Modules/indexeddb/client/IDBObjectStoreImpl.h:

LayoutTests:

* storage/indexeddb/modern/deleteindex-3-expected.txt: Added.
* storage/indexeddb/modern/deleteindex-3-private-expected.txt: Added.
* storage/indexeddb/modern/deleteindex-3-private.html: Added.
* storage/indexeddb/modern/deleteindex-3.html: Added.
* storage/indexeddb/modern/resources/deleteindex-3.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196518 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/modern/deleteindex-3-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/deleteindex-3-private-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/deleteindex-3-private.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/deleteindex-3.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/resources/deleteindex-3.js [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBIndexImpl.h
Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.h