Add a DatabaseProvider subclass in WebKit2 and use it for IndexedDB
Created attachment 244023 [details] Patch
Comment on attachment 244023 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=244023&action=review > Source/WebKit2/WebProcess/Databases/WebDatabaseProvider.cpp:44 > +RefPtr<WebDatabaseProvider> WebDatabaseProvider::getOrCreate(uint64_t identifier) Why not use Ref for the return value instead of RefPtr since it’s never null? > Source/WebKit2/WebProcess/Databases/WebDatabaseProvider.cpp:50 > + RefPtr<WebDatabaseProvider> storageNamespaceProvider = adoptRef(new WebDatabaseProvider(identifier)); Why not use Ref for this instead of RefPtr since it’s never null? > Source/WebKit2/WebProcess/Databases/WebDatabaseProvider.h:42 > + RefPtr<WebCore::IDBFactoryBackendInterface> createIDBFactoryBackend() override; I think you should include "virtual" here.
Comment on attachment 244023 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=244023&action=review > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:375 > + pageConfiguration.databaseProvider = WebDatabaseProvider::getOrCreate(m_pageGroup->pageGroupID()); What guarantees this ID won’t be 0 or -1?
(In reply to comment #3) > Comment on attachment 244023 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=244023&action=review > > > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:375 > > + pageConfiguration.databaseProvider = WebDatabaseProvider::getOrCreate(m_pageGroup->pageGroupID()); > > What guarantees this ID won’t be 0 or -1? The page group ID will never be null, it's decided by the UI process. (In the future, we won't use the page group ID for this but an ID representing the website data store). I'll make the Ref changes you suggested, thanks!
Committed r177960: <http://trac.webkit.org/changeset/177960>