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 8447093be3bb1b3e6b80376faabd7243b27b74f3..0dde8e2638088938589bfe15cc62f51adee725c1 100644 |
--- a/content/renderer/pepper/renderer_ppapi_host_impl.cc |
+++ b/content/renderer/pepper/renderer_ppapi_host_impl.cc |
@@ -79,6 +79,19 @@ RendererPpapiHostImpl* RendererPpapiHostImpl::CreateOnModuleForInProcess( |
return result; |
} |
+// static |
+RendererPpapiHostImpl* RendererPpapiHostImpl::GetForPPInstance( |
+ PP_Instance pp_instance) { |
+ PluginInstance* instance = HostGlobals::Get()->GetInstance(pp_instance); |
+ if (!instance) |
+ return NULL; |
+ |
+ // All modules created by content will have their embedders state be the |
+ // host impl. |
+ return static_cast<RendererPpapiHostImpl*>( |
+ instance->module()->GetEmbedderState()); |
+} |
+ |
scoped_ptr< ::ppapi::thunk::ResourceCreationAPI> |
RendererPpapiHostImpl::CreateInProcessResourceCreationAPI( |
webkit::ppapi::PluginInstance* instance) { |