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

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

Issue 9433006: Remove GetAudioManager and GetMediaStreamManager from ResourceContext. The reason is the content mo… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments Created 8 years, 10 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(content::ResourceContext* resource_context,
93 AudioManager* audio_manager);
93 94
94 // content::BrowserMessageFilter implementation. 95 // content::BrowserMessageFilter implementation.
95 virtual void OnChannelClosing() OVERRIDE; 96 virtual void OnChannelClosing() OVERRIDE;
96 virtual void OnDestruct() const OVERRIDE; 97 virtual void OnDestruct() const OVERRIDE;
97 virtual bool OnMessageReceived(const IPC::Message& message, 98 virtual bool OnMessageReceived(const IPC::Message& message,
98 bool* message_was_ok) OVERRIDE; 99 bool* message_was_ok) OVERRIDE;
99 100
100 // AudioOutputController::EventHandler implementations. 101 // AudioOutputController::EventHandler implementations.
101 virtual void OnCreated(media::AudioOutputController* controller) OVERRIDE; 102 virtual void OnCreated(media::AudioOutputController* controller) OVERRIDE;
102 virtual void OnPlaying(media::AudioOutputController* controller) OVERRIDE; 103 virtual void OnPlaying(media::AudioOutputController* controller) OVERRIDE;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 // Return resource_context_->media_observer() or a cached copy thereof. 181 // Return resource_context_->media_observer() or a cached copy thereof.
181 // This is necessary because resource_context_ can be destructed before all 182 // This is necessary because resource_context_ can be destructed before all
182 // AudioEntries have been deleted. The MediaObserver's lifetime is tied to 183 // AudioEntries have been deleted. The MediaObserver's lifetime is tied to
183 // that of the IO thread, so this is safe. 184 // that of the IO thread, so this is safe.
184 MediaObserver* media_observer(); 185 MediaObserver* media_observer();
185 186
186 // A map of stream IDs to audio sources. 187 // A map of stream IDs to audio sources.
187 AudioEntryMap audio_entries_; 188 AudioEntryMap audio_entries_;
188 189
189 content::ResourceContext* resource_context_; 190 content::ResourceContext* resource_context_;
191 AudioManager* audio_manager_;
190 MediaObserver* media_observer_; 192 MediaObserver* media_observer_;
191 193
192 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); 194 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost);
193 }; 195 };
194 196
195 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ 197 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698