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, error) { | 7 function doSendResponse(value, error) { |
8 var errorMessage = error || chrome.extension.lastError; | 8 var errorMessage = error || chrome.extension.lastError; |
9 sendResponse({'value': value, 'error': errorMessage}); | 9 sendResponse({'value': value, 'error': errorMessage}); |
10 } | 10 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 var sourceId = message['sourceId']; | 56 var sourceId = message['sourceId']; |
57 chrome.webrtcAudioPrivate.getAssociatedSink( | 57 chrome.webrtcAudioPrivate.getAssociatedSink( |
58 origin, sourceId, doSendResponse); | 58 origin, sourceId, doSendResponse); |
59 return true; | 59 return true; |
60 } | 60 } |
61 throw new Error('Unknown method: ' + method); | 61 throw new Error('Unknown method: ' + method); |
62 } catch (e) { | 62 } catch (e) { |
63 doSendResponse(null, e.name + ': ' + e.message); | 63 doSendResponse(null, e.name + ': ' + e.message); |
64 } | 64 } |
65 }); | 65 }); |
OLD | NEW |