| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 BrowserRenderProcessHost, and instantiated on UI | 8 // This class is owned by BrowserRenderProcessHost, 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // Set to true after we called Close() for the controller. | 101 // Set to true after we called Close() for the controller. |
| 102 bool pending_close; | 102 bool pending_close; |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 typedef std::map<int, AudioEntry*> AudioEntryMap; | 105 typedef std::map<int, AudioEntry*> AudioEntryMap; |
| 106 | 106 |
| 107 // Called from UI thread from the owner of this object. | 107 // Called from UI thread from the owner of this object. |
| 108 AudioRendererHost(const content::ResourceContext* resource_context); | 108 AudioRendererHost(const content::ResourceContext* resource_context); |
| 109 | 109 |
| 110 // BrowserMessageFilter implementation. | 110 // BrowserMessageFilter implementation. |
| 111 virtual void OnChannelClosing(); | 111 virtual void OnChannelClosing() OVERRIDE; |
| 112 virtual void OnDestruct() const; | 112 virtual void OnDestruct() const OVERRIDE; |
| 113 virtual bool OnMessageReceived(const IPC::Message& message, | 113 virtual bool OnMessageReceived(const IPC::Message& message, |
| 114 bool* message_was_ok); | 114 bool* message_was_ok) OVERRIDE; |
| 115 | 115 |
| 116 // AudioOutputController::EventHandler implementations. | 116 // AudioOutputController::EventHandler implementations. |
| 117 virtual void OnCreated(media::AudioOutputController* controller); | 117 virtual void OnCreated(media::AudioOutputController* controller) OVERRIDE; |
| 118 virtual void OnPlaying(media::AudioOutputController* controller); | 118 virtual void OnPlaying(media::AudioOutputController* controller) OVERRIDE; |
| 119 virtual void OnPaused(media::AudioOutputController* controller); | 119 virtual void OnPaused(media::AudioOutputController* controller) OVERRIDE; |
| 120 virtual void OnError(media::AudioOutputController* controller, | 120 virtual void OnError(media::AudioOutputController* controller, |
| 121 int error_code); | 121 int error_code) OVERRIDE; |
| 122 virtual void OnMoreData(media::AudioOutputController* controller, | 122 virtual void OnMoreData(media::AudioOutputController* controller, |
| 123 AudioBuffersState buffers_state); | 123 AudioBuffersState buffers_state) OVERRIDE; |
| 124 | 124 |
| 125 private: | 125 private: |
| 126 friend class AudioRendererHostTest; | 126 friend class AudioRendererHostTest; |
| 127 friend class content::BrowserThread; | 127 friend class content::BrowserThread; |
| 128 friend class DeleteTask<AudioRendererHost>; | 128 friend class DeleteTask<AudioRendererHost>; |
| 129 friend class MockAudioRendererHost; | 129 friend class MockAudioRendererHost; |
| 130 FRIEND_TEST_ALL_PREFIXES(AudioRendererHostTest, CreateMockStream); | 130 FRIEND_TEST_ALL_PREFIXES(AudioRendererHostTest, CreateMockStream); |
| 131 FRIEND_TEST_ALL_PREFIXES(AudioRendererHostTest, MockStreamDataConversation); | 131 FRIEND_TEST_ALL_PREFIXES(AudioRendererHostTest, MockStreamDataConversation); |
| 132 | 132 |
| 133 virtual ~AudioRendererHost(); | 133 virtual ~AudioRendererHost(); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 // A map of stream IDs to audio sources. | 217 // A map of stream IDs to audio sources. |
| 218 AudioEntryMap audio_entries_; | 218 AudioEntryMap audio_entries_; |
| 219 | 219 |
| 220 const content::ResourceContext* resource_context_; | 220 const content::ResourceContext* resource_context_; |
| 221 MediaObserver* media_observer_; | 221 MediaObserver* media_observer_; |
| 222 | 222 |
| 223 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); | 223 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); |
| 224 }; | 224 }; |
| 225 | 225 |
| 226 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ | 226 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ |
| OLD | NEW |