Bug 52624 - Web Inspector: [Chromium] Prepare for landing of detailed heap snapshots
Summary: Web Inspector: [Chromium] Prepare for landing of detailed heap snapshots
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: Mikhail Naganov
URL:
Keywords:
Depends on:
Blocks: 50510
  Show dependency treegraph
 
Reported: 2011-01-18 05:45 PST by Mikhail Naganov
Modified: 2011-03-02 02:21 PST (History)
10 users (show)

See Also:


Attachments
patch (33.27 KB, patch)
2011-01-18 05:49 PST, Mikhail Naganov
no flags Details | Formatted Diff | Diff
rebaselined (33.34 KB, patch)
2011-01-25 02:24 PST, Mikhail Naganov
pfeldman: review-
mnaganov: commit-queue-
Details | Formatted Diff | Diff
comments addressed (35.32 KB, patch)
2011-01-25 05:18 PST, Mikhail Naganov
mnaganov: commit-queue-
Details | Formatted Diff | Diff
added isCanceled (35.32 KB, patch)
2011-01-25 05:30 PST, Mikhail Naganov
pfeldman: review+
mnaganov: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Naganov 2011-01-18 05:45:32 PST
See https://bugs.webkit.org/show_bug.cgi?id=50510

Introduce Preferences.detailedHeapProfiles flag for controlling querying of detailed heap snapshots.
Add boilerplate code for the new view.
Factor out common code.
Comment 1 Mikhail Naganov 2011-01-18 05:49:19 PST
Created attachment 79271 [details]
patch
Comment 2 Mikhail Naganov 2011-01-25 02:24:20 PST
Created attachment 80037 [details]
rebaselined
Comment 3 Pavel Feldman 2011-01-25 04:12:43 PST
Comment on attachment 80037 [details]
rebaselined

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

A bunch of nits, otherwise looks good.

> Source/WebCore/bindings/js/ScriptProfiler.h:41
> +    class HeapSnapshotControl {

HeapSnapshotProgress:
start(totalWork)
worked(workDone)
done()
bool isCanceled()

> Source/WebCore/inspector/front-end/DetailedHeapshotView.js:42
> +    get statusBarItems()

why do you need this?

> Source/WebCore/inspector/front-end/DetailedHeapshotView.js:59
> +        WebInspector.View.prototype.show.call(this, parentElement);

why do you need this?

> Source/WebCore/inspector/front-end/DetailedHeapshotView.js:64
> +        WebInspector.View.prototype.hide.call(this);

why do you need this?

> Source/WebCore/inspector/front-end/DetailedHeapshotView.js:65
> +    },

no trailing coma

> Source/WebCore/inspector/front-end/HeapSnapshot.js:46
> +        return this._getType() === this._snapshot._edgeElementType;

No "get" prefixes in WebCore.
Comment 4 Mikhail Naganov 2011-01-25 05:17:32 PST
Comment on attachment 80037 [details]
rebaselined

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

>> Source/WebCore/bindings/js/ScriptProfiler.h:41
>> +    class HeapSnapshotControl {
> 
> HeapSnapshotProgress:
> start(totalWork)
> worked(workDone)
> done()
> bool isCanceled()

This is also a control interface -- when progress is reported it's possible to cancel job. So I made 'worked' to accept cancellation flag, and 'isCancelled' isn't needed.

>> Source/WebCore/inspector/front-end/DetailedHeapshotView.js:42
>> +    get statusBarItems()
> 
> why do you need this?

Removed. ProfilesPanel required statusBarItems to be defined, I fixed this.

>> Source/WebCore/inspector/front-end/DetailedHeapshotView.js:59
>> +        WebInspector.View.prototype.show.call(this, parentElement);
> 
> why do you need this?

Removed.

>> Source/WebCore/inspector/front-end/DetailedHeapshotView.js:64
>> +        WebInspector.View.prototype.hide.call(this);
> 
> why do you need this?

Removed.

>> Source/WebCore/inspector/front-end/DetailedHeapshotView.js:65
>> +    },
> 
> no trailing coma

Fixed.

>> Source/WebCore/inspector/front-end/HeapSnapshot.js:46
>> +        return this._getType() === this._snapshot._edgeElementType;
> 
> No "get" prefixes in WebCore.

