| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 }, | 71 }, |
| 72 | 72 |
| 73 dispose: function() | 73 dispose: function() |
| 74 { | 74 { |
| 75 this._reset(); | 75 this._reset(); |
| 76 }, | 76 }, |
| 77 | 77 |
| 78 _reset: function() | 78 _reset: function() |
| 79 { | 79 { |
| 80 for (var connection of this._connections.values()) | 80 for (var connection of this._connections.values()) |
| 81 connection._close(); | 81 connection.close(); |
| 82 this._connections.clear(); | 82 this._connections.clear(); |
| 83 this._targetsByWorkerId.clear(); | 83 this._targetsByWorkerId.clear(); |
| 84 }, | 84 }, |
| 85 | 85 |
| 86 _onSuspendStateChanged: function() | 86 _onSuspendStateChanged: function() |
| 87 { | 87 { |
| 88 var suspended = WebInspector.targetManager.allTargetsSuspended(); | 88 var suspended = WebInspector.targetManager.allTargetsSuspended(); |
| 89 this.target().workerAgent().setWaitForDebuggerOnStart(!suspended); | 89 this.target().workerAgent().setWaitForDebuggerOnStart(!suspended); |
| 90 }, | 90 }, |
| 91 | 91 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 112 target.runtimeAgent().runIfWaitingForDebugger(); | 112 target.runtimeAgent().runIfWaitingForDebugger(); |
| 113 }, | 113 }, |
| 114 | 114 |
| 115 /** | 115 /** |
| 116 * @param {string} workerId | 116 * @param {string} workerId |
| 117 */ | 117 */ |
| 118 _workerTerminated: function(workerId) | 118 _workerTerminated: function(workerId) |
| 119 { | 119 { |
| 120 var connection = this._connections.get(workerId); | 120 var connection = this._connections.get(workerId); |
| 121 if (connection) | 121 if (connection) |
| 122 connection._close(); | 122 connection._reportClosed(); |
| 123 this._connections.delete(workerId); | 123 this._connections.delete(workerId); |
| 124 this._targetsByWorkerId.delete(workerId); | 124 this._targetsByWorkerId.delete(workerId); |
| 125 }, | 125 }, |
| 126 | 126 |
| 127 /** | 127 /** |
| 128 * @param {string} workerId | 128 * @param {string} workerId |
| 129 * @param {string} message | 129 * @param {string} message |
| 130 */ | 130 */ |
| 131 _dispatchMessageFromWorker: function(workerId, message) | 131 _dispatchMessageFromWorker: function(workerId, message) |
| 132 { | 132 { |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 WebInspector.WorkerConnection.prototype = { | 216 WebInspector.WorkerConnection.prototype = { |
| 217 /** | 217 /** |
| 218 * @override | 218 * @override |
| 219 * @param {!Object} messageObject | 219 * @param {!Object} messageObject |
| 220 */ | 220 */ |
| 221 sendMessage: function(messageObject) | 221 sendMessage: function(messageObject) |
| 222 { | 222 { |
| 223 this._agent.sendMessageToWorker(this._workerId, JSON.stringify(messageOb
ject)); | 223 this._agent.sendMessageToWorker(this._workerId, JSON.stringify(messageOb
ject)); |
| 224 }, | 224 }, |
| 225 | 225 |
| 226 _close: function() | 226 _reportClosed: function() |
| 227 { | 227 { |
| 228 this.connectionClosed("worker_terminated"); | 228 this.connectionClosed("worker_terminated"); |
| 229 }, | 229 }, |
| 230 | 230 |
| 231 __proto__: InspectorBackendClass.Connection.prototype | 231 __proto__: InspectorBackendClass.Connection.prototype |
| 232 } | 232 } |
| OLD | NEW |