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

Unified Diff: Source/devtools/front_end/profiler/HeapSnapshotView.js

Issue 388303002: DevTools: Get rid of WebInspector.TargetObserver (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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/profiler/HeapSnapshotView.js
diff --git a/Source/devtools/front_end/profiler/HeapSnapshotView.js b/Source/devtools/front_end/profiler/HeapSnapshotView.js
index b1bfe9b3c61938ee3180e5a6d06a9cfb7b2cdbd9..ec1392020028689c2ce09705b388b2198a8660f7 100644
--- a/Source/devtools/front_end/profiler/HeapSnapshotView.js
+++ b/Source/devtools/front_end/profiler/HeapSnapshotView.js
@@ -76,11 +76,11 @@ WebInspector.HeapSnapshotView = function(dataDisplayDelegate, profile)
if (profile._hasAllocationStacks) {
this._allocationView = new WebInspector.VBox();
this._allocationView.setMinimumSize(50, 25);
- this._allocationDataGrid = new WebInspector.AllocationDataGrid(profile.target() , dataDisplayDelegate);
+ this._allocationDataGrid = new WebInspector.AllocationDataGrid(profile.weakTarget() , dataDisplayDelegate);
this._allocationDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._onSelectAllocationNode, this);
this._allocationDataGrid.show(this._allocationView.element);
- this._allocationStackView = new WebInspector.HeapAllocationStackView(profile.target());
+ this._allocationStackView = new WebInspector.HeapAllocationStackView(profile.weakTarget());
this._allocationStackView.setMinimumSize(50, 25);
this._tabbedPane = new WebInspector.TabbedPane();
@@ -2128,12 +2128,12 @@ WebInspector.HeapSnapshotStatisticsView.prototype = {
/**
* @constructor
* @extends {WebInspector.View}
- * @param {?WebInspector.Target} target
+ * @param {!WeakReference.<!WebInspector.Target>} weakTarget
*/
-WebInspector.HeapAllocationStackView = function(target)
+WebInspector.HeapAllocationStackView = function(weakTarget)
{
WebInspector.View.call(this);
- this._targetObserver = new WebInspector.TargetObserver(target);
+ this._weakTarget = weakTarget;;
this._linkifier = new WebInspector.Linkifier();
}
@@ -2172,7 +2172,7 @@ WebInspector.HeapAllocationStackView.prototype = {
var name = frameDiv.createChild("div");
name.textContent = frame.functionName;
if (frame.scriptId) {
- var urlElement = this._linkifier.linkifyLocationByScriptId(this._targetObserver.target(), String(frame.scriptId), frame.scriptName, frame.line - 1, frame.column - 1);
+ var urlElement = this._linkifier.linkifyLocationByScriptId(this._weakTarget.get(), String(frame.scriptId), frame.scriptName, frame.line - 1, frame.column - 1);
frameDiv.appendChild(urlElement);
}
}
« no previous file with comments | « Source/devtools/front_end/profiler/HeapSnapshotDataGrids.js ('k') | Source/devtools/front_end/profiler/ProfilesPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698