Bug 152933 - Web Inspector: Modern IDB: Backend should send events when DBs are created/deleted/updated
Summary: Web Inspector: Modern IDB: Backend should send events when DBs are created/de...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 149117
Blocks: 165889
  Show dependency treegraph
 
Reported: 2016-01-08 15:46 PST by Joseph Pecoraro
Modified: 2016-12-14 20:41 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2016-01-08 15:46:36 PST
* SUMMARY
Modern IDB: Backend should send events when DBs / ObjectStores are created/deleted

This serves multiple purposes:
  (1) under modern IDB there doesn't exist a way to get a list of all the IDB names (we could create one for Inspector eventually)
  (2) currently when a page opens an IDB, it should show up in the tools but doesn't. An event would solve that.

This primarily solves (2) which is a better user experience (dynamically updating available IDB databases/stores). (1) Should be solved eventually but can be done separately.
Comment 1 Radar WebKit Bug Importer 2016-01-08 15:47:42 PST
<rdar://problem/24115467>
Comment 2 Joseph Pecoraro 2016-01-08 15:54:04 PST
A basic set of events could include:

    "events": [
        {
            "name": "databaseOpened",
            "parameters": [
                { "name": "databaseWithObjectStores", "$ref": "DatabaseWithObjectStores", "description": "Database with an array of object stores." }
            ]
        },
        {
            "name": "databaseDeleted",
            "parameters": [
                { "name": "securityOrigin", "type": "string", "description": "Security origin." },
                { "name": "databaseName", "type": "string", "description": "Database name." }
            ]
        },
        {
            "name": "objectStoreCreated",
            "parameters": [
                { "name": "securityOrigin", "type": "string", "description": "Security origin." },
                { "name": "databaseName", "type": "string", "description": "Database name." }            
                { "name": "name", "type": "string", "description": "Object store name." },
            ]
        },
        {
            "name": "objectStoreDeleted",
            "parameters": [
                { "name": "securityOrigin", "type": "string", "description": "Security origin." },
                { "name": "databaseName", "type": "string", "description": "Database name." }            
                { "name": "name", "type": "string", "description": "Object store name." },
            ]
        },
    ]

But it might also be worthwhile now to introduce a "databaseId" for securityOrigin/databaseName pairs.

Other possible improvements:
- Send update event when a Database changes version?
- Send update event when an ObjectStore is modified?
Comment 3 Joseph Pecoraro 2016-01-08 16:45:08 PST
Since object stores can only be created/deleted/modified in upgrades that simplifies things.

We would not need objectStoreCreated/Delete events, just a databaseOpened (which could also double for updated) and databaseDeleted, at that point the object stores should be solid.
Comment 4 Joseph Pecoraro 2016-02-25 11:46:44 PST
Even if we did this, we would still want a way for the inspector to get a list of all the open IndexedDBs when the inspector opens... So I think it would still make sense for WebCore provide a way to do that in some way.
Comment 5 Brady Eidson 2016-04-26 13:43:35 PDT
Reversing the blocking relationship here - We don't need this to consider Modern IDB to be complete.