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 28 matching lines...) Expand all Loading... | |
39 * @param {!InspectorBackendClass.Connection} connection | 39 * @param {!InspectorBackendClass.Connection} connection |
40 */ | 40 */ |
41 function onConnectionReady(connection) | 41 function onConnectionReady(connection) |
42 { | 42 { |
43 var parsedURL = data.url.asParsedURL(); | 43 var parsedURL = data.url.asParsedURL(); |
44 var workerId = parsedURL ? parsedURL.lastPathComponent : "#" + (++th is._lastAnonymousTargetId); | 44 var workerId = parsedURL ? parsedURL.lastPathComponent : "#" + (++th is._lastAnonymousTargetId); |
45 this._targetManager.createTarget(WebInspector.UIString("Worker %s", workerId), connection, targetCreated); | 45 this._targetManager.createTarget(WebInspector.UIString("Worker %s", workerId), connection, targetCreated); |
46 } | 46 } |
47 | 47 |
48 /** | 48 /** |
49 * @param {!WebInspector.Target} target | 49 * @param {?WebInspector.Target} target |
50 */ | 50 */ |
51 function targetCreated(target) | 51 function targetCreated(target) |
52 { | 52 { |
53 if (data.inspectorConnected) | 53 if (target && data.inspectorConnected) |
vsevik
2014/08/18 13:46:55
Would you mind renaming inspectorConnected to some
sergeyv
2014/08/18 13:49:15
I need to rename it in protocol and backend too, s
| |
54 target.runtimeAgent().run(); | 54 target.runtimeAgent().run(); |
55 } | 55 } |
56 }, | 56 }, |
57 | 57 |
58 _onWorkersCleared: function() | 58 _onWorkersCleared: function() |
59 { | 59 { |
60 this._lastAnonymousTargetId = 0; | 60 this._lastAnonymousTargetId = 0; |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
119 _close: function() | 119 _close: function() |
120 { | 120 { |
121 this._target.workerManager.removeEventListener(WebInspector.WorkerManage r.Events.MessageFromWorker, this._dispatchMessageFromWorker, this); | 121 this._target.workerManager.removeEventListener(WebInspector.WorkerManage r.Events.MessageFromWorker, this._dispatchMessageFromWorker, this); |
122 this._target.workerManager.removeEventListener(WebInspector.WorkerManage r.Events.WorkerRemoved, this._onWorkerRemoved, this); | 122 this._target.workerManager.removeEventListener(WebInspector.WorkerManage r.Events.WorkerRemoved, this._onWorkerRemoved, this); |
123 this._target.workerManager.removeEventListener(WebInspector.WorkerManage r.Events.WorkersCleared, this._close, this); | 123 this._target.workerManager.removeEventListener(WebInspector.WorkerManage r.Events.WorkersCleared, this._close, this); |
124 this.connectionClosed("worker_terminated"); | 124 this.connectionClosed("worker_terminated"); |
125 }, | 125 }, |
126 | 126 |
127 __proto__: InspectorBackendClass.Connection.prototype | 127 __proto__: InspectorBackendClass.Connection.prototype |
128 } | 128 } |
OLD | NEW |