| Index: content/renderer/pepper/pepper_platform_audio_output_impl.cc
|
| diff --git a/content/renderer/pepper/pepper_platform_audio_output_impl.cc b/content/renderer/pepper/pepper_platform_audio_output_impl.cc
|
| index 5f1f57da338994d91222b73a0c9ed8ed62aee8bf..f9e258e9e2755a9411412e4d1b5fc536757c822c 100644
|
| --- a/content/renderer/pepper/pepper_platform_audio_output_impl.cc
|
| +++ b/content/renderer/pepper/pepper_platform_audio_output_impl.cc
|
| @@ -12,17 +12,19 @@
|
| #include "content/common/media/audio_messages.h"
|
| #include "content/renderer/media/audio_hardware.h"
|
| #include "content/renderer/media/audio_message_filter.h"
|
| +#include "content/renderer/media/audio_output_ipc.h"
|
| #include "content/renderer/render_thread_impl.h"
|
|
|
| namespace content {
|
|
|
| // static
|
| PepperPlatformAudioOutputImpl* PepperPlatformAudioOutputImpl::Create(
|
| + int render_view_id,
|
| int sample_rate,
|
| int frames_per_buffer,
|
| webkit::ppapi::PluginDelegate::PlatformAudioOutputClient* client) {
|
| scoped_refptr<PepperPlatformAudioOutputImpl> audio_output(
|
| - new PepperPlatformAudioOutputImpl());
|
| + new PepperPlatformAudioOutputImpl(render_view_id));
|
| if (audio_output->Initialize(sample_rate, frames_per_buffer, client)) {
|
| // Balanced by Release invoked in
|
| // PepperPlatformAudioOutputImpl::ShutDownOnIOThread().
|
| @@ -32,7 +34,7 @@ PepperPlatformAudioOutputImpl* PepperPlatformAudioOutputImpl::Create(
|
| }
|
|
|
| bool PepperPlatformAudioOutputImpl::StartPlayback() {
|
| - if (ipc_) {
|
| + if (ipc_.get()) {
|
| ChildProcess::current()->io_message_loop()->PostTask(
|
| FROM_HERE,
|
| base::Bind(&PepperPlatformAudioOutputImpl::StartPlaybackOnIOThread,
|
| @@ -43,7 +45,7 @@ bool PepperPlatformAudioOutputImpl::StartPlayback() {
|
| }
|
|
|
| bool PepperPlatformAudioOutputImpl::StopPlayback() {
|
| - if (ipc_) {
|
| + if (ipc_.get()) {
|
| ChildProcess::current()->io_message_loop()->PostTask(
|
| FROM_HERE,
|
| base::Bind(&PepperPlatformAudioOutputImpl::StopPlaybackOnIOThread,
|
| @@ -92,7 +94,7 @@ void PepperPlatformAudioOutputImpl::OnStreamCreated(
|
| }
|
|
|
| void PepperPlatformAudioOutputImpl::OnIPCClosed() {
|
| - ipc_ = NULL;
|
| + ipc_.reset();
|
| }
|
|
|
| PepperPlatformAudioOutputImpl::~PepperPlatformAudioOutputImpl() {
|
| @@ -102,11 +104,12 @@ PepperPlatformAudioOutputImpl::~PepperPlatformAudioOutputImpl() {
|
| DCHECK(!client_);
|
| }
|
|
|
| -PepperPlatformAudioOutputImpl::PepperPlatformAudioOutputImpl()
|
| +PepperPlatformAudioOutputImpl::PepperPlatformAudioOutputImpl(
|
| + int render_view_id)
|
| : client_(NULL),
|
| stream_id_(0),
|
| main_message_loop_proxy_(base::MessageLoopProxy::current()) {
|
| - ipc_ = RenderThreadImpl::current()->audio_message_filter();
|
| + ipc_.reset(new AudioOutputIPC(render_view_id));
|
| }
|
|
|
| bool PepperPlatformAudioOutputImpl::Initialize(
|
|
|