Bug 108456 - Web Inspector: Exception in HeapSnapshotView.js
Summary: Web Inspector: Exception in HeapSnapshotView.js
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: Andrey Adaikin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-31 04:10 PST by Andrey Adaikin
Modified: 2013-01-31 06:17 PST (History)
9 users (show)

See Also:


Attachments
Patch (1.83 KB, patch)
2013-01-31 04:11 PST, Andrey Adaikin
no flags Details | Formatted Diff | Diff
Patch (2.10 KB, patch)
2013-01-31 04:28 PST, Andrey Adaikin
no flags Details | Formatted Diff | Diff
Patch (2.60 KB, patch)
2013-01-31 05:11 PST, Andrey Adaikin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Adaikin 2013-01-31 04:10:01 PST
Patch to follow.

Repro:
- Go to Profiles panel and take a Heap Snapshot
- Remove the snapshot profile header from the sidebar via context menu
- Run another profile, e.g. Capture Canvas Frame
- Observe the exception below:

Uncaught TypeError: Cannot call method 'fromFile' of undefined InspectorBackend.js:186
InspectorBackendClass.dispatch InspectorBackend.js:186
InspectorFrontendAPI.dispatchMessage InspectorFrontendAPI.js:198

Stack trace:

WebInspector.HeapSnapshotView._updateFilterOptions (HeapSnapshotView.js:724)
WebInspector.Object.dispatchEventToListeners (Object.js:101)
WebInspector.ProfilesPanel.addProfileHeader (ProfilesPanel.js:580)
WebInspector.CanvasProfileType._didStartCapturingFrame (CanvasProfileView.js:496)
InspectorBackendClass.dispatch (InspectorBackend.js:186)
InspectorFrontendAPI.dispatchMessage (InspectorFrontendAPI.js:198)
Comment 1 Andrey Adaikin 2013-01-31 04:11:17 PST
Created attachment 185742 [details]
Patch
Comment 2 Yury Semikhatsky 2013-01-31 04:15:32 PST
Comment on attachment 185742 [details]
Patch

We should check that the profile being added is a heap snapshot and ignore all other notifications.
Comment 3 Andrey Adaikin 2013-01-31 04:28:46 PST
Created attachment 185747 [details]
Patch
Comment 4 Yury Semikhatsky 2013-01-31 04:34:36 PST
Comment on attachment 185747 [details]
Patch

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

> Source/WebCore/inspector/front-end/HeapSnapshotView.js:741
> +        if (!event.data || event.data.type !== WebInspector.HeapSnapshotProfileType.TypeId)

This one will not work for native snapshots with type WebInspector.NativeSnapshotProfileType.TypeId which reuses the same view so we should probably save profile type from the |profile| argument to HeapSnapshotView and compare with it here.
Comment 5 Andrey Adaikin 2013-01-31 05:11:00 PST
Created attachment 185754 [details]
Patch
Comment 6 WebKit Review Bot 2013-01-31 06:17:02 PST
Comment on attachment 185754 [details]
Patch

Clearing flags on attachment: 185754

Committed r141415: <http://trac.webkit.org/changeset/141415>
Comment 7 WebKit Review Bot 2013-01-31 06:17:05 PST
All reviewed patches have been landed.  Closing bug.