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