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

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

Issue 2345873002: [Devtools] Add capability for the log domain (Closed)
Patch Set: Created 4 years, 3 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 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.Agents} 9 * @extends {Protocol.Agents}
10 * @param {!WebInspector.TargetManager} targetManager 10 * @param {!WebInspector.TargetManager} targetManager
(...skipping 16 matching lines...) Expand all
27 27
28 /** @type {!Map.<!Function, !WebInspector.SDKModel>} */ 28 /** @type {!Map.<!Function, !WebInspector.SDKModel>} */
29 this._modelByConstructor = new Map(); 29 this._modelByConstructor = new Map();
30 } 30 }
31 31
32 /** 32 /**
33 * @enum {number} 33 * @enum {number}
34 */ 34 */
35 WebInspector.Target.Capability = { 35 WebInspector.Target.Capability = {
36 Browser: 1, 36 Browser: 1,
37 JS: 2, 37 DOM: 2,
38 Network: 4, 38 JS: 4,
39 Worker: 8, 39 Log: 8,
40 DOM: 16 40 Network: 16,
41 } 41 Worker: 32
42 };
43
44 WebInspector.Target.PAGE_CAPABILITIES =
dgozman 2016/09/16 01:39:35 We don't use SHOUTY_CASE.
eostroukhov 2016/09/16 20:42:44 Removed the constants altogether.
45 WebInspector.Target.Capability.Browser | WebInspector.Target.Capability.DOM |
46 WebInspector.Target.Capability.JS | WebInspector.Target.Capability.Log |
47 WebInspector.Target.Capability.Network | WebInspector.Target.Capability.Work er;
48
49 WebInspector.Target.SHARED_WORKER_CAPABILITIES =
50 WebInspector.Target.Capability.Browser | WebInspector.Target.Capability.Log |
51 WebInspector.Target.Capability.Network | WebInspector.Target.Capability.Work er;
52
53 WebInspector.Target.SERVICE_WORKER_CAPABILITIES =
dgozman 2016/09/16 01:39:35 I don't think these constants improve things. Havi
eostroukhov 2016/09/16 20:42:44 Done.
54 WebInspector.Target.Capability.Log | WebInspector.Target.Capability.Network |
55 WebInspector.Target.Capability.Worker;
56
57 WebInspector.Target.WORKER_CAPABILITIES =
58 WebInspector.Target.Capability.JS | WebInspector.Target.Capability.Log;
42 59
43 WebInspector.Target._nextId = 1; 60 WebInspector.Target._nextId = 1;
44 61
45 WebInspector.Target.prototype = { 62 WebInspector.Target.prototype = {
46 /** 63 /**
47 * @return {number} 64 * @return {number}
48 */ 65 */
49 id: function() 66 id: function()
50 { 67 {
51 return this._id; 68 return this._id;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 * @return {boolean} 133 * @return {boolean}
117 */ 134 */
118 hasJSCapability: function() 135 hasJSCapability: function()
119 { 136 {
120 return this.hasAllCapabilities(WebInspector.Target.Capability.JS); 137 return this.hasAllCapabilities(WebInspector.Target.Capability.JS);
121 }, 138 },
122 139
123 /** 140 /**
124 * @return {boolean} 141 * @return {boolean}
125 */ 142 */
143 hasLogCapability: function()
144 {
145 return this.hasAllCapabilities(WebInspector.Target.Capability.Log);
146 },
147
148 /**
149 * @return {boolean}
150 */
126 hasNetworkCapability: function() 151 hasNetworkCapability: function()
127 { 152 {
128 return this.hasAllCapabilities(WebInspector.Target.Capability.Network); 153 return this.hasAllCapabilities(WebInspector.Target.Capability.Network);
129 }, 154 },
130 155
131 /** 156 /**
132 * @return {boolean} 157 * @return {boolean}
133 */ 158 */
134 hasWorkerCapability: function() 159 hasWorkerCapability: function()
135 { 160 {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 { 298 {
274 var target = /** @type {!WebInspector.Target} */ (event.data); 299 var target = /** @type {!WebInspector.Target} */ (event.data);
275 if (target !== this._target) 300 if (target !== this._target)
276 return; 301 return;
277 this.dispose(); 302 this.dispose();
278 WebInspector.targetManager.removeEventListener(WebInspector.TargetManage r.Events.TargetDisposed, this._targetDisposed, this); 303 WebInspector.targetManager.removeEventListener(WebInspector.TargetManage r.Events.TargetDisposed, this._targetDisposed, this);
279 }, 304 },
280 305
281 __proto__: WebInspector.SDKObject.prototype 306 __proto__: WebInspector.SDKObject.prototype
282 } 307 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698