OLD | NEW |
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 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 /** | 31 /** |
32 * @constructor | 32 * @constructor |
33 * @extends {WebInspector.Object} | 33 * @extends {WebInspector.Object} |
| 34 * @param {!WebInspector.Target} target |
34 * @param {boolean} isMainFrontend | 35 * @param {boolean} isMainFrontend |
35 */ | 36 */ |
36 WebInspector.WorkerManager = function(target, isMainFrontend) | 37 WebInspector.WorkerManager = function(target, isMainFrontend) |
37 { | 38 { |
38 this._reset(); | 39 this._reset(); |
39 target.registerWorkerDispatcher(new WebInspector.WorkerDispatcher(this)); | 40 target.registerWorkerDispatcher(new WebInspector.WorkerDispatcher(this)); |
40 if (isMainFrontend) { | 41 if (isMainFrontend) { |
41 WorkerAgent.enable(); | 42 WorkerAgent.enable(); |
42 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTre
eModel.EventTypes.MainFrameNavigated, this._mainFrameNavigated, this); | 43 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTre
eModel.EventTypes.MainFrameNavigated, this._mainFrameNavigated, this); |
43 } | 44 } |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 166 |
166 /** | 167 /** |
167 * @type {!WebInspector.WorkerManager} | 168 * @type {!WebInspector.WorkerManager} |
168 */ | 169 */ |
169 WebInspector.workerManager; | 170 WebInspector.workerManager; |
170 | 171 |
171 /** | 172 /** |
172 * @constructor | 173 * @constructor |
173 * @extends {InspectorBackendClass.Connection} | 174 * @extends {InspectorBackendClass.Connection} |
174 * @param {string} workerId | 175 * @param {string} workerId |
| 176 * @param {function(!InspectorBackendClass.Connection)} onConnectionReady |
175 */ | 177 */ |
176 WebInspector.ExternalWorkerConnection = function(workerId, onConnectionReady) | 178 WebInspector.ExternalWorkerConnection = function(workerId, onConnectionReady) |
177 { | 179 { |
178 InspectorBackendClass.Connection.call(this); | 180 InspectorBackendClass.Connection.call(this); |
179 this._workerId = workerId; | 181 this._workerId = workerId; |
180 window.addEventListener("message", this._processMessage.bind(this), true); | 182 window.addEventListener("message", this._processMessage.bind(this), true); |
181 onConnectionReady(this); | 183 onConnectionReady(this); |
182 } | 184 } |
183 | 185 |
184 WebInspector.ExternalWorkerConnection.prototype = { | 186 WebInspector.ExternalWorkerConnection.prototype = { |
(...skipping 13 matching lines...) Expand all Loading... |
198 /** | 200 /** |
199 * @param {!Object} messageObject | 201 * @param {!Object} messageObject |
200 */ | 202 */ |
201 sendMessage: function(messageObject) | 203 sendMessage: function(messageObject) |
202 { | 204 { |
203 window.opener.postMessage({workerId: this._workerId, command: "sendMessa
geToBackend", message: messageObject}, "*"); | 205 window.opener.postMessage({workerId: this._workerId, command: "sendMessa
geToBackend", message: messageObject}, "*"); |
204 }, | 206 }, |
205 | 207 |
206 __proto__: InspectorBackendClass.Connection.prototype | 208 __proto__: InspectorBackendClass.Connection.prototype |
207 } | 209 } |
OLD | NEW |