| 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 20 matching lines...) Expand all Loading... |
| 31 { | 31 { |
| 32 var data = /** @type {{workerId: number, url: string, inspectorConnected
: boolean}} */ (event.data); | 32 var data = /** @type {{workerId: number, url: string, inspectorConnected
: boolean}} */ (event.data); |
| 33 new WebInspector.WorkerConnection(this._mainTarget, data.workerId, data.
inspectorConnected, onConnectionReady.bind(this)); | 33 new WebInspector.WorkerConnection(this._mainTarget, data.workerId, data.
inspectorConnected, onConnectionReady.bind(this)); |
| 34 | 34 |
| 35 /** | 35 /** |
| 36 * @this {WebInspector.WorkerTargetManager} | 36 * @this {WebInspector.WorkerTargetManager} |
| 37 * @param {!InspectorBackendClass.Connection} connection | 37 * @param {!InspectorBackendClass.Connection} connection |
| 38 */ | 38 */ |
| 39 function onConnectionReady(connection) | 39 function onConnectionReady(connection) |
| 40 { | 40 { |
| 41 this._targetManager.createTarget(data.url, connection, targetCreated
) | 41 this._targetManager.createTarget(WebInspector.UIString("Worker %s",
data.url.asParsedURL().lastPathComponent), connection, targetCreated) |
| 42 } | 42 } |
| 43 | 43 |
| 44 /** | 44 /** |
| 45 * @param {!WebInspector.Target} target | 45 * @param {!WebInspector.Target} target |
| 46 */ | 46 */ |
| 47 function targetCreated(target) | 47 function targetCreated(target) |
| 48 { | 48 { |
| 49 if (data.inspectorConnected) | 49 if (data.inspectorConnected) |
| 50 target.runtimeAgent().run(); | 50 target.runtimeAgent().run(); |
| 51 } | 51 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 _close: function() | 110 _close: function() |
| 111 { | 111 { |
| 112 this._target.workerManager.removeEventListener(WebInspector.WorkerManage
r.Events.MessageFromWorker, this._dispatchMessageFromWorker, this); | 112 this._target.workerManager.removeEventListener(WebInspector.WorkerManage
r.Events.MessageFromWorker, this._dispatchMessageFromWorker, this); |
| 113 this._target.workerManager.removeEventListener(WebInspector.WorkerManage
r.Events.WorkerRemoved, this._onWorkerRemoved, this); | 113 this._target.workerManager.removeEventListener(WebInspector.WorkerManage
r.Events.WorkerRemoved, this._onWorkerRemoved, this); |
| 114 this._target.workerManager.removeEventListener(WebInspector.WorkerManage
r.Events.WorkersCleared, this._close, this); | 114 this._target.workerManager.removeEventListener(WebInspector.WorkerManage
r.Events.WorkersCleared, this._close, this); |
| 115 this.connectionClosed("worker_terminated"); | 115 this.connectionClosed("worker_terminated"); |
| 116 }, | 116 }, |
| 117 | 117 |
| 118 __proto__: InspectorBackendClass.Connection.prototype | 118 __proto__: InspectorBackendClass.Connection.prototype |
| 119 } | 119 } |
| OLD | NEW |