Refactor how IDB databases get their disk locations Contrary to a comment and unused static variable, IDBFactoryBackends are not global singletons. They have a 1:1 relationship with IDBFactory. And it doesn't make sense to have one factory support databases in different locations on disk. So this patch moves the directory argument from IDBDatabaseBackend to IDBFactoryBackend. It also adds the top-level security origin as an argument into database opening, as that should further differentiate the uniqueness of a database in the future.
Retitling to Refactor IDB factory creation: -Rework directory location -Make (some) SecurityOrigin arguments be references instead of pointers -Add two SecurityOrigin arguments to opening databases for future use
Created attachment 215200 [details] Patch v1
Comment on attachment 215200 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=215200&action=review > Source/WebKit2/WebProcess/Databases/IndexedDB/WebProcessIDBDatabaseBackend.h:90 > + OwnPtr<WebCore::IDBDatabaseMetadata> m_metadata; Is this being used somewhere?
(In reply to comment #3) > (From update of attachment 215200 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=215200&action=review > > > Source/WebKit2/WebProcess/Databases/IndexedDB/WebProcessIDBDatabaseBackend.h:90 > > + OwnPtr<WebCore::IDBDatabaseMetadata> m_metadata; > > Is this being used somewhere? Probably not, leaked through from a separate patch. Thanks for catching it.
Fixed locally.
Comment on attachment 215200 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=215200&action=review r=me > Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.h:47 > + PageGroupIndexedDatabase(const String& databaseDirectoryIdentifier); explicit > Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:49 > + WorkerGlobalScopeIndexedDatabase(const String& databaseDirectoryIdentifier); explicit > Source/WebCore/Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.h:72 > + IDBFactoryBackendLevelDB(const String& databaseDirectory); explicit > Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.h:51 > + WebIDBFactoryBackend(const String& databaseDirectoryIdentifier); explicit > Source/WebKit2/WebProcess/Databases/IndexedDB/WebProcessIDBDatabaseBackend.h:46 > + static PassRefPtr<WebProcessIDBDatabaseBackend> create(WebIDBFactoryBackend* factory, const String& name) { return adoptRef(new WebProcessIDBDatabaseBackend(factory, name)); } We should pass the WebIDBFactoryBackend by reference here, since null is not a valid input.
Created attachment 215326 [details] Patch for landing Since it's been a few days, want to give EWS another shot at this before landing.
Comment on attachment 215326 [details] Patch for landing Clearing flags on attachment: 215326 Committed r158170: <http://trac.webkit.org/changeset/158170>
All reviewed patches have been landed. Closing bug.