OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 /** | 6 /** |
7 * @constructor | 7 * @constructor |
8 * @param {!WebInspector.Target} mainTarget | 8 * @param {!WebInspector.Target} mainTarget |
9 * @param {!WebInspector.TargetManager} targetManager | 9 * @param {!WebInspector.TargetManager} targetManager |
10 */ | 10 */ |
(...skipping 27 matching lines...) Expand all Loading... |
38 new WebInspector.WorkerConnection(this._mainTarget, data.workerId, data.
inspectorConnected, onConnectionReady.bind(this)); | 38 new WebInspector.WorkerConnection(this._mainTarget, data.workerId, data.
inspectorConnected, onConnectionReady.bind(this)); |
39 | 39 |
40 /** | 40 /** |
41 * @this {WebInspector.WorkerTargetManager} | 41 * @this {WebInspector.WorkerTargetManager} |
42 * @param {!InspectorBackendClass.Connection} connection | 42 * @param {!InspectorBackendClass.Connection} connection |
43 */ | 43 */ |
44 function onConnectionReady(connection) | 44 function onConnectionReady(connection) |
45 { | 45 { |
46 var parsedURL = data.url.asParsedURL(); | 46 var parsedURL = data.url.asParsedURL(); |
47 var workerId = parsedURL ? parsedURL.lastPathComponent : "#" + (++th
is._lastAnonymousTargetId); | 47 var workerId = parsedURL ? parsedURL.lastPathComponent : "#" + (++th
is._lastAnonymousTargetId); |
48 this._targetManager.createTarget(WebInspector.UIString("Worker %s",
workerId), connection, targetCreated.bind(this)); | 48 this._targetManager.createTarget(WebInspector.UIString("Worker %s",
workerId), connection, targetCreated.bind(this), data.url); |
49 } | 49 } |
50 | 50 |
51 /** | 51 /** |
52 * @this {WebInspector.WorkerTargetManager} | 52 * @this {WebInspector.WorkerTargetManager} |
53 * @param {?WebInspector.Target} target | 53 * @param {?WebInspector.Target} target |
54 */ | 54 */ |
55 function targetCreated(target) | 55 function targetCreated(target) |
56 { | 56 { |
57 if (!target) | 57 if (!target) |
58 return; | 58 return; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 _close: function() | 166 _close: function() |
167 { | 167 { |
168 this._target.workerManager.removeEventListener(WebInspector.WorkerManage
r.Events.MessageFromWorker, this._dispatchMessageFromWorker, this); | 168 this._target.workerManager.removeEventListener(WebInspector.WorkerManage
r.Events.MessageFromWorker, this._dispatchMessageFromWorker, this); |
169 this._target.workerManager.removeEventListener(WebInspector.WorkerManage
r.Events.WorkerRemoved, this._onWorkerRemoved, this); | 169 this._target.workerManager.removeEventListener(WebInspector.WorkerManage
r.Events.WorkerRemoved, this._onWorkerRemoved, this); |
170 this._target.workerManager.removeEventListener(WebInspector.WorkerManage
r.Events.WorkersCleared, this._close, this); | 170 this._target.workerManager.removeEventListener(WebInspector.WorkerManage
r.Events.WorkersCleared, this._close, this); |
171 this.connectionClosed("worker_terminated"); | 171 this.connectionClosed("worker_terminated"); |
172 }, | 172 }, |
173 | 173 |
174 __proto__: InspectorBackendClass.Connection.prototype | 174 __proto__: InspectorBackendClass.Connection.prototype |
175 } | 175 } |
OLD | NEW |