OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright (C) 2014 Google Inc. All rights reserved. | 3 * Copyright (C) 2014 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 }, | 74 }, |
75 | 75 |
76 _handleMessage: function(event) | 76 _handleMessage: function(event) |
77 { | 77 { |
78 var data = /** @type {{workerId: string, command: string, message: !Obje
ct}} */ (event.data); | 78 var data = /** @type {{workerId: string, command: string, message: !Obje
ct}} */ (event.data); |
79 var workerId = data["workerId"]; | 79 var workerId = data["workerId"]; |
80 workerId = parseInt(workerId, 10); | 80 workerId = parseInt(workerId, 10); |
81 var command = data.command; | 81 var command = data.command; |
82 var message = data.message; | 82 var message = data.message; |
83 | 83 |
84 if (command == "sendMessageToBackend") | 84 if (command == "sendMessageToWorker") |
85 WorkerAgent.sendMessageToWorker(workerId, message); | 85 WorkerAgent.sendMessageToWorker(workerId, message); |
86 }, | 86 }, |
87 | 87 |
88 _sendMessageToWorkerInspector: function(event) | 88 _sendMessageToWorkerInspector: function(event) |
89 { | 89 { |
90 var data = (event.data); | 90 var data = (event.data); |
91 | 91 |
92 var workerInspectorWindow = this._workerIdToWindow[data.workerId]; | 92 var workerInspectorWindow = this._workerIdToWindow[data.workerId]; |
93 if (workerInspectorWindow) | 93 if (workerInspectorWindow) |
94 workerInspectorWindow.postMessage(data.message, "*"); | 94 workerInspectorWindow.postMessage(data.message, "*"); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 WorkerAgent.disconnectFromWorker(parseInt(workerId, 10)); | 163 WorkerAgent.disconnectFromWorker(parseInt(workerId, 10)); |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 } | 167 } |
168 /** | 168 /** |
169 * @type {?WebInspector.WorkerFrontendManager} | 169 * @type {?WebInspector.WorkerFrontendManager} |
170 */ | 170 */ |
171 WebInspector.workerFrontendManager = null; | 171 WebInspector.workerFrontendManager = null; |
172 | 172 |
OLD | NEW |