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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/Target.js

Issue 2442083002: [DevTools] Merge Worker domain to Target, migrate clients. (Closed)
Patch Set: rebased all tests Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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.Target} 9 * @extends {Protocol.Target}
10 * @param {!WebInspector.TargetManager} targetManager 10 * @param {!WebInspector.TargetManager} targetManager
(...skipping 18 matching lines...) Expand all
29 29
30 /** 30 /**
31 * @enum {number} 31 * @enum {number}
32 */ 32 */
33 WebInspector.Target.Capability = { 33 WebInspector.Target.Capability = {
34 Browser: 1, 34 Browser: 1,
35 DOM: 2, 35 DOM: 2,
36 JS: 4, 36 JS: 4,
37 Log: 8, 37 Log: 8,
38 Network: 16, 38 Network: 16,
39 Worker: 32 39 Target: 32
40 }; 40 };
41 41
42 WebInspector.Target._nextId = 1; 42 WebInspector.Target._nextId = 1;
43 43
44 WebInspector.Target.prototype = { 44 WebInspector.Target.prototype = {
45 /** 45 /**
46 * @return {boolean} 46 * @return {boolean}
47 */ 47 */
48 isNodeJS: function() 48 isNodeJS: function()
49 { 49 {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 * @return {boolean} 126 * @return {boolean}
127 */ 127 */
128 hasNetworkCapability: function() 128 hasNetworkCapability: function()
129 { 129 {
130 return this.hasAllCapabilities(WebInspector.Target.Capability.Network); 130 return this.hasAllCapabilities(WebInspector.Target.Capability.Network);
131 }, 131 },
132 132
133 /** 133 /**
134 * @return {boolean} 134 * @return {boolean}
135 */ 135 */
136 hasWorkerCapability: function() 136 hasTargetCapability: function()
137 { 137 {
138 return this.hasAllCapabilities(WebInspector.Target.Capability.Worker); 138 return this.hasAllCapabilities(WebInspector.Target.Capability.Target);
139 }, 139 },
140 140
141 /** 141 /**
142 * @return {boolean} 142 * @return {boolean}
143 */ 143 */
144 hasDOMCapability: function() 144 hasDOMCapability: function()
145 { 145 {
146 return this.hasAllCapabilities(WebInspector.Target.Capability.DOM); 146 return this.hasAllCapabilities(WebInspector.Target.Capability.DOM);
147 }, 147 },
148 148
149 /** 149 /**
150 * @return {?WebInspector.Target} 150 * @return {?WebInspector.Target}
151 */ 151 */
152 parentTarget: function() 152 parentTarget: function()
153 { 153 {
154 return this._parentTarget; 154 return this._parentTarget;
155 }, 155 },
156 156
157 /** 157 /**
158 * @override 158 * @override
159 */ 159 */
160 dispose: function() 160 dispose: function()
161 { 161 {
162 this._targetManager.removeTarget(this); 162 this._targetManager.removeTarget(this);
163 for (var model of this._modelByConstructor.valuesArray()) 163 for (var model of this._modelByConstructor.valuesArray())
164 model.dispose(); 164 model.dispose();
165 if (this.workerManager)
166 this.workerManager.dispose();
167 }, 165 },
168 166
169 /** 167 /**
170 * @param {!Function} modelClass 168 * @param {!Function} modelClass
171 * @return {?WebInspector.SDKModel} 169 * @return {?WebInspector.SDKModel}
172 */ 170 */
173 model: function(modelClass) 171 model: function(modelClass)
174 { 172 {
175 return this._modelByConstructor.get(modelClass) || null; 173 return this._modelByConstructor.get(modelClass) || null;
176 }, 174 },
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 _targetDisposed: function(event) 267 _targetDisposed: function(event)
270 { 268 {
271 var target = /** @type {!WebInspector.Target} */ (event.data); 269 var target = /** @type {!WebInspector.Target} */ (event.data);
272 if (target !== this._target) 270 if (target !== this._target)
273 return; 271 return;
274 this.dispose(); 272 this.dispose();
275 }, 273 },
276 274
277 __proto__: WebInspector.SDKObject.prototype 275 __proto__: WebInspector.SDKObject.prototype
278 }; 276 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698