OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 chrome.runtime.onMessageExternal.addListener( | 5 chrome.runtime.onMessageExternal.addListener( |
6 function(message, sender, sendResponse) { | 6 function(message, sender, sendResponse) { |
7 function doSendResponse(value, errorString) { | 7 function doSendResponse(value, errorString) { |
8 var error = null; | 8 var error = null; |
9 if (errorString) { | 9 if (errorString) { |
10 error = {}; | 10 error = {}; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 return true; | 165 return true; |
166 } else if (method == 'logging.startAudioDebugRecordings') { | 166 } else if (method == 'logging.startAudioDebugRecordings') { |
167 var seconds = message['seconds'] || 0; | 167 var seconds = message['seconds'] || 0; |
168 chrome.webrtcLoggingPrivate.startAudioDebugRecordings( | 168 chrome.webrtcLoggingPrivate.startAudioDebugRecordings( |
169 requestInfo, origin, seconds, doSendResponse); | 169 requestInfo, origin, seconds, doSendResponse); |
170 return true; | 170 return true; |
171 } else if (method == 'logging.stopAudioDebugRecordings') { | 171 } else if (method == 'logging.stopAudioDebugRecordings') { |
172 chrome.webrtcLoggingPrivate.stopAudioDebugRecordings( | 172 chrome.webrtcLoggingPrivate.stopAudioDebugRecordings( |
173 requestInfo, origin, doSendResponse); | 173 requestInfo, origin, doSendResponse); |
174 return true; | 174 return true; |
| 175 } else if (method == 'logging.startWebRtcEventLogging') { |
| 176 var seconds = message['seconds'] || 0; |
| 177 chrome.webrtcLoggingPrivate.startWebRtcEventLogging( |
| 178 requestInfo, origin, seconds, doSendResponse); |
| 179 return true; |
| 180 } else if (method == 'logging.stopWebRtcEventLogging') { |
| 181 chrome.webrtcLoggingPrivate.stopWebRtcEventLogging( |
| 182 requestInfo, origin, doSendResponse); |
| 183 return true; |
175 } | 184 } |
| 185 |
176 throw new Error('Unknown method: ' + method); | 186 throw new Error('Unknown method: ' + method); |
177 } catch (e) { | 187 } catch (e) { |
178 doSendResponse(null, e.name + ': ' + e.message); | 188 doSendResponse(null, e.name + ': ' + e.message); |
179 } | 189 } |
180 } | 190 } |
181 ); | 191 ); |
182 | 192 |
183 // If Hangouts connects with a port named 'onSinksChangedListener', we | 193 // If Hangouts connects with a port named 'onSinksChangedListener', we |
184 // will register a listener and send it a message {'eventName': | 194 // will register a listener and send it a message {'eventName': |
185 // 'onSinksChanged'} whenever the event fires. | 195 // 'onSinksChanged'} whenever the event fires. |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 onSinksChangedPort(port); | 305 onSinksChangedPort(port); |
296 } else if (port.name == 'chooseDesktopMedia') { | 306 } else if (port.name == 'chooseDesktopMedia') { |
297 onChooseDesktopMediaPort(port); | 307 onChooseDesktopMediaPort(port); |
298 } else if (port.name == 'processCpu') { | 308 } else if (port.name == 'processCpu') { |
299 onProcessCpu(port); | 309 onProcessCpu(port); |
300 } else { | 310 } else { |
301 // Unknown port type. | 311 // Unknown port type. |
302 port.disconnect(); | 312 port.disconnect(); |
303 } | 313 } |
304 }); | 314 }); |
OLD | NEW |