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

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

Issue 121223003: DevTools: Move usedHeapSize from TimelineEvent into counters. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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/TimelineMemoryOverview.js
diff --git a/Source/devtools/front_end/TimelineMemoryOverview.js b/Source/devtools/front_end/TimelineMemoryOverview.js
index 2b3fb188673eb9ab0dddd8240e6ec34814bf90a4..3104e2a4aefeb14f928a3a49fbb26652ef52aee9 100644
--- a/Source/devtools/front_end/TimelineMemoryOverview.js
+++ b/Source/devtools/front_end/TimelineMemoryOverview.js
@@ -57,8 +57,10 @@ WebInspector.TimelineMemoryOverview.prototype = {
var minTime = this._model.minimumRecordTime();
var maxTime = this._model.maximumRecordTime();
WebInspector.TimelinePresentationModel.forAllRecords(records, function(r) {
- maxUsedHeapSize = Math.max(maxUsedHeapSize, r.usedHeapSize || maxUsedHeapSize);
- minUsedHeapSize = Math.min(minUsedHeapSize, r.usedHeapSize || minUsedHeapSize);
+ if (!r.counters || !r.counters.jsHeapSizeUsed)
+ return;
+ maxUsedHeapSize = Math.max(maxUsedHeapSize, r.counters.jsHeapSizeUsed);
+ minUsedHeapSize = Math.min(minUsedHeapSize, r.counters.jsHeapSizeUsed);
});
minUsedHeapSize = Math.min(minUsedHeapSize, maxUsedHeapSize);
@@ -69,10 +71,10 @@ WebInspector.TimelineMemoryOverview.prototype = {
var histogram = new Array(width);
WebInspector.TimelinePresentationModel.forAllRecords(records, function(r) {
- if (!r.usedHeapSize)
+ if (!r.counters || !r.counters.jsHeapSizeUsed)
return;
var x = Math.round((WebInspector.TimelineModel.endTimeInSeconds(r) - minTime) * xFactor);
- var y = (r.usedHeapSize - minUsedHeapSize) * yFactor;
+ var y = (r.counters.jsHeapSizeUsed - minUsedHeapSize) * yFactor;
histogram[x] = Math.max(histogram[x] || 0, y);
});
« no previous file with comments | « Source/core/inspector/InspectorTimelineAgent.cpp ('k') | Source/devtools/front_end/TimelinePresentationModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698