Title: [107568] trunk/Source/WebCore
Revision
107568
Author
[email protected]
Date
2012-02-13 06:33:29 -0800 (Mon, 13 Feb 2012)

Log Message

Web Inspector: add class filter to heap profiler.
https://bugs.webkit.org/show_bug.cgi?id=78362

Patch by Alexei Filippov <[email protected]> on 2012-02-13
Reviewed by Yury Semikhatsky.

* inspector/front-end/DataGrid.js:
(WebInspector.DataGrid.prototype.insertChild):
* inspector/front-end/DetailedHeapshotView.js:
(WebInspector.HeapSnapshotSortableDataGrid.prototype._performSorting):
(WebInspector.HeapSnapshotConstructorsDataGrid):
(WebInspector.HeapSnapshotConstructorsDataGrid.prototype._nameFilterChanged):
(WebInspector.DetailedHeapshotView.prototype._changeNameFilter):
* inspector/front-end/heapProfiler.css:
(.detailed-heapshot-view .constructors-view-grid):
(.detailed-heapshot-view .constructors-view-toolbar):
(.detailed-heapshot-view .constructors-view-toolbar input.constructors-view-filter):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (107567 => 107568)


--- trunk/Source/WebCore/ChangeLog	2012-02-13 14:27:51 UTC (rev 107567)
+++ trunk/Source/WebCore/ChangeLog	2012-02-13 14:33:29 UTC (rev 107568)
@@ -1,3 +1,22 @@
+2012-02-13  Alexei Filippov  <[email protected]>
+
+        Web Inspector: add class filter to heap profiler.
+        https://bugs.webkit.org/show_bug.cgi?id=78362
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/front-end/DataGrid.js:
+        (WebInspector.DataGrid.prototype.insertChild):
+        * inspector/front-end/DetailedHeapshotView.js:
+        (WebInspector.HeapSnapshotSortableDataGrid.prototype._performSorting):
+        (WebInspector.HeapSnapshotConstructorsDataGrid):
+        (WebInspector.HeapSnapshotConstructorsDataGrid.prototype._nameFilterChanged):
+        (WebInspector.DetailedHeapshotView.prototype._changeNameFilter):
+        * inspector/front-end/heapProfiler.css:
+        (.detailed-heapshot-view .constructors-view-grid):
+        (.detailed-heapshot-view .constructors-view-toolbar):
+        (.detailed-heapshot-view .constructors-view-toolbar input.constructors-view-filter):
+
 2012-02-13  Peter Rybin  <[email protected]>
 
         Web Inspector: In Inspector.json PropertyDescriptor.writable should be declared optional

Modified: trunk/Source/WebCore/inspector/front-end/DataGrid.js (107567 => 107568)


--- trunk/Source/WebCore/inspector/front-end/DataGrid.js	2012-02-13 14:27:51 UTC (rev 107567)
+++ trunk/Source/WebCore/inspector/front-end/DataGrid.js	2012-02-13 14:33:29 UTC (rev 107568)
@@ -711,6 +711,8 @@
 
         if (this.expanded)
             child._attach();
+        if (!this.revealed)
+            child.revealed = false;
     },
 
     removeChild: function(child)

Modified: trunk/Source/WebCore/inspector/front-end/DetailedHeapshotView.js (107567 => 107568)


--- trunk/Source/WebCore/inspector/front-end/DetailedHeapshotView.js	2012-02-13 14:27:51 UTC (rev 107567)
+++ trunk/Source/WebCore/inspector/front-end/DetailedHeapshotView.js	2012-02-13 14:33:29 UTC (rev 107568)
@@ -84,7 +84,9 @@
         children.sort(sortFunction);
         for (var i = 0, l = children.length; i < l; ++i) {
             var child = children[i];
+            var revealed = child.revealed;
             this.appendChild(child);
+            child.revealed = revealed;
             if (child.expanded)
                 child.sort();
         }
@@ -296,6 +298,16 @@
 
         loader(profileIndex, firstSnapshotLoaded.bind(this));
     },
+
+    _nameFilterChanged: function(filterString)
+    {
+        var filter = filterString.toLowerCase();
+        for (var i = 0, l = this.children.length; i < l; ++i) {
+            var node = this.children[i];
+            if (node.depth === 0)
+                node.revealed = node._name.toLowerCase().indexOf(filter) !== -1;
+        }
+    }
 };
 
 WebInspector.HeapSnapshotConstructorsDataGrid.prototype.__proto__ = WebInspector.HeapSnapshotSortableDataGrid.prototype;
@@ -443,7 +455,18 @@
 
     this.constructorsView = new WebInspector.View();
     this.constructorsView.element.addStyleClass("view");
+
+    this.constructorsViewToolbar = document.createElement("div");
+    this.constructorsViewToolbar.addStyleClass("constructors-view-toolbar");
+    this.constructorsViewFilter = document.createElement("input");
+    this.constructorsViewFilter.addStyleClass("constructors-view-filter");
+    this.constructorsViewFilter.setAttribute("placeholder", WebInspector.UIString("Class filter"));
+    this.constructorsViewFilter.addEventListener("keyup", this._changeNameFilter.bind(this), false);
+    this.constructorsViewToolbar.appendChild(this.constructorsViewFilter);
+    this.constructorsView.element.appendChild(this.constructorsViewToolbar);
+
     this.constructorsDataGrid = new WebInspector.HeapSnapshotConstructorsDataGrid();
+    this.constructorsDataGrid.element.addStyleClass("constructors-view-grid");
     this.constructorsDataGrid.element.addEventListener("mousedown", this._mouseDownInContentsGrid.bind(this), true);
     this.constructorsDataGrid.show(this.constructorsView.element);
     this.constructorsDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._selectionChanged, this);
@@ -776,6 +799,11 @@
         this.performSearch(this.currentQuery, this._searchFinishedCallback);
     },
 
+    _changeNameFilter: function()
+    {
+        this.dataGrid._nameFilterChanged(this.constructorsViewFilter.value);
+    },
+
     _profiles: function()
     {
         return WebInspector.panels.profiles.getProfiles(WebInspector.DetailedHeapshotProfileType.TypeId);

Modified: trunk/Source/WebCore/inspector/front-end/heapProfiler.css (107567 => 107568)


--- trunk/Source/WebCore/inspector/front-end/heapProfiler.css	2012-02-13 14:27:51 UTC (rev 107567)
+++ trunk/Source/WebCore/inspector/front-end/heapProfiler.css	2012-02-13 14:33:29 UTC (rev 107568)
@@ -187,6 +187,30 @@
     right: 0;
 }
 
+.detailed-heapshot-view .constructors-view-grid {
+    top: 22px;
+}
+
+.detailed-heapshot-view .constructors-view-toolbar {
+    height: 22px;
+    background-color: #DDD;
+    display: block;
+    position: absolute;
+    left: 0;
+    right: 0;
+    top: 0;
+}
+
+.detailed-heapshot-view .constructors-view-toolbar input.constructors-view-filter {
+    width: 200px;
+    height: 18px;
+    font-size: 11px;
+    padding: 2px;
+    margin: 2px 10px;
+    background-color: white;
+    border: solid 1px #BBB;
+}
+
 .detailed-heapshot-view .retainers-view-header {
     background-image: url(Images/statusbarResizerVertical.png), url(Images/statusbarBackground.png);
     background-repeat: no-repeat, repeat-x;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to