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

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

Issue 2453673002: [DevTools] Scope common protocol infrastructure under Protocol namespace in a separate module. (Closed)
Patch Set: 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {WebInspector.SDKModel} 7 * @extends {WebInspector.SDKModel}
8 * @param {!WebInspector.Target} target 8 * @param {!WebInspector.Target} target
9 */ 9 */
10 WebInspector.SubTargetsManager = function(target) 10 WebInspector.SubTargetsManager = function(target)
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 var mainIsServiceWorker = !this.target().parentTarget() && this.target() .hasWorkerCapability() && !this.target().hasBrowserCapability(); 166 var mainIsServiceWorker = !this.target().parentTarget() && this.target() .hasWorkerCapability() && !this.target().hasBrowserCapability();
167 if (mainIsServiceWorker && waitingForDebugger) 167 if (mainIsServiceWorker && waitingForDebugger)
168 target.debuggerAgent().pause(); 168 target.debuggerAgent().pause();
169 target.runtimeAgent().runIfWaitingForDebugger(); 169 target.runtimeAgent().runIfWaitingForDebugger();
170 170
171 this.dispatchEventToListeners(WebInspector.SubTargetsManager.Events.SubT argetAdded, target); 171 this.dispatchEventToListeners(WebInspector.SubTargetsManager.Events.SubT argetAdded, target);
172 }, 172 },
173 173
174 /** 174 /**
175 * @param {string} targetId 175 * @param {string} targetId
176 * @param {!InspectorBackendClass.Connection.Params} params 176 * @param {!Protocol.Connection.Params} params
177 * @return {!InspectorBackendClass.Connection} 177 * @return {!Protocol.Connection}
178 */ 178 */
179 _createConnection: function(targetId, params) 179 _createConnection: function(targetId, params)
180 { 180 {
181 var connection = new WebInspector.SubTargetConnection(this._agent, targe tId, params); 181 var connection = new WebInspector.SubTargetConnection(this._agent, targe tId, params);
182 this._connections.set(targetId, connection); 182 this._connections.set(targetId, connection);
183 return connection; 183 return connection;
184 }, 184 },
185 185
186 /** 186 /**
187 * @param {string} targetId 187 * @param {string} targetId
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 * @param {string} message 283 * @param {string} message
284 */ 284 */
285 receivedMessageFromTarget: function(targetId, message) 285 receivedMessageFromTarget: function(targetId, message)
286 { 286 {
287 this._manager._receivedMessageFromTarget(targetId, message); 287 this._manager._receivedMessageFromTarget(targetId, message);
288 } 288 }
289 }; 289 };
290 290
291 /** 291 /**
292 * @constructor 292 * @constructor
293 * @implements {InspectorBackendClass.Connection} 293 * @implements {Protocol.Connection}
294 * @param {!Protocol.TargetAgent} agent 294 * @param {!Protocol.TargetAgent} agent
295 * @param {string} targetId 295 * @param {string} targetId
296 * @param {!InspectorBackendClass.Connection.Params} params 296 * @param {!Protocol.Connection.Params} params
297 */ 297 */
298 WebInspector.SubTargetConnection = function(agent, targetId, params) 298 WebInspector.SubTargetConnection = function(agent, targetId, params)
299 { 299 {
300 this._agent = agent; 300 this._agent = agent;
301 this._targetId = targetId; 301 this._targetId = targetId;
302 this._onMessage = params.onMessage; 302 this._onMessage = params.onMessage;
303 this._onDisconnect = params.onDisconnect; 303 this._onDisconnect = params.onDisconnect;
304 }; 304 };
305 305
306 WebInspector.SubTargetConnection.prototype = { 306 WebInspector.SubTargetConnection.prototype = {
(...skipping 26 matching lines...) Expand all
333 this.url = payload.url; 333 this.url = payload.url;
334 this.type = payload.type; 334 this.type = payload.type;
335 if (this.type !== "page" && this.type !== "iframe") { 335 if (this.type !== "page" && this.type !== "iframe") {
336 this.title = WebInspector.UIString("Worker: %s", this.url); 336 this.title = WebInspector.UIString("Worker: %s", this.url);
337 this.canActivate = false; 337 this.canActivate = false;
338 } else { 338 } else {
339 this.title = payload.title; 339 this.title = payload.title;
340 this.canActivate = true; 340 this.canActivate = true;
341 } 341 }
342 }; 342 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698