Title: [144625] trunk/Source/WebCore
Revision
144625
Author
loi...@chromium.org
Date
2013-03-04 07:07:17 -0800 (Mon, 04 Mar 2013)

Log Message

Web Inspector: CPU Flame Chart: reveal profiler DataGrid node when user clicks on a FlameChart item.
https://bugs.webkit.org/show_bug.cgi?id=111309

Reviewed by Yury Semikhatsky.

* inspector/front-end/CPUProfileView.js:
(WebInspector.CPUProfileView.prototype._revealProfilerNode):
* inspector/front-end/FlameChart.js:
(WebInspector.FlameChart):
(WebInspector.FlameChart.prototype._onClick):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (144624 => 144625)


--- trunk/Source/WebCore/ChangeLog	2013-03-04 14:07:57 UTC (rev 144624)
+++ trunk/Source/WebCore/ChangeLog	2013-03-04 15:07:17 UTC (rev 144625)
@@ -1,3 +1,16 @@
+2013-03-04  Ilya Tikhonovsky  <loi...@chromium.org>
+
+        Web Inspector: CPU Flame Chart: reveal profiler DataGrid node when user clicks on a FlameChart item.
+        https://bugs.webkit.org/show_bug.cgi?id=111309
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/front-end/CPUProfileView.js:
+        (WebInspector.CPUProfileView.prototype._revealProfilerNode):
+        * inspector/front-end/FlameChart.js:
+        (WebInspector.FlameChart):
+        (WebInspector.FlameChart.prototype._onClick):
+
 2013-03-04  Antoine Quint  <grao...@apple.com>
 
         Web Inspector: remove existing LayerTreeAgent protocol APIs

Modified: trunk/Source/WebCore/inspector/front-end/CPUProfileView.js (144624 => 144625)


--- trunk/Source/WebCore/inspector/front-end/CPUProfileView.js	2013-03-04 14:07:57 UTC (rev 144624)
+++ trunk/Source/WebCore/inspector/front-end/CPUProfileView.js	2013-03-04 15:07:17 UTC (rev 144625)
@@ -61,6 +61,7 @@
         this.dataGrid.show(this._splitView.firstElement());
 
         this.flameChart = new WebInspector.FlameChart(this);
+        this.flameChart.addEventListener(WebInspector.FlameChart.Events.SelectedNode, this._revealProfilerNode.bind(this));
         this.flameChart.show(this._splitView.secondElement());
     } else
         this.dataGrid.show(this.element);
@@ -98,6 +99,17 @@
 WebInspector.CPUProfileView._TypeHeavy = "Heavy";
 
 WebInspector.CPUProfileView.prototype = {
+    _revealProfilerNode: function(event)
+    {
+        var current = this.profileDataGridTree.children[0];
+
+        while (current && current.profileNode !== event.data)
+            current = current.traverseNextNode(false, null, false);
+
+        if (current)
+            current.revealAndSelect();
+    },
+
     /**
      * @param {?Protocol.Error} error
      * @param {ProfilerAgent.CPUProfile} profile

Modified: trunk/Source/WebCore/inspector/front-end/FlameChart.js (144624 => 144625)


--- trunk/Source/WebCore/inspector/front-end/FlameChart.js	2013-03-04 14:07:57 UTC (rev 144624)
+++ trunk/Source/WebCore/inspector/front-end/FlameChart.js	2013-03-04 15:07:17 UTC (rev 144625)
@@ -45,9 +45,21 @@
     this._yScaleFactor = 10;
     this._minWidth = 3;
     this.element._onmousemove_ = this._onMouseMove.bind(this);
+    this.element._onclick_ = this._onClick.bind(this);
 }
 
+WebInspector.FlameChart.Events = {
+    SelectedNode: "SelectedNode"
+}
+
 WebInspector.FlameChart.prototype = {
+    _onClick: function(e)
+    {
+        if (!this._highlightedNode)
+            return;
+        this.dispatchEventToListeners(WebInspector.FlameChart.Events.SelectedNode, this._highlightedNode);
+    },
+
     _onMouseMove: function(e)
     {
         var node = this._coordinatesToNode(e.offsetX, e.offsetY);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to