#include "content/renderer/pepper/pepper_platform_audio_input.h"
#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
#include "content/renderer/pepper/renderer_ppapi_host_impl.h"
-#include "content/renderer/render_view_impl.h"
+#include "content/renderer/render_frame_impl.h"
#include "ipc/ipc_message.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/host/dispatch_host_message.h"
renderer_ppapi_host_(host),
audio_input_(NULL),
enumeration_helper_(this,
- PepperMediaDeviceManager::GetForRenderView(
- host->GetRenderViewForInstance(pp_instance())),
+ PepperMediaDeviceManager::GetForRenderFrame(
+ host->GetRenderFrameForInstance(pp_instance())),
PP_DEVICETYPE_DEV_AUDIOCAPTURE,
host->GetDocumentURL(instance)) {}
if (enumeration_helper_.HandleResourceMessage(msg, context, &result))
return result;
- IPC_BEGIN_MESSAGE_MAP(PepperAudioInputHost, msg)
- PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_AudioInput_Open, OnOpen)
- PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_AudioInput_StartOrStop,
- OnStartOrStop);
- PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_AudioInput_Close, OnClose);
- IPC_END_MESSAGE_MAP()
+ PPAPI_BEGIN_MESSAGE_MAP(PepperAudioInputHost, msg)
+ PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_AudioInput_Open, OnOpen)
+ PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_AudioInput_StartOrStop,
+ OnStartOrStop)
+ PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_AudioInput_Close, OnClose)
+ PPAPI_END_MESSAGE_MAP()
return PP_ERROR_FAILED;
}
// When it is done, we'll get called back on StreamCreated() or
// StreamCreationFailed().
- RenderViewImpl* render_view = static_cast<RenderViewImpl*>(
- renderer_ppapi_host_->GetRenderViewForInstance(pp_instance()));
-
- audio_input_ =
- PepperPlatformAudioInput::Create(render_view->AsWeakPtr(),
- device_id,
- document_url,
- static_cast<int>(sample_rate),
- static_cast<int>(sample_frame_count),
- this);
+ audio_input_ = PepperPlatformAudioInput::Create(
+ renderer_ppapi_host_->GetRenderFrameForInstance(pp_instance())->
+ GetRoutingID(),
+ device_id,
+ document_url,
+ static_cast<int>(sample_rate),
+ static_cast<int>(sample_frame_count),
+ this);
if (audio_input_) {
open_context_ = context->MakeReplyMessageContext();
return PP_OK_COMPLETIONPENDING;