* @implements {WebInspector.TimelineModeView}
* @param {!WebInspector.TimelineModeViewDelegate} delegate
* @param {!WebInspector.TimelineModel} model
+ * @param {!WebInspector.TimelineUIUtils} uiUtils
*/
-WebInspector.MemoryCountersGraph = function(delegate, model)
+WebInspector.MemoryCountersGraph = function(delegate, model, uiUtils)
{
WebInspector.CountersGraph.call(this, WebInspector.UIString("MEMORY"), delegate, model);
+ this._uiUtils = uiUtils;
this._countersByName = {};
this._countersByName["jsHeapSizeUsed"] = this.createCounter(WebInspector.UIString("Used JS Heap"), WebInspector.UIString("JS Heap Size: %d"), "hsl(220, 90%, 43%)");
this._countersByName["documents"] = this.createCounter(WebInspector.UIString("Documents"), WebInspector.UIString("Documents: %d"), "hsl(0, 90%, 43%)");
this._countersByName["nodes"] = this.createCounter(WebInspector.UIString("Nodes"), WebInspector.UIString("Nodes: %d"), "hsl(120, 90%, 43%)");
this._countersByName["jsEventListeners"] = this.createCounter(WebInspector.UIString("Listeners"), WebInspector.UIString("Listeners: %d"), "hsl(38, 90%, 43%)");
- if (WebInspector.experimentsSettings.gpuTimeline.isEnabled()) {
+ if (Runtime.experiments.isEnabled("gpuTimeline")) {
this._gpuMemoryCounter = this.createCounter(WebInspector.UIString("GPU Memory"), WebInspector.UIString("GPU Memory [KB]: %d"), "hsl(300, 90%, 43%)");
this._countersByName["gpuMemoryUsedKB"] = this._gpuMemoryCounter;
}
*/
function addStatistics(record)
{
- if (record.type() !== WebInspector.TimelineModel.RecordType.UpdateCounters)
+ var counters = this._uiUtils.countersForRecord(record);
+ if (!counters)
return;
- var counters = record.data();
for (var name in counters) {
var counter = this._countersByName[name];
if (counter)