Chromium Code Reviews| 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..ecd60e20ea292e30d6da68ab4314cbb720f9f129 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(); |
| @@ -190,6 +201,7 @@ WebInspector.Target.prototype = { |
| __proto__: Protocol.Agents.prototype |
| } |
| + |
|
apavlov
2014/07/11 16:24:48
stray blank line
|
| /** |
| * @constructor |
| * @extends {WebInspector.Object} |