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

Unified Diff: Source/devtools/front_end/sdk/Target.js

Issue 389563002: DevTools: make paint profiler target-aware (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed a test and a stray line 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/sdk/Target.js
diff --git a/Source/devtools/front_end/sdk/Target.js b/Source/devtools/front_end/sdk/Target.js
index dc5ffba3f2747094417a59087b0c09755a1e0736..ccdf45d0c0f6260c2599b053b944413268068742 100644
--- a/Source/devtools/front_end/sdk/Target.js
+++ b/Source/devtools/front_end/sdk/Target.js
@@ -14,6 +14,8 @@
WebInspector.Target = function(name, connection, callback)
{
Protocol.Agents.call(this, connection.agentsMap());
+ /** @type {!WeakReference.<!WebInspector.Target>} */
+ this._weakReference = new WeakReference(this);
this._name = name;
this._connection = connection;
/** @type {boolean} */
@@ -58,6 +60,14 @@ WebInspector.Target.prototype = {
},
/**
+ * @return {!WeakReference.<!WebInspector.Target>}
+ */
+ weakReference: function()
+ {
+ return this._weakReference;
+ },
+
+ /**
* @param {string} name
* @param {function()|null} callback
* @param {?Protocol.Error} error
@@ -182,6 +192,7 @@ WebInspector.Target.prototype = {
dispose: function()
{
+ this._weakReference.clear();
this.debuggerModel.dispose();
this.networkManager.dispose();
this.cpuProfilerModel.dispose();
« no previous file with comments | « Source/devtools/front_end/sdk/PaintProfiler.js ('k') | Source/devtools/front_end/timeline/TimelineFrameModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698