| 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 * @extends {InspectorBackendClass.Connection} | 230 * @extends {InspectorBackendClass.Connection} |
| 231 * @param {!WebInspector.WorkerManager} workerManager | 231 * @param {!WebInspector.WorkerManager} workerManager |
| 232 * @param {string} workerId | 232 * @param {string} workerId |
| 233 * @param {boolean} inspectorConnected | 233 * @param {boolean} inspectorConnected |
| 234 * @param {function(!InspectorBackendClass.Connection)} onConnectionReady | 234 * @param {function(!InspectorBackendClass.Connection)} onConnectionReady |
| 235 */ | 235 */ |
| 236 WebInspector.WorkerConnection = function(workerManager, workerId, inspectorConne
cted, onConnectionReady) | 236 WebInspector.WorkerConnection = function(workerManager, workerId, inspectorConne
cted, onConnectionReady) |
| 237 { | 237 { |
| 238 InspectorBackendClass.Connection.call(this); | 238 InspectorBackendClass.Connection.call(this); |
| 239 //FIXME: remove resourceTreeModel and others from worker targets | 239 //FIXME: remove resourceTreeModel and others from worker targets |
| 240 this.suppressErrorsForDomains(["Worker", "Page", "CSS", "DOM", "DOMStorage",
"Database", "Network", "IndexedDB", "ServiceWorkerCache"]); | 240 this.suppressErrorsForDomains(["Worker", "Page", "CSS", "DOM", "DOMStorage",
"Database", "Network", "IndexedDB"]); |
| 241 this._agent = workerManager.target().workerAgent(); | 241 this._agent = workerManager.target().workerAgent(); |
| 242 this._workerId = workerId; | 242 this._workerId = workerId; |
| 243 | 243 |
| 244 | 244 |
| 245 if (!inspectorConnected) | 245 if (!inspectorConnected) |
| 246 this._agent.connectToWorker(workerId, onConnectionReady.bind(null, this)
); | 246 this._agent.connectToWorker(workerId, onConnectionReady.bind(null, this)
); |
| 247 else | 247 else |
| 248 onConnectionReady.call(null, this); | 248 onConnectionReady.call(null, this); |
| 249 } | 249 } |
| 250 | 250 |
| 251 WebInspector.WorkerConnection.prototype = { | 251 WebInspector.WorkerConnection.prototype = { |
| 252 /** | 252 /** |
| 253 * @override | 253 * @override |
| 254 * @param {!Object} messageObject | 254 * @param {!Object} messageObject |
| 255 */ | 255 */ |
| 256 sendMessage: function(messageObject) | 256 sendMessage: function(messageObject) |
| 257 { | 257 { |
| 258 this._agent.sendMessageToWorker(this._workerId, JSON.stringify(messageOb
ject)); | 258 this._agent.sendMessageToWorker(this._workerId, JSON.stringify(messageOb
ject)); |
| 259 }, | 259 }, |
| 260 | 260 |
| 261 _close: function() | 261 _close: function() |
| 262 { | 262 { |
| 263 this.connectionClosed("worker_terminated"); | 263 this.connectionClosed("worker_terminated"); |
| 264 }, | 264 }, |
| 265 | 265 |
| 266 __proto__: InspectorBackendClass.Connection.prototype | 266 __proto__: InspectorBackendClass.Connection.prototype |
| 267 } | 267 } |
| OLD | NEW |