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

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

Issue 2137773002: [DevTools] Replace the target type with capabilities (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing the code review comments Created 4 years, 5 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 (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 * @param {string} url 94 * @param {string} url
95 * @param {boolean} waitingForDebugger 95 * @param {boolean} waitingForDebugger
96 */ 96 */
97 _workerCreated: function(workerId, url, waitingForDebugger) 97 _workerCreated: function(workerId, url, waitingForDebugger)
98 { 98 {
99 var connection = new WebInspector.WorkerConnection(this, workerId); 99 var connection = new WebInspector.WorkerConnection(this, workerId);
100 this._connections.set(workerId, connection); 100 this._connections.set(workerId, connection);
101 101
102 var parsedURL = url.asParsedURL(); 102 var parsedURL = url.asParsedURL();
103 var workerName = parsedURL ? parsedURL.lastPathComponentWithFragment() : "#" + (++this._lastAnonymousTargetId); 103 var workerName = parsedURL ? parsedURL.lastPathComponentWithFragment() : "#" + (++this._lastAnonymousTargetId);
104 var target = WebInspector.targetManager.createTarget(workerName, WebInsp ector.Target.Type.DedicatedWorker, connection, this.target()); 104 var target = WebInspector.targetManager.createTarget(workerName, WebInsp ector.Target.Capability.JS, connection, this.target());
105 this._targetsByWorkerId.set(workerId, target); 105 this._targetsByWorkerId.set(workerId, target);
106 106
107 // Only pause new worker if debugging SW - we are going through the 107 // Only pause new worker if debugging SW - we are going through the
108 // pause on start checkbox. 108 // pause on start checkbox.
109 var mainIsServiceWorker = WebInspector.targetManager.mainTarget().isServ iceWorker(); 109 var mainIsServiceWorker = WebInspector.targetManager.mainTarget().hasJSC apability() && !WebInspector.targetManager.mainTarget().hasBrowserCapability();
dgozman 2016/07/13 00:08:30 This should be "hasWorkerCapability && !hasBrowser
eostroukhov-old 2016/07/13 00:36:29 Done.
110 if (mainIsServiceWorker && waitingForDebugger) 110 if (mainIsServiceWorker && waitingForDebugger)
111 target.debuggerAgent().pause(); 111 target.debuggerAgent().pause();
112 target.runtimeAgent().run(); 112 target.runtimeAgent().run();
113 }, 113 },
114 114
115 /** 115 /**
116 * @param {string} workerId 116 * @param {string} workerId
117 */ 117 */
118 _workerTerminated: function(workerId) 118 _workerTerminated: function(workerId)
119 { 119 {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 this._agent.sendMessageToWorker(this._workerId, JSON.stringify(messageOb ject)); 221 this._agent.sendMessageToWorker(this._workerId, JSON.stringify(messageOb ject));
222 }, 222 },
223 223
224 _close: function() 224 _close: function()
225 { 225 {
226 this.connectionClosed("worker_terminated"); 226 this.connectionClosed("worker_terminated");
227 }, 227 },
228 228
229 __proto__: InspectorBackendClass.Connection.prototype 229 __proto__: InspectorBackendClass.Connection.prototype
230 } 230 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698