Enable IndexedDB support in resources panel.
Created attachment 120799 [details] Patch (first draft)
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 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 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.
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.
(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.
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.
*** Bug 46270 has been marked as a duplicate of this bug. ***
Now that IndexedDB is out from experiments this bug could be closed as fixed.