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

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

Issue 11366038: Rewrite PPB_AudioInput_Dev to use the new-style host/resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 1 month 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
« no previous file with comments | « content/renderer/pepper/renderer_ppapi_host_impl.h ('k') | ppapi/api/dev/ppb_audio_input_dev.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/renderer_ppapi_host_impl.cc
diff --git a/content/renderer/pepper/renderer_ppapi_host_impl.cc b/content/renderer/pepper/renderer_ppapi_host_impl.cc
index 87f553e4ae029e57091af3f97821d67a7f2b7c10..a9667ad3301ff6383c6cf4b0a679a9f631c9d4bd 100644
--- a/content/renderer/pepper/renderer_ppapi_host_impl.cc
+++ b/content/renderer/pepper/renderer_ppapi_host_impl.cc
@@ -52,7 +52,8 @@ RendererPpapiHostImpl::RendererPpapiHostImpl(
PluginModule* module,
ppapi::proxy::HostDispatcher* dispatcher,
const ppapi::PpapiPermissions& permissions)
- : module_(module) {
+ : module_(module),
+ dispatcher_(dispatcher) {
// Hook the PpapiHost up to the dispatcher for out-of-process communication.
ppapi_host_.reset(
new ppapi::host::PpapiHost(dispatcher, permissions));
@@ -65,7 +66,8 @@ RendererPpapiHostImpl::RendererPpapiHostImpl(
RendererPpapiHostImpl::RendererPpapiHostImpl(
PluginModule* module,
const ppapi::PpapiPermissions& permissions)
- : module_(module) {
+ : module_(module),
+ dispatcher_(NULL) {
// Hook the host up to the in-process router.
in_process_router_.reset(new PepperInProcessRouter(this));
ppapi_host_.reset(new ppapi::host::PpapiHost(
@@ -149,6 +151,11 @@ bool RendererPpapiHostImpl::IsValidInstance(
return !!GetAndValidateInstance(instance);
}
+webkit::ppapi::PluginInstance* RendererPpapiHostImpl::GetPluginInstance(
+ PP_Instance instance) const {
+ return GetAndValidateInstance(instance);
+}
+
WebKit::WebPluginContainer* RendererPpapiHostImpl::GetContainerForInstance(
PP_Instance instance) const {
PluginInstance* instance_object = GetAndValidateInstance(instance);
@@ -168,6 +175,17 @@ bool RendererPpapiHostImpl::HasUserGesture(PP_Instance instance) const {
return instance_object->IsProcessingUserGesture();
}
+IPC::PlatformFileForTransit RendererPpapiHostImpl::ShareHandleWithRemote(
+ base::PlatformFile handle,
+ bool should_close_source) {
+ if (!dispatcher_) {
+ if (should_close_source)
+ base::ClosePlatformFile(handle);
+ return IPC::InvalidPlatformFileForTransit();
+ }
+ return dispatcher_->ShareHandleWithRemote(handle, should_close_source);
+}
+
PluginInstance* RendererPpapiHostImpl::GetAndValidateInstance(
PP_Instance pp_instance) const {
PluginInstance* instance = HostGlobals::Get()->GetInstance(pp_instance);
« no previous file with comments | « content/renderer/pepper/renderer_ppapi_host_impl.h ('k') | ppapi/api/dev/ppb_audio_input_dev.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698