forked from WebKit/WebKit-http
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modern IDB: Ref cycle between IDBObjectStore and IDBIndex.
https://bugs.webkit.org/show_bug.cgi?id=154110 Reviewed by Darin Adler. No new tests (Currently untestable). The lifetime of IDBObjectStore and IDBIndex are closely intertwined, but we have to break the ref cycle. This patch does a few semi-gnarly things: 1 - Makes both IDBIndex and IDBObjectStore have a custom marking function so they can add each other as opaque roots. 2 - Adds a lock to protect IDBObjectStore's collection of referenced indexes to support #1, as GC marking can happen on any thread. 3 - Makes IDBIndex not be traditionally RefCounted; Instead, IDBIndex::ref()/deref() simply ref()/deref() the owning IDBObjectStore. 4 - ...Except when somebody deletes an IDBIndex from its IDBObjectStore. Once that happens, the object store no longer has a reference back to the index, but the index still needs a reference back to the object store. To support this, the IDBIndex becomes "traditionally RefCounted" while holding a ref to its IDBObjectStore. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBIndex.h: (WebCore::IDBIndex::isModern): * Modules/indexeddb/IDBIndex.idl: * Modules/indexeddb/IDBObjectStore.h: (WebCore::IDBObjectStore::isModern): * Modules/indexeddb/IDBObjectStore.idl: * Modules/indexeddb/client/IDBIndexImpl.cpp: (WebCore::IDBClient::IDBIndex::objectStore): (WebCore::IDBClient::IDBIndex::openCursor): (WebCore::IDBClient::IDBIndex::doCount): (WebCore::IDBClient::IDBIndex::openKeyCursor): (WebCore::IDBClient::IDBIndex::doGet): (WebCore::IDBClient::IDBIndex::doGetKey): (WebCore::IDBClient::IDBIndex::markAsDeleted): (WebCore::IDBClient::IDBIndex::ref): (WebCore::IDBClient::IDBIndex::deref): (WebCore::IDBClient::IDBIndex::create): Deleted. * Modules/indexeddb/client/IDBIndexImpl.h: (WebCore::IDBClient::IDBIndex::modernObjectStore): * Modules/indexeddb/client/IDBObjectStoreImpl.cpp: (WebCore::IDBClient::IDBObjectStore::createIndex): (WebCore::IDBClient::IDBObjectStore::index): (WebCore::IDBClient::IDBObjectStore::deleteIndex): (WebCore::IDBClient::IDBObjectStore::visitReferencedIndexes): * Modules/indexeddb/client/IDBObjectStoreImpl.h: * Modules/indexeddb/client/IDBTransactionImpl.cpp: (WebCore::IDBClient::IDBTransaction::createIndex): * Modules/indexeddb/client/IDBTransactionImpl.h: * Modules/indexeddb/legacy/LegacyIndex.cpp: (WebCore::LegacyIndex::ref): (WebCore::LegacyIndex::deref): * Modules/indexeddb/legacy/LegacyIndex.h: * bindings/js/JSIDBIndexCustom.cpp: Added. (WebCore::JSIDBIndex::visitAdditionalChildren): * bindings/js/JSIDBObjectStoreCustom.cpp: (WebCore::JSIDBObjectStore::visitAdditionalChildren): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@196482 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
beidson@apple.com
committed
Feb 12, 2016
1 parent
e6eb0ea
commit a578b0e
Showing
17 changed files
with
276 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.