Bug 75386 - Web Inspector: Enable IndexedDB support in resources panel.
Summary: Web Inspector: Enable IndexedDB support in resources panel.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Vsevolod Vlasov
URL:
Keywords:
: 46270 (view as bug list)
Depends on: 76264 76705 76711 77002 77439 78503 78609 79098 79691 79695 80022 82635
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-30 06:56 PST by Vsevolod Vlasov
Modified: 2012-04-17 06:36 PDT (History)
15 users (show)

See Also:


Attachments
Patch (first draft) (26.29 KB, patch)
2011-12-30 06:58 PST, Vsevolod Vlasov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vsevolod Vlasov 2011-12-30 06:56:21 PST
Enable IndexedDB support in resources panel.
Comment 1 Vsevolod Vlasov 2011-12-30 06:58:47 PST
Created attachment 120799 [details]
Patch (first draft)
Comment 2 Vsevolod Vlasov 2011-12-30 07:01:07 PST
Here is the first draft for IndexedDB support in inspector.

This patch contains
 - new InspectorIndexedDBAgent backend boilerplate
 - new IndexedDBModel front-end boilerplate
 - proposed implementation of getDatabaseNames for all frames.
Comment 3 Timothy Hatcher 2011-12-30 09:18:05 PST
Comment on attachment 120799 [details]
Patch (first draft)

View in context: https://bugs.webkit.org/attachment.cgi?id=120799&action=review

> Source/WebCore/inspector/Inspector.json:928
> +                "name": "requestDatabaseNamesForFrame",

Are the databases shared between frames if they have the same origin? If so shouldn't this be origin based not frame based? (I know nothing about IndexedDB…)

> Source/WebCore/inspector/Inspector.json:937
> +                "name": "databaseNamesForFrameLoaded",

"databaseNamesForFrameLoaded" is too verbose. I think "databaseNamesLoaded" is enough or even better "databasesAvailable".
Comment 4 Joshua Bell 2012-01-05 15:12:24 PST
Comment on attachment 120799 [details]
Patch (first draft)

View in context: https://bugs.webkit.org/attachment.cgi?id=120799&action=review

>> Source/WebCore/inspector/Inspector.json:928
>> +                "name": "requestDatabaseNamesForFrame",
> 
> Are the databases shared between frames if they have the same origin? If so shouldn't this be origin based not frame based? (I know nothing about IndexedDB…)

And I know nothing about the inspector...

On the IDB side, a database is owned by an origin. The backend (browser process) IDBDatabaseBackend would be per-origin. On the renderer side, each IDBDatabase is actually a "connection" to a backend, these are never shared and there may be multiple per process that are connections to the same browser-side IDBDatabaseBackend.

Agreed that "Origin" might be a better term here; obviously if the inspector is coded to refer to Frames then at some point between Inspector-centric code and IDB-centric code the terminology would switch.

> Source/WebCore/inspector/InspectorIndexedDBAgent.cpp:185
> +    IDBFactoryBackendInterface* idbBackend = document->page()->group().idbFactory();

Talking to the BackendInterfaces is necessary right now, as most of the IDB logic is implemented in the "backend" (e.g. in Chrome this is a proxy to the browser process where the backing store lives). If we change things to pull the logic to the "frontend" the API would remain fairly similar although the objects would change (e.g. this could could interact directly with an IDBFactory instance).

So: looks good so far.
Comment 5 Timothy Hatcher 2012-01-05 17:05:38 PST
My main point was the Inspector UI should not show the same database multiple times if the page has multiple frames with connections to the same database. The connection has nothing inseresting (that I know of) to show.
Comment 6 Vsevolod Vlasov 2012-01-11 07:09:42 PST
(In reply to comment #3)
> (From update of attachment 120799 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=120799&action=review
> 
> > Source/WebCore/inspector/Inspector.json:928
> > +                "name": "requestDatabaseNamesForFrame",
> 
> Are the databases shared between frames if they have the same origin? If so shouldn't this be origin based not frame based? (I know nothing about IndexedDB…)

Indeed, as jsbell@ mentioned databases are owned by origin. But IDBFactoryBackendInterface::getDatabaseNames accepts frame and SecurityOrigin objects as parameters, so frameId is a natural way for front-end to access IDB.

This implementation creates some overhead when there are several frames with the same origin though. We can pass security origins for each frame to front-end to make sure we don't do extra requests from front-end.
Comment 7 Vsevolod Vlasov 2012-01-13 03:45:41 PST
I filed https://bugs.webkit.org/show_bug.cgi?id=76264 for boilerplate and getDatabaseNames support.
I'll use this issue as meta-bug for all inspector IndexedDB support.
Comment 8 Vsevolod Vlasov 2012-02-29 01:47:06 PST
*** Bug 46270 has been marked as a duplicate of this bug. ***
Comment 9 Vsevolod Vlasov 2012-04-17 06:36:24 PDT
Now that IndexedDB is out from experiments this bug could be closed as fixed.