Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Side by Side Diff: content/browser/renderer_host/media/audio_renderer_host.h

Issue 9845033: Move the MediaObserver getter from ResourceContext to ContentBrowserClient, since we only need to s… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix dcheck Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 // ownership of the reader. 82 // ownership of the reader.
83 scoped_ptr<media::AudioOutputController::SyncReader> reader; 83 scoped_ptr<media::AudioOutputController::SyncReader> reader;
84 84
85 // Set to true after we called Close() for the controller. 85 // Set to true after we called Close() for the controller.
86 bool pending_close; 86 bool pending_close;
87 }; 87 };
88 88
89 typedef std::map<int, AudioEntry*> AudioEntryMap; 89 typedef std::map<int, AudioEntry*> AudioEntryMap;
90 90
91 // Called from UI thread from the owner of this object. 91 // Called from UI thread from the owner of this object.
92 AudioRendererHost(content::ResourceContext* resource_context, 92 AudioRendererHost(AudioManager* audio_manager,
93 AudioManager* audio_manager); 93 content::MediaObserver* media_observer);
94 94
95 // content::BrowserMessageFilter implementation. 95 // content::BrowserMessageFilter implementation.
96 virtual void OnChannelClosing() OVERRIDE; 96 virtual void OnChannelClosing() OVERRIDE;
97 virtual void OnDestruct() const OVERRIDE; 97 virtual void OnDestruct() const OVERRIDE;
98 virtual bool OnMessageReceived(const IPC::Message& message, 98 virtual bool OnMessageReceived(const IPC::Message& message,
99 bool* message_was_ok) OVERRIDE; 99 bool* message_was_ok) OVERRIDE;
100 100
101 // AudioOutputController::EventHandler implementations. 101 // AudioOutputController::EventHandler implementations.
102 virtual void OnCreated(media::AudioOutputController* controller) OVERRIDE; 102 virtual void OnCreated(media::AudioOutputController* controller) OVERRIDE;
103 virtual void OnPlaying(media::AudioOutputController* controller) OVERRIDE; 103 virtual void OnPlaying(media::AudioOutputController* controller) OVERRIDE;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 171
172 // A helper method to look up a AudioEntry identified by |stream_id|. 172 // A helper method to look up a AudioEntry identified by |stream_id|.
173 // Returns NULL if not found. 173 // Returns NULL if not found.
174 AudioEntry* LookupById(int stream_id); 174 AudioEntry* LookupById(int stream_id);
175 175
176 // Search for a AudioEntry having the reference to |controller|. 176 // Search for a AudioEntry having the reference to |controller|.
177 // This method is used to look up an AudioEntry after a controller 177 // This method is used to look up an AudioEntry after a controller
178 // event is received. 178 // event is received.
179 AudioEntry* LookupByController(media::AudioOutputController* controller); 179 AudioEntry* LookupByController(media::AudioOutputController* controller);
180 180
181 // Returns the MediaObserver from |resource_context_| or NULL if none exists.
182 content::MediaObserver* GetMediaObserver();
183
184 // A map of stream IDs to audio sources. 181 // A map of stream IDs to audio sources.
185 AudioEntryMap audio_entries_; 182 AudioEntryMap audio_entries_;
186 183
187 content::ResourceContext* resource_context_;
188 AudioManager* audio_manager_; 184 AudioManager* audio_manager_;
185 content::MediaObserver* media_observer_;
189 186
190 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); 187 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost);
191 }; 188 };
192 189
193 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ 190 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_
OLDNEW
« no previous file with comments | « content/browser/mock_content_browser_client.cc ('k') | content/browser/renderer_host/media/audio_renderer_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698