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

Unified Diff: content/renderer/pepper/pepper_platform_audio_output_impl.cc

Issue 11166002: Plumb render view ID from audio-related code in renderer through IPCs to AudioRendererHost in brows… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add plumbing for input side as well. Created 8 years, 2 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/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 d196102106fd355a9391cc4c606caff21697c479..99cd55e3a68fdf19e54d5ff256803a9c843db9ad 100644
--- a/content/renderer/pepper/pepper_platform_audio_output_impl.cc
+++ b/content/renderer/pepper/pepper_platform_audio_output_impl.cc
@@ -20,11 +20,12 @@ 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().
@@ -34,7 +35,7 @@ PepperPlatformAudioOutputImpl* PepperPlatformAudioOutputImpl::Create(
}
bool PepperPlatformAudioOutputImpl::StartPlayback() {
- if (ipc_) {
+ if (ipc_.get()) {
tommi (sloooow) - chröme 2012/10/17 18:40:06 nit: I don't think we need to call .get() like thi
miu 2012/10/17 20:10:44 Done.
ChildProcess::current()->io_message_loop()->PostTask(
FROM_HERE,
base::Bind(&PepperPlatformAudioOutputImpl::StartPlaybackOnIOThread,
@@ -45,7 +46,7 @@ bool PepperPlatformAudioOutputImpl::StartPlayback() {
}
bool PepperPlatformAudioOutputImpl::StopPlayback() {
- if (ipc_) {
+ if (ipc_.get()) {
ChildProcess::current()->io_message_loop()->PostTask(
FROM_HERE,
base::Bind(&PepperPlatformAudioOutputImpl::StopPlaybackOnIOThread,
@@ -94,7 +95,7 @@ void PepperPlatformAudioOutputImpl::OnStreamCreated(
}
void PepperPlatformAudioOutputImpl::OnIPCClosed() {
- ipc_ = NULL;
+ ipc_.reset();
}
PepperPlatformAudioOutputImpl::~PepperPlatformAudioOutputImpl() {
@@ -104,11 +105,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(RenderThreadImpl::current()->audio_message_filter()->
+ CreateAudioOutputIPC(render_view_id));
}
bool PepperPlatformAudioOutputImpl::Initialize(

Powered by Google App Engine
This is Rietveld 408576698