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

Side by Side Diff: chrome/browser/extensions/api/webrtc_audio_private/webrtc_audio_private_api.h

Issue 2801853005: Create a private API for controlling WebRTC's AEC3 (Closed)
Patch Set: After grunell's second round of comments Created 3 years, 8 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEBRTC_AUDIO_PRIVATE_WEBRTC_AUDIO_PRIVATE_ API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEBRTC_AUDIO_PRIVATE_WEBRTC_AUDIO_PRIVATE_ API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_WEBRTC_AUDIO_PRIVATE_WEBRTC_AUDIO_PRIVATE_ API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_WEBRTC_AUDIO_PRIVATE_WEBRTC_AUDIO_PRIVATE_ API_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 std::string CalculateHMACImpl(const std::string& raw_id); 94 std::string CalculateHMACImpl(const std::string& raw_id);
95 95
96 // Initializes |device_id_salt_|. Must be called on the UI thread, 96 // Initializes |device_id_salt_|. Must be called on the UI thread,
97 // before any calls to |device_id_salt()|. 97 // before any calls to |device_id_salt()|.
98 void InitDeviceIDSalt(); 98 void InitDeviceIDSalt();
99 99
100 // Callable from any thread. Must previously have called 100 // Callable from any thread. Must previously have called
101 // |InitDeviceIDSalt()|. 101 // |InitDeviceIDSalt()|.
102 std::string device_id_salt() const; 102 std::string device_id_salt() const;
103 103
104 // Returns the RenderProcessHost associated with the given |request|
105 // authorized by the |security_origin|. Returns null if unauthorized or
106 // the RPH does not exist.
107 content::RenderProcessHost* RphFromRequest(
Devlin 2017/04/10 21:34:25 Nit: avoid uncommon abbreviation in names [1]. It
hlundin-chromium 2017/04/11 09:19:37 Done.
108 const api::webrtc_audio_private::RequestInfo& request,
109 const std::string& security_origin);
110
104 private: 111 private:
105 std::string device_id_salt_; 112 std::string device_id_salt_;
106 113
107 DISALLOW_COPY_AND_ASSIGN(WebrtcAudioPrivateFunction); 114 DISALLOW_COPY_AND_ASSIGN(WebrtcAudioPrivateFunction);
108 }; 115 };
109 116
110 class WebrtcAudioPrivateGetSinksFunction : public WebrtcAudioPrivateFunction { 117 class WebrtcAudioPrivateGetSinksFunction : public WebrtcAudioPrivateFunction {
111 protected: 118 protected:
112 ~WebrtcAudioPrivateGetSinksFunction() override {} 119 ~WebrtcAudioPrivateGetSinksFunction() override {}
113 120
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 void OnHMACCalculated(const std::string& hmac) override; 227 void OnHMACCalculated(const std::string& hmac) override;
221 228
222 // Accessed from UI thread and device thread, but only on one at a 229 // Accessed from UI thread and device thread, but only on one at a
223 // time, no locking needed. 230 // time, no locking needed.
224 std::unique_ptr<api::webrtc_audio_private::GetAssociatedSink::Params> params_; 231 std::unique_ptr<api::webrtc_audio_private::GetAssociatedSink::Params> params_;
225 232
226 // Audio sources (input devices). Filled in by DoWorkOnDeviceThread. 233 // Audio sources (input devices). Filled in by DoWorkOnDeviceThread.
227 media::AudioDeviceDescriptions source_devices_; 234 media::AudioDeviceDescriptions source_devices_;
228 }; 235 };
229 236
237 class WebrtcAudioPrivateSetAudioExperimentsFunction
238 : public WebrtcAudioPrivateFunction {
239 public:
240 WebrtcAudioPrivateSetAudioExperimentsFunction();
241
242 protected:
243 ~WebrtcAudioPrivateSetAudioExperimentsFunction() override;
244
245 private:
246 DECLARE_EXTENSION_FUNCTION("webrtcAudioPrivate.setAudioExperiments",
247 WEBRTC_AUDIO_PRIVATE_SET_AUDIO_EXPERIMENTS);
248
249 bool RunAsync() override;
250 };
251
230 } // namespace extensions 252 } // namespace extensions
231 253
232 #endif // CHROME_BROWSER_EXTENSIONS_API_WEBRTC_AUDIO_PRIVATE_WEBRTC_AUDIO_PRIVA TE_API_H_ 254 #endif // CHROME_BROWSER_EXTENSIONS_API_WEBRTC_AUDIO_PRIVATE_WEBRTC_AUDIO_PRIVA TE_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698