- a/Source/WebCore/ChangeLog +26 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2012-03-28  Ilya Tikhonovsky  <loislo@chromium.org>
2
3
        Web Inspector: use maxJSObjectId that is provided by back-end.
4
        https://bugs.webkit.org/show_bug.cgi?id=82451
5
6
        Summary view can filter objects in snapshot. It uses maxJSObjectId for this.
7
        There was no such field in the profile header at the
8
        moment but I've landed a patch in downstream.
9
10
        Reviewed by NOBODY (OOPS!).
11
12
        * bindings/v8/ScriptHeapSnapshot.cpp:
13
        (WebCore::ScriptHeapSnapshot::maxSnapshotJSObjectId):
14
        (WebCore):
15
        * bindings/v8/ScriptHeapSnapshot.h:
16
        (WebCore):
17
        (ScriptHeapSnapshot):
18
        * inspector/InspectorProfilerAgent.cpp:
19
        (WebCore::InspectorProfilerAgent::createSnapshotHeader):
20
        * inspector/front-end/DetailedHeapshotView.js:
21
        (WebInspector.HeapSnapshotConstructorsDataGrid.prototype._filterSelectIndexChanged):
22
        (WebInspector.DetailedHeapshotView.prototype._changeFilter):
23
        * inspector/front-end/HeapSnapshot.js:
24
        (WebInspector.HeapSnapshot.prototype.updateStaticData):
25
        * inspector/front-end/HeapSnapshotProxy.js:
26
1
2012-04-02  Pavel Feldman  <pfeldman@chromium.org>
27
2012-04-02  Pavel Feldman  <pfeldman@chromium.org>
2
28
3
        Web Inspector: "Pause on start" doesn't change checked state in workers panel
29
        Web Inspector: "Pause on start" doesn't change checked state in workers panel
- a/Source/WebCore/bindings/v8/ScriptHeapSnapshot.cpp +5 lines
Lines 56-61 unsigned int ScriptHeapSnapshot::uid() const a/Source/WebCore/bindings/v8/ScriptHeapSnapshot.cpp_sec1
56
    return m_snapshot->GetUid();
56
    return m_snapshot->GetUid();
