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 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 virtual void OnChannelClosing() OVERRIDE; | 76 virtual void OnChannelClosing() OVERRIDE; |
77 virtual void OnDestruct() const OVERRIDE; | 77 virtual void OnDestruct() const OVERRIDE; |
78 virtual bool OnMessageReceived(const IPC::Message& message, | 78 virtual bool OnMessageReceived(const IPC::Message& message, |
79 bool* message_was_ok) OVERRIDE; | 79 bool* message_was_ok) OVERRIDE; |
80 | 80 |
81 private: | 81 private: |
82 friend class AudioRendererHostTest; | 82 friend class AudioRendererHostTest; |
83 friend class BrowserThread; | 83 friend class BrowserThread; |
84 friend class base::DeleteHelper<AudioRendererHost>; | 84 friend class base::DeleteHelper<AudioRendererHost>; |
85 friend class MockAudioRendererHost; | 85 friend class MockAudioRendererHost; |
| 86 friend class TestAudioRendererHost; |
86 FRIEND_TEST_ALL_PREFIXES(AudioRendererHostTest, CreateMockStream); | 87 FRIEND_TEST_ALL_PREFIXES(AudioRendererHostTest, CreateMockStream); |
87 FRIEND_TEST_ALL_PREFIXES(AudioRendererHostTest, MockStreamDataConversation); | 88 FRIEND_TEST_ALL_PREFIXES(AudioRendererHostTest, MockStreamDataConversation); |
88 | 89 |
89 class AudioEntry; | 90 class AudioEntry; |
90 typedef std::map<int, AudioEntry*> AudioEntryMap; | 91 typedef std::map<int, AudioEntry*> AudioEntryMap; |
91 | 92 |
92 virtual ~AudioRendererHost(); | 93 virtual ~AudioRendererHost(); |
93 | 94 |
94 // Methods called on IO thread ---------------------------------------------- | 95 // Methods called on IO thread ---------------------------------------------- |
95 | 96 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 154 |
154 // A map of stream IDs to audio sources. | 155 // A map of stream IDs to audio sources. |
155 AudioEntryMap audio_entries_; | 156 AudioEntryMap audio_entries_; |
156 | 157 |
157 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); | 158 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); |
158 }; | 159 }; |
159 | 160 |
160 } // namespace content | 161 } // namespace content |
161 | 162 |
162 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ | 163 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ |
OLD | NEW |