Web Inspector: fix objects duplication when switching filter in heap profiler.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Feb 2012 15:27:08 +0000 (15:27 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Feb 2012 15:27:08 +0000 (15:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77974

Patch by Alexei Filippov <alexeif@chromium.org> on 2012-02-07
Reviewed by Yury Semikhatsky.

* inspector/front-end/DetailedHeapshotView.js:
(WebInspector.HeapSnapshotConstructorsDataGrid.prototype.populateChildren):

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

Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/DetailedHeapshotView.js

index b6d09e1..77bc443 100644 (file)
@@ -1,3 +1,13 @@
+2012-02-07  Alexei Filippov  <alexeif@chromium.org>
+
+        Web Inspector: fix objects duplication when switching filter in heap profiler.
+        https://bugs.webkit.org/show_bug.cgi?id=77974
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/front-end/DetailedHeapshotView.js:
+        (WebInspector.HeapSnapshotConstructorsDataGrid.prototype.populateChildren):
+
 2012-02-07  Jonathan Backer  <backer@chromium.org>
 
         [chromium] Add setNeedsRedraw to WebWidget
index f3b2918..03bca46 100644 (file)
@@ -238,17 +238,13 @@ WebInspector.HeapSnapshotConstructorsDataGrid.prototype = {
             this.sortingChanged();
         }
 
-        if (this._filterProfileIndex === -1) {
-            this.snapshot.aggregates(false, "allObjects", null, aggregatesReceived.bind(this, "allObjects"));
-            return;
-        }
-
         this.dispose();
         this.removeChildren();
         this.resetSortingCache();
 
-        var key = this._minNodeId + ".." + this._maxNodeId;
-        var filter = "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));
     },