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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 var outgoing = message['outgoing'] || false; | 160 var outgoing = message['outgoing'] || false; |
161 chrome.webrtcLoggingPrivate.startRtpDump( | 161 chrome.webrtcLoggingPrivate.startRtpDump( |
162 requestInfo, origin, incoming, outgoing, doSendResponse); | 162 requestInfo, origin, incoming, outgoing, doSendResponse); |
163 return true; | 163 return true; |
164 } else if (method == 'logging.stopRtpDump') { | 164 } else if (method == 'logging.stopRtpDump') { |
165 var incoming = message['incoming'] || false; | 165 var incoming = message['incoming'] || false; |
166 var outgoing = message['outgoing'] || false; | 166 var outgoing = message['outgoing'] || false; |
167 chrome.webrtcLoggingPrivate.stopRtpDump( | 167 chrome.webrtcLoggingPrivate.stopRtpDump( |
168 requestInfo, origin, incoming, outgoing, doSendResponse); | 168 requestInfo, origin, incoming, outgoing, doSendResponse); |
169 return true; | 169 return true; |
| 170 } else if (method == 'logging.startAecDump') { |
| 171 var seconds = message['seconds'] || 0; |
| 172 chrome.webrtcLoggingPrivate.startAecDump( |
| 173 seconds, doSendResponse); |
| 174 return true; |
| 175 } else if (method == 'logging.stopAecDump') { |
| 176 chrome.webrtcLoggingPrivate.stopRtpDump(doSendResponse); |
| 177 return true; |
170 } | 178 } |
171 throw new Error('Unknown method: ' + method); | 179 throw new Error('Unknown method: ' + method); |
172 } catch (e) { | 180 } catch (e) { |
173 doSendResponse(null, e.name + ': ' + e.message); | 181 doSendResponse(null, e.name + ': ' + e.message); |
174 } | 182 } |
175 } | 183 } |
176 ); | 184 ); |
177 | 185 |
178 // If Hangouts connects with a port named 'onSinksChangedListener', we | 186 // If Hangouts connects with a port named 'onSinksChangedListener', we |
179 // will register a listener and send it a message {'eventName': | 187 // will register a listener and send it a message {'eventName': |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 onSinksChangedPort(port); | 298 onSinksChangedPort(port); |
291 } else if (port.name == 'chooseDesktopMedia') { | 299 } else if (port.name == 'chooseDesktopMedia') { |
292 onChooseDesktopMediaPort(port); | 300 onChooseDesktopMediaPort(port); |
293 } else if (port.name == 'processCpu') { | 301 } else if (port.name == 'processCpu') { |
294 onProcessCpu(port); | 302 onProcessCpu(port); |
295 } else { | 303 } else { |
296 // Unknown port type. | 304 // Unknown port type. |
297 port.disconnect(); | 305 port.disconnect(); |
298 } | 306 } |
299 }); | 307 }); |
OLD | NEW |