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

Unified Diff: content/renderer/pepper_plugin_delegate_impl.cc

Issue 7157001: Implements AudioMessageFilter as member in RenderThread (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Added TODO() comment in failing unit test Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/pepper_plugin_delegate_impl.cc
===================================================================
--- content/renderer/pepper_plugin_delegate_impl.cc (revision 90030)
+++ content/renderer/pepper_plugin_delegate_impl.cc (working copy)
@@ -159,9 +159,11 @@
public AudioMessageFilter::Delegate,
public base::RefCountedThreadSafe<PlatformAudioImpl> {
public:
- explicit PlatformAudioImpl(scoped_refptr<AudioMessageFilter> filter)
- : client_(NULL), filter_(filter), stream_id_(0),
+ explicit PlatformAudioImpl()
+ : client_(NULL), stream_id_(0),
main_message_loop_(MessageLoop::current()) {
+ DCHECK(RenderThread::current());
jam 2011/06/23 18:59:55 nit: we usually avoid dchecks against a pointer be
henrika_dont_use 2011/06/27 15:05:44 Done.
+ filter_ = RenderThread::current()->audio_message_filter();
DCHECK(filter_);
}
@@ -273,17 +275,17 @@
void PlatformAudioImpl::InitializeOnIOThread(const AudioParameters& params) {
stream_id_ = filter_->AddDelegate(this);
- filter_->Send(new AudioHostMsg_CreateStream(0, stream_id_, params, true));
+ filter_->Send(new AudioHostMsg_CreateStream(stream_id_, params, true));
}
void PlatformAudioImpl::StartPlaybackOnIOThread() {
if (stream_id_)
- filter_->Send(new AudioHostMsg_PlayStream(0, stream_id_));
+ filter_->Send(new AudioHostMsg_PlayStream(stream_id_));
}
void PlatformAudioImpl::StopPlaybackOnIOThread() {
if (stream_id_)
- filter_->Send(new AudioHostMsg_PauseStream(0, stream_id_));
+ filter_->Send(new AudioHostMsg_PauseStream(stream_id_));
}
void PlatformAudioImpl::ShutDownOnIOThread() {
@@ -291,7 +293,7 @@
if (!stream_id_)
return;
- filter_->Send(new AudioHostMsg_CloseStream(0, stream_id_));
+ filter_->Send(new AudioHostMsg_CloseStream(stream_id_));
filter_->RemoveDelegate(stream_id_);
stream_id_ = 0;
@@ -849,8 +851,7 @@
PepperPluginDelegateImpl::CreateAudio(
uint32_t sample_rate, uint32_t sample_count,
webkit::ppapi::PluginDelegate::PlatformAudio::Client* client) {
- scoped_refptr<PlatformAudioImpl> audio(
- new PlatformAudioImpl(render_view_->audio_message_filter()));
+ scoped_refptr<PlatformAudioImpl> audio(new PlatformAudioImpl());
if (audio->Initialize(sample_rate, sample_count, client)) {
// Balanced by Release invoked in PlatformAudioImpl::ShutDownOnIOThread().
return audio.release();
@@ -989,9 +990,9 @@
return file_system_dispatcher->ReadDirectory(directory_path, dispatcher);
}
-class AsyncOpenFileSystemURLCallbackTranslator :
- public fileapi::FileSystemCallbackDispatcher {
-public:
+class AsyncOpenFileSystemURLCallbackTranslator
+ : public fileapi::FileSystemCallbackDispatcher {
+ public:
AsyncOpenFileSystemURLCallbackTranslator(
webkit::ppapi::PluginDelegate::AsyncOpenFileCallback* callback)
: callback_(callback) {

Powered by Google App Engine
This is Rietveld 408576698