| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // AudioRendererHost serves audio related requests from AudioRenderer which | 5 // AudioRendererHost serves audio related requests from AudioRenderer which |
| 6 // lives inside the render process and provide access to audio hardware. | 6 // lives inside the render process and provide access to audio hardware. |
| 7 // | 7 // |
| 8 // This class is owned by RenderProcessHostImpl, and instantiated on UI | 8 // This class is owned by RenderProcessHostImpl, and instantiated on UI |
| 9 // thread, but all other operations and method calls happen on IO thread, so we | 9 // thread, but all other operations and method calls happen on IO thread, so we |
| 10 // need to be extra careful about the lifetime of this object. AudioManager is a | 10 // need to be extra careful about the lifetime of this object. AudioManager is a |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 namespace media { | 69 namespace media { |
| 70 class AudioManager; | 70 class AudioManager; |
| 71 class AudioParameters; | 71 class AudioParameters; |
| 72 } | 72 } |
| 73 | 73 |
| 74 namespace content { | 74 namespace content { |
| 75 | 75 |
| 76 class AudioMirroringManager; | 76 class AudioMirroringManager; |
| 77 class MediaInternals; | 77 class MediaInternals; |
| 78 class MediaStreamManager; | 78 class MediaStreamManager; |
| 79 class MediaStreamUIProxy; | |
| 80 class ResourceContext; | 79 class ResourceContext; |
| 81 | 80 |
| 82 class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter { | 81 class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter { |
| 83 public: | 82 public: |
| 84 // Called from UI thread from the owner of this object. | 83 // Called from UI thread from the owner of this object. |
| 85 AudioRendererHost(int render_process_id, | 84 AudioRendererHost(int render_process_id, |
| 86 media::AudioManager* audio_manager, | 85 media::AudioManager* audio_manager, |
| 87 AudioMirroringManager* mirroring_manager, | 86 AudioMirroringManager* mirroring_manager, |
| 88 MediaInternals* media_internals, | 87 MediaInternals* media_internals, |
| 89 MediaStreamManager* media_stream_manager, | 88 MediaStreamManager* media_stream_manager, |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 void UpdateNumPlayingStreams(AudioEntry* entry, bool is_playing); | 201 void UpdateNumPlayingStreams(AudioEntry* entry, bool is_playing); |
| 203 | 202 |
| 204 // Check if the renderer process has access to the requested output device. | 203 // Check if the renderer process has access to the requested output device. |
| 205 void CheckOutputDeviceAccess(int render_frame_id, | 204 void CheckOutputDeviceAccess(int render_frame_id, |
| 206 const std::string& device_id, | 205 const std::string& device_id, |
| 207 const url::Origin& security_origin, | 206 const url::Origin& security_origin, |
| 208 int stream_id, | 207 int stream_id, |
| 209 base::TimeTicks auth_start_time); | 208 base::TimeTicks auth_start_time); |
| 210 | 209 |
| 211 // Proceed with device authorization after checking permissions. | 210 // Proceed with device authorization after checking permissions. |
| 212 void AccessChecked(std::unique_ptr<MediaStreamUIProxy> ui_proxy, | 211 void AccessChecked(const std::string& device_id, |
| 213 const std::string& device_id, | |
| 214 const url::Origin& security_origin, | 212 const url::Origin& security_origin, |
| 215 int stream_id, | 213 int stream_id, |
| 216 base::TimeTicks auth_start_time, | 214 base::TimeTicks auth_start_time, |
| 217 bool have_access); | 215 bool have_access); |
| 218 | 216 |
| 219 // Translate the hashed |device_id| to a unique device ID. | 217 // Translate the hashed |device_id| to a unique device ID. |
| 220 void TranslateDeviceID(const std::string& device_id, | 218 void TranslateDeviceID(const std::string& device_id, |
| 221 const url::Origin& security_origin, | 219 const url::Origin& security_origin, |
| 222 int stream_id, | 220 int stream_id, |
| 223 base::TimeTicks auth_start_time, | 221 base::TimeTicks auth_start_time, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 // The maximum number of simultaneous streams during the lifetime of this | 278 // The maximum number of simultaneous streams during the lifetime of this |
| 281 // host. Reported as UMA stat at shutdown. | 279 // host. Reported as UMA stat at shutdown. |
| 282 size_t max_simultaneous_streams_; | 280 size_t max_simultaneous_streams_; |
| 283 | 281 |
| 284 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); | 282 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); |
| 285 }; | 283 }; |
| 286 | 284 |
| 287 } // namespace content | 285 } // namespace content |
| 288 | 286 |
| 289 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ | 287 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ |
| OLD | NEW |