Bug 76711

Summary: Web Inspector: [InspectorIndexedDB] Pass Database, object stores and indexes meta information to frontend.
Product: WebKit Reporter: Vsevolod Vlasov <vsevik>
Component: Web Inspector (Deprecated)Assignee: Vsevolod Vlasov <vsevik>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 75386    
Attachments:
Description Flags
Patch yurys: review+

Description Vsevolod Vlasov 2012-01-20 09:31:44 PST
[IndexedDB] Pass Database, object stores and indexes meta information to frontend.
Comment 1 Vsevolod Vlasov 2012-01-23 11:05:59 PST
Created attachment 123577 [details]
Patch
Comment 2 Yury Semikhatsky 2012-01-24 11:08:26 PST
Comment on attachment 123577 [details]
Patch

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

> Source/WebCore/inspector/InspectorIndexedDBAgent.cpp:149
> +    static PassRefPtr<OpenDatabaseCallback> create(PassRefPtr<ExecutableWithDatabase> executableWithDatabase)

Here and in other places please use raw pointer instead of PassRefPtr if you are not passing ownership.

> Source/WebCore/inspector/InspectorIndexedDBAgent.cpp:204
> +public:
> +    static PassRefPtr<DatabaseLoaderCallback> create(PassRefPtr<InspectorIndexedDBAgent::FrontendProvider> frontendProvider, int requestId)

Raw pointer should be used for frontendProvider parameter here since you don't pass ownership.

> Source/WebCore/inspector/InspectorIndexedDBAgent.cpp:232
> +                if (!idbIndex)

We may want to report about such failures to the front-end.

> Source/WebCore/inspector/front-end/IndexedDBModel.js:390
> +        if (!request.callback)

Should be "if (!request)" ?
Comment 3 Yury Semikhatsky 2012-01-24 11:09:08 PST
(In reply to comment #2)
> (From update of attachment 123577 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=123577&action=review
> 
Could we have a test at least for the protocol changes?
Comment 4 Vsevolod Vlasov 2012-01-25 03:46:42 PST
(In reply to comment #2)
> (From update of attachment 123577 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=123577&action=review
> 
> > Source/WebCore/inspector/InspectorIndexedDBAgent.cpp:149
> > +    static PassRefPtr<OpenDatabaseCallback> create(PassRefPtr<ExecutableWithDatabase> executableWithDatabase)
> 
> Here and in other places please use raw pointer instead of PassRefPtr if you are not passing ownership.
Done.

> > Source/WebCore/inspector/InspectorIndexedDBAgent.cpp:204
> > +public:
> > +    static PassRefPtr<DatabaseLoaderCallback> create(PassRefPtr<InspectorIndexedDBAgent::FrontendProvider> frontendProvider, int requestId)
> 
> Raw pointer should be used for frontendProvider parameter here since you don't pass ownership.
Done.
 
> > Source/WebCore/inspector/InspectorIndexedDBAgent.cpp:232
> > +                if (!idbIndex)
> 
> We may want to report about such failures to the front-end.
I am not sure if such failures can actually happen at all.
Besides that we can not report them directly, as the result of the front-end request is sent as a separate event, not a command response. I am going to address that separately.

> > Source/WebCore/inspector/front-end/IndexedDBModel.js:390
> > +        if (!request.callback)
> 
> Should be "if (!request)" ?
Done.

(In reply to comment #3)
> (In reply to comment #2)
> > (From update of attachment 123577 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=123577&action=review
> > 
> Could we have a test at least for the protocol changes?

Yes, I'll add them in a separate patch. I filed https://bugs.webkit.org/show_bug.cgi?id=77002 and I am going to fix it next thing.
Comment 5 Vsevolod Vlasov 2012-01-25 04:02:11 PST
Committed r105864: <http://trac.webkit.org/changeset/105864>