Index: Source/devtools/front_end/MemoryStatistics.js |
diff --git a/Source/devtools/front_end/MemoryStatistics.js b/Source/devtools/front_end/MemoryStatistics.js |
index c6a2d1e362323f91c8aa1ade9410827df8fc8c3a..c3b6bf3f7ae172666b2eacd7b89e915016427ebb 100644 |
--- a/Source/devtools/front_end/MemoryStatistics.js |
+++ b/Source/devtools/front_end/MemoryStatistics.js |
@@ -70,14 +70,14 @@ WebInspector.MemoryStatistics = function(delegate, model) |
* @constructor |
* @param {string} counterName |
*/ |
-WebInspector.MemoryStatistics.Counter = function(counterName) |
+WebInspector.Counter = function(counterName) |
{ |
this.counterName = counterName; |
this.times = []; |
this.values = []; |
} |
-WebInspector.MemoryStatistics.Counter.prototype = { |
+WebInspector.Counter.prototype = { |
/** |
* @param {number} time |
* @param {!TimelineAgent.Counters} counters |
@@ -181,34 +181,20 @@ WebInspector.SwatchCheckbox.prototype = { |
/** |
* @constructor |
- * @param {!WebInspector.MemoryStatistics} memoryCountersPane |
- * @param {string} title |
* @param {string} graphColor |
- * @param {!WebInspector.MemoryStatistics.Counter} counter |
+ * @param {!WebInspector.Counter} counter |
*/ |
-WebInspector.CounterUIBase = function(memoryCountersPane, title, graphColor, counter) |
+WebInspector.CounterUIBase = function(graphColor, counter) |
{ |
- this._memoryCountersPane = memoryCountersPane; |
this.counter = counter; |
- var container = memoryCountersPane.sidebarElement().createChild("div", "memory-counter-sidebar-info"); |
- var swatchColor = graphColor; |
- this._swatch = new WebInspector.SwatchCheckbox(WebInspector.UIString(title), swatchColor); |
- this._swatch.addEventListener(WebInspector.SwatchCheckbox.Events.Changed, this._toggleCounterGraph.bind(this)); |
- container.appendChild(this._swatch.element); |
- |
- this._value = null; |
this.graphColor = graphColor; |
this.strokeColor = graphColor; |
this.graphYValues = []; |
-} |
+ this._value = null; |
+ this._marker = null; |
+}, |
WebInspector.CounterUIBase.prototype = { |
- _toggleCounterGraph: function(event) |
- { |
- this._value.classList.toggle("hidden", !this._swatch.checked); |
- this._memoryCountersPane.refresh(); |
- }, |
- |
/** |
* @param {number} x |
* @return {number} |
@@ -239,10 +225,42 @@ WebInspector.CounterUIBase.prototype = { |
this._marker.classList.add("hidden"); |
}, |
+ get visible() { |
+ return true; |
+ }, |
+} |
+ |
+/** |
+ * @constructor |
+ * @param {!WebInspector.MemoryStatistics} memoryCountersPane |
+ * @param {string} title |
+ * @param {string} graphColor |
+ * @param {!WebInspector.Counter} counter |
+ */ |
+WebInspector.MemoryCounterUIBase = function(memoryCountersPane, title, graphColor, counter) |
+{ |
+ WebInspector.CounterUIBase.call(this, graphColor, counter); |
+ this._memoryCountersPane = memoryCountersPane; |
+ var container = memoryCountersPane.sidebarElement().createChild("div", "memory-counter-sidebar-info"); |
+ var swatchColor = graphColor; |
+ this._swatch = new WebInspector.SwatchCheckbox(WebInspector.UIString(title), swatchColor); |
+ this._swatch.addEventListener(WebInspector.SwatchCheckbox.Events.Changed, this._toggleCounterGraph.bind(this)); |
+ container.appendChild(this._swatch.element); |
+} |
+ |
+WebInspector.MemoryCounterUIBase.prototype = { |
+ _toggleCounterGraph: function(event) |
+ { |
+ this._value.classList.toggle("hidden", !this._swatch.checked); |
+ this._memoryCountersPane.refresh(); |
+ }, |
+ |
get visible() |
{ |
return this._swatch.checked; |
}, |
+ |
+ __proto__: WebInspector.CounterUIBase.prototype |
} |
WebInspector.MemoryStatistics.prototype = { |