OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The Chromium Authors. All rights reserved. | 2 * Copyright 2014 The Chromium Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 /** | 7 /** |
8 * @constructor | 8 * @constructor |
9 * @extends {Protocol.Agents} | 9 * @extends {Protocol.Agents} |
10 * @param {!WebInspector.TargetManager} targetManager | 10 * @param {!WebInspector.TargetManager} targetManager |
(...skipping 27 matching lines...) Expand all Loading... |
38 JS: 4, | 38 JS: 4, |
39 Log: 8, | 39 Log: 8, |
40 Network: 16, | 40 Network: 16, |
41 Worker: 32 | 41 Worker: 32 |
42 }; | 42 }; |
43 | 43 |
44 WebInspector.Target._nextId = 1; | 44 WebInspector.Target._nextId = 1; |
45 | 45 |
46 WebInspector.Target.prototype = { | 46 WebInspector.Target.prototype = { |
47 /** | 47 /** |
| 48 * @return {boolean} |
| 49 */ |
| 50 isNodeJS: function() |
| 51 { |
| 52 // TODO(lushnikov): this is an unreliable way to detect Node.js targets. |
| 53 return this._capabilitiesMask === WebInspector.Target.Capability.JS || t
his._isNodeJSForTest; |
| 54 }, |
| 55 |
| 56 setIsNodeJSForTest: function() |
| 57 { |
| 58 this._isNodeJSForTest = true; |
| 59 }, |
| 60 |
| 61 /** |
48 * @return {number} | 62 * @return {number} |
49 */ | 63 */ |
50 id: function() | 64 id: function() |
51 { | 65 { |
52 return this._id; | 66 return this._id; |
53 }, | 67 }, |
54 | 68 |
55 /** | 69 /** |
56 * @return {string} | 70 * @return {string} |
57 */ | 71 */ |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 { | 301 { |
288 var target = /** @type {!WebInspector.Target} */ (event.data); | 302 var target = /** @type {!WebInspector.Target} */ (event.data); |
289 if (target !== this._target) | 303 if (target !== this._target) |
290 return; | 304 return; |
291 this.dispose(); | 305 this.dispose(); |
292 WebInspector.targetManager.removeEventListener(WebInspector.TargetManage
r.Events.TargetDisposed, this._targetDisposed, this); | 306 WebInspector.targetManager.removeEventListener(WebInspector.TargetManage
r.Events.TargetDisposed, this._targetDisposed, this); |
293 }, | 307 }, |
294 | 308 |
295 __proto__: WebInspector.SDKObject.prototype | 309 __proto__: WebInspector.SDKObject.prototype |
296 } | 310 } |
OLD | NEW |