Index: content/renderer/pepper/pepper_plugin_delegate_impl.cc |
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_plugin_delegate_impl.cc |
index 82f1acc45a9999ad1f60967769e85be052d31973..d03e3593e8e15d9a127fe31e91b59610c13c4d31 100644 |
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc |
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc |
@@ -73,6 +73,7 @@ |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
#include "ui/gfx/size.h" |
#include "webkit/fileapi/file_system_callback_dispatcher.h" |
+#include "webkit/plugins/plugin_constants.h" |
#include "webkit/plugins/npapi/webplugin.h" |
#include "webkit/plugins/ppapi/file_path.h" |
#include "webkit/plugins/ppapi/ppb_file_io_impl.h" |
@@ -254,6 +255,30 @@ PepperPluginDelegateImpl::CreatePepperPluginModule( |
return module; |
} |
+scoped_refptr<webkit::ppapi::PluginModule> |
+ PepperPluginDelegateImpl::CreateBrowserPluginModule( |
+ base::ProcessHandle process_handle, |
+ const IPC::ChannelHandle& channel_handle) { |
+ // Create a new HostDispatcher for the proxying, and hook it to a new |
+ // PluginModule. Note that AddLiveModule must be called before any early |
+ // returns since the module's destructor will remove itself. |
+ scoped_refptr<webkit::ppapi::PluginModule> module = |
+ new webkit::ppapi::PluginModule(kBrowserPluginName, |
+ FilePath(kBrowserPluginPath), |
+ NULL /* lifetime delegate */); |
+ |
+ scoped_ptr<HostDispatcherWrapper> dispatcher(new HostDispatcherWrapper); |
+ if (!dispatcher->Init( |
+ process_handle, |
+ channel_handle, |
+ module->pp_module(), |
+ webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(), |
+ GetPreferences())) |
+ return scoped_refptr<webkit::ppapi::PluginModule>(); |
+ module->InitAsProxied(dispatcher.release()); |
+ return module; |
+} |
+ |
scoped_refptr<PepperBrokerImpl> PepperPluginDelegateImpl::CreateBroker( |
webkit::ppapi::PluginModule* plugin_module) { |
DCHECK(plugin_module); |