Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(935)

Unified Diff: Source/devtools/front_end/timeline/TimelineMemoryOverview.js

Issue 344443007: Encapsulate implementation-specific timeline record handling in TimelineUIUtils (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/timeline/TimelineMemoryOverview.js
diff --git a/Source/devtools/front_end/timeline/TimelineMemoryOverview.js b/Source/devtools/front_end/timeline/TimelineMemoryOverview.js
index 17f2fc0d6c898a6735abe10ab1b1690c58a05e14..f0c1a91f76a7411b0f041e8ad4da8e732669c4b8 100644
--- a/Source/devtools/front_end/timeline/TimelineMemoryOverview.js
+++ b/Source/devtools/front_end/timeline/TimelineMemoryOverview.js
@@ -32,10 +32,12 @@
* @constructor
* @extends {WebInspector.TimelineOverviewBase}
* @param {!WebInspector.TimelineModel} model
+ * @param {!WebInspector.TimelineUIUtils} uiUtils
*/
-WebInspector.TimelineMemoryOverview = function(model)
+WebInspector.TimelineMemoryOverview = function(model, uiUtils)
{
WebInspector.TimelineOverviewBase.call(this, model);
+ this._uiUtils = uiUtils;
this.element.id = "timeline-overview-memory";
this._heapSizeLabel = this.element.createChild("div", "memory-graph-label");
@@ -63,12 +65,13 @@ WebInspector.TimelineMemoryOverview.prototype = {
var minUsedHeapSize = 100000000000;
var minTime = this._model.minimumRecordTime();
var maxTime = this._model.maximumRecordTime();
+ var uiUtils = this._uiUtils;
/**
* @param {!WebInspector.TimelineModel.Record} record
*/
function calculateMinMaxSizes(record)
{
- var counters = record.counters();
+ var counters = uiUtils.countersForRecord(record);
if (!counters || !counters.jsHeapSizeUsed)
return;
maxUsedHeapSize = Math.max(maxUsedHeapSize, counters.jsHeapSizeUsed);
@@ -90,7 +93,7 @@ WebInspector.TimelineMemoryOverview.prototype = {
*/
function buildHistogram(record)
{
- var counters = record.counters();
+ var counters = uiUtils.countersForRecord(record);
if (!counters || !counters.jsHeapSizeUsed)
return;
var x = Math.round((record.endTime() - minTime) * xFactor);
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineEventOverview.js ('k') | Source/devtools/front_end/timeline/TimelineModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698