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) { |