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

Unified Diff: third_party/WebKit/Source/devtools/front_end/profiler/HeapProfileView.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/profiler/HeapProfileView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/HeapProfileView.js b/third_party/WebKit/Source/devtools/front_end/profiler/HeapProfileView.js
index 2824c69f0387046d0d90204041c0b47bab81e248..c6da1dd1e9d3da25b8939a60ecbd2b19ef0b75c4 100644
--- a/third_party/WebKit/Source/devtools/front_end/profiler/HeapProfileView.js
+++ b/third_party/WebKit/Source/devtools/front_end/profiler/HeapProfileView.js
@@ -10,6 +10,7 @@
*/
WebInspector.HeapProfileView = function(profileHeader)
{
+ WebInspector.ProfileView.call(this);
this._profileHeader = profileHeader;
this.profile = new WebInspector.SamplingHeapProfileModel(profileHeader._profile || profileHeader.protocolProfile());
this.adjustedTotal = this.profile.total;
@@ -18,7 +19,7 @@ WebInspector.HeapProfileView = function(profileHeader)
WebInspector.ProfileView.ViewTypes.Heavy,
WebInspector.ProfileView.ViewTypes.Tree
];
- WebInspector.ProfileView.call(this, new WebInspector.HeapProfileView.NodeFormatter(this), views);
+ this.initialize(new WebInspector.HeapProfileView.NodeFormatter(this), views);
};
WebInspector.HeapProfileView.prototype = {
@@ -244,15 +245,14 @@ WebInspector.SamplingHeapProfileNode.prototype = {
*/
WebInspector.SamplingHeapProfileModel = function(profile)
{
- WebInspector.ProfileTreeModel.call(this, this._translateProfileTree(profile.head));
-};
+ WebInspector.ProfileTreeModel.call(this);
+ this.initialize(translateProfileTree(profile.head));
-WebInspector.SamplingHeapProfileModel.prototype = {
/**
* @param {!HeapProfilerAgent.SamplingHeapProfileNode} root
* @return {!WebInspector.SamplingHeapProfileNode}
*/
- _translateProfileTree: function(root)
+ function translateProfileTree(root)
{
var resultRoot = new WebInspector.SamplingHeapProfileNode(root);
var targetNodeStack = [resultRoot];
@@ -265,7 +265,10 @@ WebInspector.SamplingHeapProfileModel.prototype = {
targetNodeStack.push.apply(targetNodeStack, parentNode.children);
}
return resultRoot;
- },
+ }
+};
+
+WebInspector.SamplingHeapProfileModel.prototype = {
__proto__: WebInspector.ProfileTreeModel.prototype
};

Powered by Google App Engine
This is Rietveld 408576698