Unreviewed, rolling out r112994.
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Apr 2012 08:36:12 +0000 (08:36 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Apr 2012 08:36:12 +0000 (08:36 +0000)
http://trac.webkit.org/changeset/112994
https://bugs.webkit.org/show_bug.cgi?id=83008

This patch has to wait until v8 roll. (Requested by loislo on
#webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-04-03

* bindings/js/ScriptHeapSnapshot.h:
* bindings/v8/ScriptHeapSnapshot.cpp:
(WebCore):
* bindings/v8/ScriptHeapSnapshot.h:
(WebCore):
(ScriptHeapSnapshot):
* inspector/InspectorProfilerAgent.cpp:
(WebCore::InspectorProfilerAgent::createSnapshotHeader):
* inspector/front-end/DetailedHeapshotView.js:
(WebInspector.HeapSnapshotConstructorsDataGrid):
(WebInspector.HeapSnapshotConstructorsDataGrid.prototype.setDataSource):
(WebInspector.HeapSnapshotConstructorsDataGrid.prototype.populateChildren):
(WebInspector.HeapSnapshotConstructorsDataGrid.prototype._filterSelectIndexChanged.firstSnapshotLoaded):
(WebInspector.HeapSnapshotConstructorsDataGrid.prototype._filterSelectIndexChanged.secondSnapshotLoaded):
(WebInspector.HeapSnapshotConstructorsDataGrid.prototype._filterSelectIndexChanged):
(WebInspector.DetailedHeapshotView.prototype._changeFilter):
* inspector/front-end/HeapSnapshot.js:
(WebInspector.HeapSnapshot.prototype.get maxNodeId):
(WebInspector.HeapSnapshot.prototype.updateStaticData):
* inspector/front-end/HeapSnapshotProxy.js:
(WebInspector.HeapSnapshotProxy.prototype.get maxNodeId):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@112996 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/bindings/js/ScriptHeapSnapshot.h
Source/WebCore/bindings/v8/ScriptHeapSnapshot.cpp
Source/WebCore/bindings/v8/ScriptHeapSnapshot.h
Source/WebCore/inspector/InspectorProfilerAgent.cpp
Source/WebCore/inspector/front-end/DetailedHeapshotView.js
Source/WebCore/inspector/front-end/HeapSnapshot.js
Source/WebCore/inspector/front-end/HeapSnapshotProxy.js

index c7099d2..34a199b 100644 (file)
@@ -1,3 +1,34 @@
+2012-04-03  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r112994.
+        http://trac.webkit.org/changeset/112994
+        https://bugs.webkit.org/show_bug.cgi?id=83008
+
+        This patch has to wait until v8 roll. (Requested by loislo on
+        #webkit).
+
+        * bindings/js/ScriptHeapSnapshot.h:
+        * bindings/v8/ScriptHeapSnapshot.cpp:
+        (WebCore):
+        * bindings/v8/ScriptHeapSnapshot.h:
+        (WebCore):
+        (ScriptHeapSnapshot):
+        * inspector/InspectorProfilerAgent.cpp:
+        (WebCore::InspectorProfilerAgent::createSnapshotHeader):
+        * inspector/front-end/DetailedHeapshotView.js:
+        (WebInspector.HeapSnapshotConstructorsDataGrid):
+        (WebInspector.HeapSnapshotConstructorsDataGrid.prototype.setDataSource):
+        (WebInspector.HeapSnapshotConstructorsDataGrid.prototype.populateChildren):
+        (WebInspector.HeapSnapshotConstructorsDataGrid.prototype._filterSelectIndexChanged.firstSnapshotLoaded):
+        (WebInspector.HeapSnapshotConstructorsDataGrid.prototype._filterSelectIndexChanged.secondSnapshotLoaded):
+        (WebInspector.HeapSnapshotConstructorsDataGrid.prototype._filterSelectIndexChanged):
+        (WebInspector.DetailedHeapshotView.prototype._changeFilter):
+        * inspector/front-end/HeapSnapshot.js:
+        (WebInspector.HeapSnapshot.prototype.get maxNodeId):
+        (WebInspector.HeapSnapshot.prototype.updateStaticData):
+        * inspector/front-end/HeapSnapshotProxy.js:
+        (WebInspector.HeapSnapshotProxy.prototype.get maxNodeId):
+
 2012-03-28  Ilya Tikhonovsky  <loislo@chromium.org>
 
         Web Inspector: use maxJSObjectId that is provided by back-end.
index c7082cb..e573854 100644 (file)
@@ -36,8 +36,6 @@
 
 namespace WebCore {
 
-typedef uint32_t SnapshotObjectId;
-
 class ScriptHeapSnapshot : public RefCounted<ScriptHeapSnapshot> {
 public:
     class OutputStream {
@@ -53,7 +51,6 @@ public:
     unsigned int uid() const { return 0; }
 
     void writeJSON(OutputStream*) { }
-    SnapshotObjectId maxSnapshotJSObjectId() const { return 0; }
 
 private:
     ScriptHeapSnapshot() { }
index 769764e..68ed8da 100644 (file)
@@ -56,11 +56,6 @@ unsigned int ScriptHeapSnapshot::uid() const
     return m_snapshot->GetUid();
 }
 
-SnapshotObjectId ScriptHeapSnapshot::maxSnapshotJSObjectId() const
-{
-    return m_snapshot->GetMaxSnapshotJSObjectId();
-}
-
 namespace {
 
 class OutputStreamAdapter : public v8::OutputStream {
index 036bf25..1571496 100644 (file)
@@ -41,7 +41,6 @@ class HeapSnapshot;
 namespace WebCore {
 
 class InspectorObject;
-typedef uint32_t SnapshotObjectId;
 
 class ScriptHeapSnapshot : public RefCounted<ScriptHeapSnapshot> {
 public:
@@ -61,7 +60,6 @@ public:
     String title() const;
     unsigned int uid() const;
     void writeJSON(OutputStream* stream);
-    SnapshotObjectId maxSnapshotJSObjectId() const;
 
 private:
     ScriptHeapSnapshot(const v8::HeapSnapshot* snapshot)
index 6a1d3c5..c76aae8 100644 (file)
@@ -182,7 +182,6 @@ PassRefPtr<InspectorObject> InspectorProfilerAgent::createSnapshotHeader(const S
     header->setString("title", snapshot.title());
     header->setNumber("uid", snapshot.uid());
     header->setString("typeId", String(HeapProfileType));
-    header->setNumber("maxJSObjectId", snapshot.maxSnapshotJSObjectId());
     return header;
 }
 
index ad2f346..e9d0033 100644 (file)
@@ -225,7 +225,7 @@ WebInspector.HeapSnapshotConstructorsDataGrid = function()
         retainedSize: { title: WebInspector.UIString("Retained Size"), width: "120px", sort: "descending", sortable: true }
     };
     WebInspector.HeapSnapshotSortableDataGrid.call(this, columns);
-    this._profileIndex = -1;
+    this._filterProfileIndex = -1;
 }
 
 WebInspector.HeapSnapshotConstructorsDataGrid.prototype = {
@@ -246,7 +246,7 @@ WebInspector.HeapSnapshotConstructorsDataGrid.prototype = {
     {
         this.snapshotView = snapshotView;
         this.snapshot = snapshot;
-        if (this._profileIndex === -1)
+        if (this._filterProfileIndex === -1)
             this.populateChildren();
     },
 
@@ -263,25 +263,42 @@ WebInspector.HeapSnapshotConstructorsDataGrid.prototype = {
         this.removeChildren();
         this.resetSortingCache();
 
-        var key = this._profileIndex === -1 ? "allObjects" : this._minNodeId + ".." + this._maxNodeId;
-        var filter = this._profileIndex === -1 ? null : "function(node) { var id = node.id; return id > " + this._minNodeId + " && id <= " + this._maxNodeId + "; }";
+        var key = this._filterProfileIndex === -1 ? "allObjects" : this._minNodeId + ".." + this._maxNodeId;
+        var filter = this._filterProfileIndex === -1 ? null : "function(node) { var id = node.id; return id > " + this._minNodeId + " && id <= " + this._maxNodeId + "; }";
 
         this.snapshot.aggregates(false, key, filter, aggregatesReceived.bind(this, key));
     },
 
-    _filterSelectIndexChanged: function(profiles, profileIndex)
+    _filterSelectIndexChanged: function(loader, profileIndex)
     {
-        this._profileIndex = profileIndex;
+        this._filterProfileIndex = profileIndex;
 
         delete this._maxNodeId;
         delete this._minNodeId;
 
-        if (this._profileIndex !== -1) {
-            this._minNodeId = profileIndex > 0 ? profiles[profileIndex - 1].maxJSObjectId : 0;
-            this._maxNodeId = profiles[profileIndex].maxJSObjectId;
+        if (this._filterProfileIndex === -1) {
+            this.populateChildren();
+            return;
         }
 
-        this.populateChildren();
+        function firstSnapshotLoaded(snapshot)
+        {
+            this._maxNodeId = snapshot.maxNodeId;
+            if (profileIndex > 0)
+                loader(profileIndex - 1, secondSnapshotLoaded.bind(this));
+            else {
+                this._minNodeId = 0;
+                this.populateChildren();
+            }
+        }
+
+        function secondSnapshotLoaded(snapshot)
+        {
+            this._minNodeId = snapshot.maxNodeId;
+            this.populateChildren();
+        }
+
+        loader(profileIndex, firstSnapshotLoaded.bind(this));
     },
 
 };
@@ -761,7 +778,7 @@ WebInspector.DetailedHeapshotView.prototype = {
     _changeFilter: function()
     {
         var profileIndex = this.filterSelectElement.selectedIndex - 1;
-        this.dataGrid._filterSelectIndexChanged(this._profiles(), profileIndex);
+        this.dataGrid._filterSelectIndexChanged(this._loadProfileByIndex.bind(this), profileIndex);
 
         if (!this.currentQuery || !this._searchFinishedCallback || !this._searchResults)
             return;
index a3177ed..e7a1213 100644 (file)
@@ -987,6 +987,19 @@ WebInspector.HeapSnapshot.prototype = {
         return new WebInspector.HeapSnapshotNode(this, this._rootNodeIndex);
     },
 
+    get maxNodeId()
+    {
+        if (typeof this._maxNodeId === "number")
+            return this._maxNodeId;
+        this._maxNodeId = 0;
+        for (var nodeIdIndex = this._nodeIdOffset; nodeIdIndex < this._onlyNodes.length; nodeIdIndex += this._nodeFieldCount) {
+            var id = this._onlyNodes[nodeIdIndex];
+            if ((id % 2) && id > this._maxNodeId)
+                this._maxNodeId = id;
+        }
+        return this._maxNodeId;
+    },
+
     get rootNodeIndex()
     {
         return this._rootNodeIndex;
@@ -1389,7 +1402,7 @@ WebInspector.HeapSnapshot.prototype = {
 
     updateStaticData: function()
     {
-        return {nodeCount: this.nodeCount, rootNodeIndex: this._rootNodeIndex, totalSize: this.totalSize, uid: this.uid, nodeFlags: this._nodeFlags};
+        return {nodeCount: this.nodeCount, rootNodeIndex: this._rootNodeIndex, totalSize: this.totalSize, uid: this.uid, nodeFlags: this._nodeFlags, maxNodeId: this.maxNodeId};
     }
 };
 
index fdf7ccf..6c2cb41 100644 (file)
@@ -369,6 +369,11 @@ WebInspector.HeapSnapshotProxy.prototype = {
         return !!this._objectId;
     },
 
+    get maxNodeId()
+    {
+        return this._staticData.maxNodeId;
+    },
+
     get nodeCount()
     {
         return this._staticData.nodeCount;