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

Unified Diff: third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshot.js

Issue 2450663004: DevTools: do not allow using 'this' before call into super. (Closed)
Patch Set: rebaselined Created 4 years, 2 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: third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshot.js
diff --git a/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshot.js b/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshot.js
index cb5476faa25d0304dc4e6890c45c990fad0a892c..3f1cf1c710ac1ee9afeeac93e45dee5df1d0c5a0 100644
--- a/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshot.js
+++ b/third_party/WebKit/Source/devtools/front_end/heap_snapshot_worker/HeapSnapshot.js
@@ -912,29 +912,7 @@ WebInspector.HeapSnapshot = function(profile, progress)
this._aggregatesForDiff = null;
this._aggregates = {};
this._aggregatesSortedFlags = {};
-
- this._init();
-
- if (profile.snapshot.trace_function_count) {
- this._progress.updateStatus("Building allocation statistics\u2026");
- var nodes = this.nodes;
- var nodesLength = nodes.length;
- var nodeFieldCount = this._nodeFieldCount;
- var node = this.rootNode();
- var liveObjects = {};
- for (var nodeIndex = 0; nodeIndex < nodesLength; nodeIndex += nodeFieldCount) {
- node.nodeIndex = nodeIndex;
- var traceNodeId = node.traceNodeId();
- var stats = liveObjects[traceNodeId];
- if (!stats)
- liveObjects[traceNodeId] = stats = { count: 0, size: 0, ids: [] };
- stats.count++;
- stats.size += node.selfSize();
- stats.ids.push(node.id());
- }
- this._allocationProfile = new WebInspector.AllocationProfile(profile, liveObjects);
- this._progress.updateStatus("Done");
- }
+ this._profile = profile;
};
/**
@@ -967,7 +945,10 @@ function HeapSnapshotHeader()
}
WebInspector.HeapSnapshot.prototype = {
- _init: function()
+ /**
+ * @protected
+ */
+ initialize: function()
{
var meta = this._metaNode;
@@ -1037,6 +1018,27 @@ WebInspector.HeapSnapshot.prototype = {
this._progress.updateStatus("Calculating samples\u2026");
this._buildSamples();
this._progress.updateStatus("Finished processing.");
+
+ if (this._profile.snapshot.trace_function_count) {
+ this._progress.updateStatus("Building allocation statistics\u2026");
+ var nodes = this.nodes;
+ var nodesLength = nodes.length;
+ var nodeFieldCount = this._nodeFieldCount;
+ var node = this.rootNode();
+ var liveObjects = {};
+ for (var nodeIndex = 0; nodeIndex < nodesLength; nodeIndex += nodeFieldCount) {
+ node.nodeIndex = nodeIndex;
+ var traceNodeId = node.traceNodeId();
+ var stats = liveObjects[traceNodeId];
+ if (!stats)
+ liveObjects[traceNodeId] = stats = { count: 0, size: 0, ids: [] };
+ stats.count++;
+ stats.size += node.selfSize();
+ stats.ids.push(node.id());
+ }
+ this._allocationProfile = new WebInspector.AllocationProfile(this._profile, liveObjects);
+ this._progress.updateStatus("Done");
+ }
},
_buildEdgeIndexes: function()
@@ -2321,9 +2323,9 @@ WebInspector.HeapSnapshotItemProvider.prototype = {
*/
WebInspector.HeapSnapshotEdgesProvider = function(snapshot, filter, edgesIter, indexProvider)
{
- this.snapshot = snapshot;
var iter = filter ? new WebInspector.HeapSnapshotFilteredIterator(edgesIter, /** @type {function(!WebInspector.HeapSnapshotItem):boolean} */ (filter)) : edgesIter;
WebInspector.HeapSnapshotItemProvider.call(this, iter, indexProvider);
+ this.snapshot = snapshot;
};
WebInspector.HeapSnapshotEdgesProvider.prototype = {
@@ -2421,13 +2423,13 @@ WebInspector.HeapSnapshotEdgesProvider.prototype = {
*/
WebInspector.HeapSnapshotNodesProvider = function(snapshot, filter, nodeIndexes)
{
- this.snapshot = snapshot;
var indexProvider = new WebInspector.HeapSnapshotNodeIndexProvider(snapshot);
var it = new WebInspector.HeapSnapshotIndexRangeIterator(indexProvider, nodeIndexes);
if (filter)
it = new WebInspector.HeapSnapshotFilteredIterator(it, /** @type {function(!WebInspector.HeapSnapshotItem):boolean} */ (filter));
WebInspector.HeapSnapshotItemProvider.call(this, it, indexProvider);
+ this.snapshot = snapshot;
};
WebInspector.HeapSnapshotNodesProvider.prototype = {

Powered by Google App Engine
This is Rietveld 408576698