Title: [118670] trunk/Source/WebCore
Revision
118670
Author
yu...@chromium.org
Date
2012-05-28 03:20:35 -0700 (Mon, 28 May 2012)

Log Message

Web Inspector: dom counters graphs vanish on switching between timeline views
https://bugs.webkit.org/show_bug.cgi?id=87628

Reviewed by Vsevolod Vlasov.

MemoryStatistics object now listens to the TimelineModel events instead of being
populated by timeline panel. This behavior mathes that of the overview pane.

* inspector/front-end/MemoryStatistics.js:
(WebInspector.MemoryStatistics.prototype.addTimlineEvent):
* inspector/front-end/TimelinePanel.js:
(WebInspector.TimelinePanel.prototype._onTimelineEventRecorded):
(WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (118669 => 118670)


--- trunk/Source/WebCore/ChangeLog	2012-05-28 10:19:40 UTC (rev 118669)
+++ trunk/Source/WebCore/ChangeLog	2012-05-28 10:20:35 UTC (rev 118670)
@@ -1,3 +1,19 @@
+2012-05-28  Yury Semikhatsky  <yu...@chromium.org>
+
+        Web Inspector: dom counters graphs vanish on switching between timeline views
+        https://bugs.webkit.org/show_bug.cgi?id=87628
+
+        Reviewed by Vsevolod Vlasov.
+
+        MemoryStatistics object now listens to the TimelineModel events instead of being
+        populated by timeline panel. This behavior mathes that of the overview pane.
+
+        * inspector/front-end/MemoryStatistics.js:
+        (WebInspector.MemoryStatistics.prototype.addTimlineEvent):
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel.prototype._onTimelineEventRecorded):
+        (WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline):
+
 2012-05-28  Marcus Bulach  <bul...@chromium.org>
 
         [chromium] Buildfix: remove obsolete file from gypi.

Modified: trunk/Source/WebCore/inspector/front-end/MemoryStatistics.js (118669 => 118670)


--- trunk/Source/WebCore/inspector/front-end/MemoryStatistics.js	2012-05-28 10:19:40 UTC (rev 118669)
+++ trunk/Source/WebCore/inspector/front-end/MemoryStatistics.js	2012-05-28 10:20:35 UTC (rev 118670)
@@ -30,14 +30,18 @@
 
 /**
  * @param {WebInspector.TimelinePanel} timelinePanel
+ * @param {WebInspector.TimelineModel} model
  * @param {number} sidebarWidth
  * @constructor
  */
-WebInspector.MemoryStatistics = function(timelinePanel, sidebarWidth)
+WebInspector.MemoryStatistics = function(timelinePanel, model, sidebarWidth)
 {
     this._timelinePanel = timelinePanel;
     this._counters = [];
 
+    model.addEventListener(WebInspector.TimelineModel.Events.RecordAdded, this._onRecordAdded, this);
+    model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleared, this._onRecordsCleared, this);
+
     this._containerAnchor = timelinePanel.element.lastChild;
     this._memorySplitView = new WebInspector.SplitView(WebInspector.SplitView.SidebarPosition.Left, undefined, sidebarWidth);
     this._memorySplitView.sidebarElement.addStyleClass("sidebar");
@@ -207,7 +211,7 @@
 
 
 WebInspector.MemoryStatistics.prototype = {
-    reset: function()
+    _onRecordsCleared: function()
     {
         this._counters = [];
     },
@@ -251,7 +255,7 @@
         this._canvas.height = height;
     },
 
-    addTimlineEvent: function(event)
+    _onRecordAdded: function(event)
     {
         var counters = event.data["counters"];
         this._counters.push({

Modified: trunk/Source/WebCore/inspector/front-end/TimelinePanel.js (118669 => 118670)


--- trunk/Source/WebCore/inspector/front-end/TimelinePanel.js	2012-05-28 10:19:40 UTC (rev 118669)
+++ trunk/Source/WebCore/inspector/front-end/TimelinePanel.js	2012-05-28 10:20:35 UTC (rev 118670)
@@ -61,7 +61,7 @@
     this._timelineMemorySplitter.id = "timeline-memory-splitter";
     this._timelineMemorySplitter.addEventListener("mousedown", this._startSplitterDragging.bind(this), false);
     this._timelineMemorySplitter.addStyleClass("hidden");
-    this._memoryStatistics = new WebInspector.MemoryStatistics(this, this.splitView.preferredSidebarWidth());
+    this._memoryStatistics = new WebInspector.MemoryStatistics(this, this._model, this.splitView.preferredSidebarWidth());
     WebInspector.settings.memoryCounterGraphsHeight = WebInspector.settings.createSetting("memoryCounterGraphsHeight", 150);
 
     var itemsTreeElement = new WebInspector.SidebarSectionTreeElement(WebInspector.UIString("RECORDS"), {}, true);
@@ -482,9 +482,6 @@
     {
         this._innerAddRecordToTimeline(event.data, this._rootRecord());
         this._scheduleRefresh(false);
-
-        if (event.data["counters"])
-            this._memoryStatistics.addTimlineEvent(event);
     },
 
     _innerAddRecordToTimeline: function(record, parentRecord)
@@ -537,7 +534,6 @@
         this._adjustScrollPosition(0);
         this._closeRecordDetails();
         this._allRecordsCount = 0;
-        this._memoryStatistics.reset();
     },
 
     elementsToRestoreScrollPositionsFor: function()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to