| 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 #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 Loading... |
| 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( |
| 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 Loading... |
| 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_ |
| OLD | NEW |