Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: chrome/browser/resources/hangout_services/thunk.js

Issue 880393002: Fix webrtcAudioPrivate API to handle requests from <webview>s. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 return true; 100 return true;
101 } else if (method == 'logging.discard') { 101 } else if (method == 'logging.discard') {
102 chrome.webrtcLoggingPrivate.discard( 102 chrome.webrtcLoggingPrivate.discard(
103 requestInfo, origin, doSendResponse); 103 requestInfo, origin, doSendResponse);
104 return true; 104 return true;
105 } else if (method == 'getSinks') { 105 } else if (method == 'getSinks') {
106 chrome.webrtcAudioPrivate.getSinks(doSendResponse); 106 chrome.webrtcAudioPrivate.getSinks(doSendResponse);
107 return true; 107 return true;
108 } else if (method == 'getActiveSink') { 108 } else if (method == 'getActiveSink') {
109 chrome.webrtcAudioPrivate.getActiveSink( 109 chrome.webrtcAudioPrivate.getActiveSink(
110 sender.tab.id, doSendResponse); 110 requestInfo, doSendResponse);
111 return true; 111 return true;
112 } else if (method == 'setActiveSink') { 112 } else if (method == 'setActiveSink') {
113 var sinkId = message['sinkId']; 113 var sinkId = message['sinkId'];
114 chrome.webrtcAudioPrivate.setActiveSink( 114 chrome.webrtcAudioPrivate.setActiveSink(
115 sender.tab.id, sinkId, doSendResponse); 115 requestInfo, sinkId, doSendResponse);
116 return true; 116 return true;
117 } else if (method == 'getAssociatedSink') { 117 } else if (method == 'getAssociatedSink') {
118 var sourceId = message['sourceId']; 118 var sourceId = message['sourceId'];
119 chrome.webrtcAudioPrivate.getAssociatedSink( 119 chrome.webrtcAudioPrivate.getAssociatedSink(
120 origin, sourceId, doSendResponse); 120 origin, sourceId, doSendResponse);
121 return true; 121 return true;
122 } else if (method == 'isExtensionEnabled') { 122 } else if (method == 'isExtensionEnabled') {
123 // This method is necessary because there may be more than one 123 // This method is necessary because there may be more than one
124 // version of this extension, under different extension IDs. By 124 // version of this extension, under different extension IDs. By
125 // first calling this method on the extension ID, the client can 125 // first calling this method on the extension ID, the client can
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 onSinksChangedPort(port); 254 onSinksChangedPort(port);
255 } else if (port.name == 'chooseDesktopMedia') { 255 } else if (port.name == 'chooseDesktopMedia') {
256 onChooseDesktopMediaPort(port); 256 onChooseDesktopMediaPort(port);
257 } else if (port.name == 'processCpu') { 257 } else if (port.name == 'processCpu') {
258 onProcessCpu(port); 258 onProcessCpu(port);
259 } else { 259 } else {
260 // Unknown port type. 260 // Unknown port type.
261 port.disconnect(); 261 port.disconnect();
262 } 262 }
263 }); 263 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698