Fixed all such issues.
Comment 5 Mikhail Naganov 2011-01-25 05:18:41 PST
Created attachment 80050 [details]
comments addressed
Comment 6 Mikhail Naganov 2011-01-25 05:30:18 PST
Created attachment 80051 [details]
added isCanceled
Comment 7 Mikhail Naganov 2011-01-26 08:40:56 PST
Manually committed as http://trac.webkit.org/changeset/76597


    2011-01-25  Mikhail Naganov  <mnaganov@chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Web Inspector: [Chromium] Prepare for landing of detailed heap snapshots.
    
            - Introduce Preferences.detailedHeapProfiles flag for controlling
              querying of detailed heap snapshots.
            - Add boilerplate code for the new view.
            - Factor out common code.
    
            https://bugs.webkit.org/show_bug.cgi?id=52624
    
            * WebCore.gypi:
            * WebCore.vcproj/WebCore.vcproj:
            * bindings/js/ScriptProfiler.h:
            (WebCore::ScriptProfiler::HeapSnapshotControl::~HeapSnapshotControl):
            (WebCore::ScriptProfiler::takeHeapSnapshot):
            * bindings/v8/ScriptProfiler.cpp:
            (WebCore::ScriptProfiler::takeHeapSnapshot):
            * bindings/v8/ScriptProfiler.h:
            (WebCore::ScriptProfiler::HeapSnapshotControl::~HeapSnapshotControl):
            * inspector/Inspector.idl:
            * inspector/InspectorProfilerAgent.cpp:
            (WebCore::InspectorProfilerAgent::takeHeapSnapshot):
            * inspector/InspectorProfilerAgent.h:
            * inspector/front-end/DetailedHeapshotView.js: Added.
            (WebInspector.DetailedHeapshotView):
            (WebInspector.DetailedHeapshotView.prototype.get statusBarItems):
            (WebInspector.DetailedHeapshotView.prototype.get profile):
            (WebInspector.DetailedHeapshotView.prototype.set profile):
            (WebInspector.DetailedHeapshotView.prototype.show):
            (WebInspector.DetailedHeapshotView.prototype.hide):
            (WebInspector.DetailedHeapshotProfileType):
            (WebInspector.DetailedHeapshotProfileType.prototype.get buttonTooltip):
            (WebInspector.DetailedHeapshotProfileType.prototype.get buttonStyle):
            (WebInspector.DetailedHeapshotProfileType.prototype.buttonClicked):
            (WebInspector.DetailedHeapshotProfileType.prototype.get welcomeMessage):
            (WebInspector.DetailedHeapshotProfileType.prototype.createSidebarTreeElementForProfile):
            (WebInspector.DetailedHeapshotProfileType.prototype.createView):
            * inspector/front-end/HeapSnapshot.js: Added.
            (WebInspector.HeapSnapshotEdgesIterator):
            (WebInspector.HeapSnapshotEdgesIterator.prototype.get done):
            (WebInspector.HeapSnapshotEdgesIterator.prototype.get isElement):
            (WebInspector.HeapSnapshotEdgesIterator.prototype.get isHidden):
            (WebInspector.HeapSnapshotEdgesIterator.prototype.get name):
            (WebInspector.HeapSnapshotEdgesIterator.prototype.next):
            (WebInspector.HeapSnapshotEdgesIterator.prototype.get node):
            (WebInspector.HeapSnapshotEdgesIterator.prototype.get nodeIndex):
            (WebInspector.HeapSnapshotEdgesIterator.prototype._getNameOrIndex):
            (WebInspector.HeapSnapshotEdgesIterator.prototype._getType):
            (WebInspector.HeapSnapshotNodeWrapper):
            (WebInspector.HeapSnapshotNodeWrapper.prototype.get edges):
            (WebInspector.HeapSnapshotNodeWrapper.prototype.get edgesCount):
            (WebInspector.HeapSnapshotNodeWrapper.prototype.get instancesCount):
            (WebInspector.HeapSnapshotNodeWrapper.prototype.get isHidden):
            (WebInspector.HeapSnapshotNodeWrapper.prototype.get name):
            (WebInspector.HeapSnapshotNodeWrapper.prototype.get selfSize):
            (WebInspector.HeapSnapshotNodeWrapper.prototype._getName):
            (WebInspector.HeapSnapshotNodeWrapper.prototype._getEdges):
            (WebInspector.HeapSnapshotNodeWrapper.prototype._getType):
            (WebInspector.HeapSnapshot):
            (WebInspector.HeapSnapshot.prototype._init):
            (WebInspector.HeapSnapshot.prototype.get rootEdges):
            * inspector/front-end/HeapSnapshotView.js:
            (WebInspector.HeapSnapshotProfileType.prototype.buttonClicked):
            * inspector/front-end/ProfilesPanel.js:
            (WebInspector.ProfilesPanel.prototype._setRecordingProfile):
            (WebInspector.ProfilesPanel.prototype._reportHeapSnapshotProgress):
            (WebInspector.ProfilerDispatcher.prototype.setRecordingProfile):
            (WebInspector.ProfilerDispatcher.prototype.reportHeapSnapshotProgress):
            * inspector/front-end/Settings.js:
            * inspector/front-end/WebKit.qrc:
            * inspector/front-end/inspector.html:
            * inspector/front-end/inspector.js:
            (WebInspector._createPanels):
            * src/js/DevTools.js:
            ():