Bug 99370 - Inspector: Don't trip assert when inspecting an empty db
Summary: Inspector: Don't trip assert when inspecting an empty db
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: David Grogan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-15 14:38 PDT by David Grogan
Modified: 2012-10-16 15:00 PDT (History)
4 users (show)

See Also:


Attachments
Patch (2.40 KB, patch)
2012-10-15 14:38 PDT, David Grogan
no flags Details | Formatted Diff | Diff
Patch for landing (1.63 KB, patch)
2012-10-16 14:00 PDT, David Grogan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Grogan 2012-10-15 14:38:33 PDT
Inspector: Don't fire assert when inspecting an empty db
Comment 1 David Grogan 2012-10-15 14:38:49 PDT
Created attachment 168787 [details]
Patch
Comment 2 David Grogan 2012-10-15 15:21:34 PDT
Josh, could you take a look at this?
Vsevik, could you review this?

This fixes the assert I get when running with epg's idb directory in a debug build of chrome.

After I fixed that I noticed that the inspector was printing errors:
[22373:22373:1015/141603:ERROR:CONSOLE(828)] "Uncaught TypeError: Cannot read property 'databaseId' of undefined", source: chrome-devtools://devtools/devtools.html?docked=true&dockSide=bottom&toolbarColor=rgba(242,241,240,1)&textColor=rgba(76,76,76,1) (828)


The js change stops those from spewing but I don't how this._database isn't initialized before the call to select.
Comment 3 Joshua Bell 2012-10-15 15:36:40 PDT
Comment on attachment 168787 [details]
Patch

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

> Source/WebCore/inspector/InspectorIndexedDBAgent.cpp:107
> +    virtual void onUpgradeNeeded(int64_t, PassRefPtr<WebCore::IDBTransactionBackendInterface>, PassRefPtr<WebCore::IDBDatabaseBackendInterface>) OVERRIDE { }

LGTM.

> Source/WebCore/inspector/front-end/ResourcesPanel.js:1659
> +        // FIXME: Why does this happen sometimes?

But since IDB is async and this._database is populated in update() in response to _indexedDBLoaded() firing, perhaps the selection can be set earlier programmatically?

(This is really a question for the Inspector folks.)
Comment 4 Vsevolod Vlasov 2012-10-16 01:05:31 PDT
Could you please use http://webkit.org/new-inspector-bug to report inspector bugs? We use this link to automatically select correct component and add folks to the cc.
Comment 5 Vsevolod Vlasov 2012-10-16 01:05:45 PDT
Comment on attachment 168787 [details]
Patch

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

>> Source/WebCore/inspector/front-end/ResourcesPanel.js:1659
>> +        // FIXME: Why does this happen sometimes?
> 
> But since IDB is async and this._database is populated in update() in response to _indexedDBLoaded() firing, perhaps the selection can be set earlier programmatically?
> 
> (This is really a question for the Inspector folks.)

This is just hiding the manifestation of the problem without fixing it. Please revert before landing.

I filed https://bugs.webkit.org/show_bug.cgi?id=99434 for that issue, I can fix it myself.
Comment 6 David Grogan 2012-10-16 14:00:02 PDT
Created attachment 169018 [details]
Patch for landing
Comment 7 David Grogan 2012-10-16 14:00:45 PDT
(In reply to comment #4)
> Could you please use http://webkit.org/new-inspector-bug to report inspector bugs? We use this link to automatically select correct component and add folks to the cc.

Sure, thanks for letting me know.
Comment 8 WebKit Review Bot 2012-10-16 15:00:37 PDT
Comment on attachment 169018 [details]
Patch for landing

Clearing flags on attachment: 169018

Committed r131511: <http://trac.webkit.org/changeset/131511>
Comment 9 WebKit Review Bot 2012-10-16 15:00:43 PDT
All reviewed patches have been landed.  Closing bug.