Bug 140108 - Add a DatabaseProvider subclass in WebKit2 and use it for IndexedDB
Summary: Add a DatabaseProvider subclass in WebKit2 and use it for IndexedDB
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-05 17:36 PST by Anders Carlsson
Modified: 2015-01-06 08:54 PST (History)
0 users

See Also:


Attachments
Patch (19.49 KB, patch)
2015-01-05 17:40 PST, Anders Carlsson
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2015-01-05 17:36:48 PST
Add a DatabaseProvider subclass in WebKit2 and use it for IndexedDB
Comment 1 Anders Carlsson 2015-01-05 17:40:45 PST
Created attachment 244023 [details]
Patch
Comment 2 Darin Adler 2015-01-05 20:16:11 PST
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 3 Darin Adler 2015-01-05 20:16:34 PST
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?
Comment 4 Anders Carlsson 2015-01-06 08:49:59 PST
(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!
Comment 5 Anders Carlsson 2015-01-06 08:54:18 PST
Committed r177960: <http://trac.webkit.org/changeset/177960>