| 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> | |
| 11 | |
| 12 #include "base/macros.h" | 10 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 14 #include "base/system_monitor/system_monitor.h" | 12 #include "base/system_monitor/system_monitor.h" |
| 15 #include "chrome/browser/extensions/chrome_extension_function.h" | 13 #include "chrome/browser/extensions/chrome_extension_function.h" |
| 16 #include "chrome/common/extensions/api/webrtc_audio_private.h" | 14 #include "chrome/common/extensions/api/webrtc_audio_private.h" |
| 17 #include "content/public/browser/render_process_host.h" | 15 #include "content/public/browser/render_process_host.h" |
| 18 #include "content/public/browser/resource_context.h" | 16 #include "content/public/browser/resource_context.h" |
| 19 #include "extensions/browser/browser_context_keyed_api_factory.h" | 17 #include "extensions/browser/browser_context_keyed_api_factory.h" |
| 20 #include "media/audio/audio_device_name.h" | 18 #include "media/audio/audio_device_name.h" |
| 21 | 19 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // | 89 // |
| 92 // Call only on IO thread. | 90 // Call only on IO thread. |
| 93 std::string CalculateHMACImpl(const std::string& raw_id); | 91 std::string CalculateHMACImpl(const std::string& raw_id); |
| 94 | 92 |
| 95 // Initializes |device_id_salt_|. Must be called on the UI thread, | 93 // Initializes |device_id_salt_|. Must be called on the UI thread, |
| 96 // before any calls to |device_id_salt()|. | 94 // before any calls to |device_id_salt()|. |
| 97 void InitDeviceIDSalt(); | 95 void InitDeviceIDSalt(); |
| 98 | 96 |
| 99 // Callable from any thread. Must previously have called | 97 // Callable from any thread. Must previously have called |
| 100 // |InitDeviceIDSalt()|. | 98 // |InitDeviceIDSalt()|. |
| 101 std::string device_id_salt() const; | 99 const content::ResourceContext::SaltCallback& device_id_salt() const; |
| 102 | 100 |
| 103 private: | 101 private: |
| 104 std::string device_id_salt_; | 102 content::ResourceContext::SaltCallback device_id_salt_; |
| 105 | 103 |
| 106 DISALLOW_COPY_AND_ASSIGN(WebrtcAudioPrivateFunction); | 104 DISALLOW_COPY_AND_ASSIGN(WebrtcAudioPrivateFunction); |
| 107 }; | 105 }; |
| 108 | 106 |
| 109 class WebrtcAudioPrivateGetSinksFunction : public WebrtcAudioPrivateFunction { | 107 class WebrtcAudioPrivateGetSinksFunction : public WebrtcAudioPrivateFunction { |
| 110 protected: | 108 protected: |
| 111 ~WebrtcAudioPrivateGetSinksFunction() override {} | 109 ~WebrtcAudioPrivateGetSinksFunction() override {} |
| 112 | 110 |
| 113 private: | 111 private: |
| 114 DECLARE_EXTENSION_FUNCTION("webrtcAudioPrivate.getSinks", | 112 DECLARE_EXTENSION_FUNCTION("webrtcAudioPrivate.getSinks", |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 // time, no locking needed. | 219 // time, no locking needed. |
| 222 std::unique_ptr<api::webrtc_audio_private::GetAssociatedSink::Params> params_; | 220 std::unique_ptr<api::webrtc_audio_private::GetAssociatedSink::Params> params_; |
| 223 | 221 |
| 224 // Audio sources (input devices). Filled in by DoWorkOnDeviceThread. | 222 // Audio sources (input devices). Filled in by DoWorkOnDeviceThread. |
| 225 media::AudioDeviceNames source_devices_; | 223 media::AudioDeviceNames source_devices_; |
| 226 }; | 224 }; |
| 227 | 225 |
| 228 } // namespace extensions | 226 } // namespace extensions |
| 229 | 227 |
| 230 #endif // CHROME_BROWSER_EXTENSIONS_API_WEBRTC_AUDIO_PRIVATE_WEBRTC_AUDIO_PRIVA
TE_API_H_ | 228 #endif // CHROME_BROWSER_EXTENSIONS_API_WEBRTC_AUDIO_PRIVATE_WEBRTC_AUDIO_PRIVA
TE_API_H_ |
| OLD | NEW |