57
}
57
}
58
58
59
SnapshotObjectId ScriptHeapSnapshot::maxSnapshotJSObjectId() const
60
{
61
    return m_snapshot->GetMaxSnapshotJSObjectId();
62
}
63
59
namespace {
64
namespace {
60
65
61
class OutputStreamAdapter : public v8::OutputStream {
66
class OutputStreamAdapter : public v8::OutputStream {
- a/Source/WebCore/bindings/v8/ScriptHeapSnapshot.h +2 lines
Lines 41-46 class HeapSnapshot; a/Source/WebCore/bindings/v8/ScriptHeapSnapshot.h_sec1
41
namespace WebCore {
41
namespace WebCore {
42
42
43
class InspectorObject;
43
class InspectorObject;
44
typedef uint32_t SnapshotObjectId;
44
45
45
class ScriptHeapSnapshot : public RefCounted<ScriptHeapSnapshot> {
46
class ScriptHeapSnapshot : public RefCounted<ScriptHeapSnapshot> {
46
public:
47
public:
Lines 60-65 public: a/Source/WebCore/bindings/v8/ScriptHeapSnapshot.h_sec2
60
    String title() const;
61
    String title() const;
61
    unsigned int uid() const;
62
    unsigned int uid() const;
62
    void writeJSON(OutputStream* stream);
63
    void writeJSON(OutputStream* stream);
64
    SnapshotObjectId maxSnapshotJSObjectId() const;
63
65
64
private:
66
private:
65
    ScriptHeapSnapshot(const v8::HeapSnapshot* snapshot)
67
    ScriptHeapSnapshot(const v8::HeapSnapshot* snapshot)
- a/Source/WebCore/inspector/InspectorProfilerAgent.cpp +1 lines
Lines 182-187 PassRefPtr<InspectorObject> InspectorProfilerAgent::createSnapshotHeader(const S a/Source/WebCore/inspector/InspectorProfilerAgent.cpp_sec1
182
    header->setString("title", snapshot.title());
182
    header->setString("title", snapshot.title());
183
    header->setNumber("uid", snapshot.uid());
183
    header->setNumber("uid", snapshot.uid());
184
    header->setString("typeId", String(HeapProfileType));
184
    header->setString("typeId", String(HeapProfileType));
185
    header->setNumber("maxJSObjectId", snapshot.maxSnapshotJSObjectId());
185
    return header;
186
    return header;
186
}
187
}
187
188
- a/Source/WebCore/inspector/front-end/DetailedHeapshotView.js -23 / +6 lines
Lines 269-304 WebInspector.HeapSnapshotConstructorsDataGrid.prototype = { a/Source/WebCore/inspector/front-end/DetailedHeapshotView.js_sec1
269
        this.snapshot.aggregates(false, key, filter, aggregatesReceived.bind(this, key));
269
        this.snapshot.aggregates(false, key, filter, aggregatesReceived.bind(this, key));
270
    },
270
    },
271
271
272
    _filterSelectIndexChanged: function(loader, profileIndex)
272
    _filterSelectIndexChanged: function(profiles, profileIndex)
273
    {
273
    {
274
        this._filterProfileIndex = profileIndex;
274
        this._filterProfileIndex = profileIndex;
275
275
276
        delete this._maxNodeId;
276
        delete this._maxNodeId;
277
        delete this._minNodeId;
277
        delete this._minNodeId;
278
278
279
        if (this._filterProfileIndex === -1) {
279
        if (this._filterProfileIndex !== -1) {
280
            this.populateChildren();
280
            this._minNodeId = profileIndex > 0 ? profiles[profileIndex - 1].maxJSObjectId : 0;
281
            return;
281
            this._maxNodeId = profiles[profileIndex].maxJSObjectId;
282
        }
283
284
        function firstSnapshotLoaded(snapshot)
285
        {
286
            this._maxNodeId = snapshot.maxNodeId;
287
            if (profileIndex > 0)
288
                loader(profileIndex - 1, secondSnapshotLoaded.bind(this));
289
            else {
290
                this._minNodeId = 0;
291
                this.populateChildren();
292
            }
293
        }
282
        }
294
283
295
        function secondSnapshotLoaded(snapshot)
284
        this.populateChildren();
296
        {
297
            this._minNodeId = snapshot.maxNodeId;
298
            this.populateChildren();
299
        }
300
301
        loader(profileIndex, firstSnapshotLoaded.bind(this));
302
    },
285
    },
303
286
304
};
287
};
Lines 778-784 WebInspector.DetailedHeapshotView.prototype = { a/Source/WebCore/inspector/front-end/DetailedHeapshotView.js_sec2
778
    _changeFilter: function()
761
    _changeFilter: function()
779
    {
762
    {
780
        var profileIndex = this.filterSelectElement.selectedIndex - 1;
763
        var profileIndex = this.filterSelectElement.selectedIndex - 1;
781
        this.dataGrid._filterSelectIndexChanged(this._loadProfileByIndex.bind(this), profileIndex);
764
        this.dataGrid._filterSelectIndexChanged(this._profiles(), profileIndex);
782
765
783
        if (!this.currentQuery || !this._searchFinishedCallback || !this._searchResults)
766
        if (!this.currentQuery || !this._searchFinishedCallback || !this._searchResults)
784
            return;
767
            return;
- a/Source/WebCore/inspector/front-end/HeapSnapshot.js -14 / +1 lines
Lines 987-1005 WebInspector.HeapSnapshot.prototype = { a/Source/WebCore/inspector/front-end/HeapSnapshot.js_sec1
987
        return new WebInspector.HeapSnapshotNode(this, this._rootNodeIndex);
987
        return new WebInspector.HeapSnapshotNode(this, this._rootNodeIndex);
988
    },
988
    },
989
989
990
    get maxNodeId()
991
    {
992
        if (typeof this._maxNodeId === "number")
993
            return this._maxNodeId;
994
        this._maxNodeId = 0;
995
        for (var nodeIdIndex = this._nodeIdOffset; nodeIdIndex < this._onlyNodes.length; nodeIdIndex += this._nodeFieldCount) {
996
            var id = this._onlyNodes[nodeIdIndex];
997
            if ((id % 2) && id > this._maxNodeId)
998
                this._maxNodeId = id;
999
        }
1000
        return this._maxNodeId;
1001
    },
1002
1003
    get rootNodeIndex()
990
    get rootNodeIndex()
1004
    {
991
    {
1005
        return this._rootNodeIndex;
992
        return this._rootNodeIndex;
Lines 1402-1408 WebInspector.HeapSnapshot.prototype = { a/Source/WebCore/inspector/front-end/HeapSnapshot.js_sec2
1402
1389
1403
    updateStaticData: function()
1390
    updateStaticData: function()
1404
    {
1391
    {
1405
        return {nodeCount: this.nodeCount, rootNodeIndex: this._rootNodeIndex, totalSize: this.totalSize, uid: this.uid, nodeFlags: this._nodeFlags, maxNodeId: this.maxNodeId};
1392
        return {nodeCount: this.nodeCount, rootNodeIndex: this._rootNodeIndex, totalSize: this.totalSize, uid: this.uid, nodeFlags: this._nodeFlags};
1406
    }
1393
    }
1407
};
1394
};
1408
1395
- a/Source/WebCore/inspector/front-end/HeapSnapshotProxy.js -5 lines
Lines 369-379 WebInspector.HeapSnapshotProxy.prototype = { a/Source/WebCore/inspector/front-end/HeapSnapshotProxy.js_sec1
369
        return !!this._objectId;
369
        return !!this._objectId;
370
    },
370
    },
371
371
372
    get maxNodeId()
373
    {
374
        return this._staticData.maxNodeId;
375
    },
376
377
    get nodeCount()
372
    get nodeCount()
378
    {
373
    {
379
        return this._staticData.nodeCount;
374
        return this._staticData.nodeCount;

Return to Bug 82451