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

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

Issue 11140046: Add a content API to connect a Native Client module to an out-of-process PPAPI proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 months 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
Index: content/renderer/pepper/pepper_plugin_delegate_impl.cc
===================================================================
--- content/renderer/pepper/pepper_plugin_delegate_impl.cc (revision 162270)
+++ content/renderer/pepper/pepper_plugin_delegate_impl.cc (working copy)
@@ -383,37 +383,33 @@
return scoped_refptr<webkit::ppapi::PluginModule>();
}
- scoped_refptr<PepperHungPluginFilter> hung_filter(
- new PepperHungPluginFilter(path, render_view_->routing_id(),
- plugin_child_id));
-
- // 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.
+ // AddLiveModule must be called before any early returns since the
+ // module's destructor will remove itself.
module = new webkit::ppapi::PluginModule(
info->name, path,
PepperPluginRegistry::GetInstance(),
permissions);
PepperPluginRegistry::GetInstance()->AddLiveModule(path, module);
- scoped_ptr<HostDispatcherWrapper> dispatcher(
- new HostDispatcherWrapper(module, plugin_child_id, permissions));
- if (!dispatcher->Init(
- channel_handle,
- webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(),
- GetPreferences(),
- permissions,
- hung_filter.get()))
+
+ if (!CreateOutOfProcessModule(
+ module, path, permissions, channel_handle, plugin_child_id)) {
return scoped_refptr<webkit::ppapi::PluginModule>();
-
- RendererPpapiHostImpl* host_impl =
- content::RendererPpapiHostImpl::CreateOnModuleForOutOfProcess(
- module, dispatcher->dispatcher(), permissions);
- render_view_->PpapiPluginCreated(host_impl);
-
- module->InitAsProxied(dispatcher.release());
+ }
return module;
}
+RendererPpapiHost* PepperPluginDelegateImpl::CreateExternalPluginModule(
+ scoped_refptr<webkit::ppapi::PluginModule> module,
+ const FilePath& path,
+ ppapi::PpapiPermissions permissions,
+ const IPC::ChannelHandle& channel_handle,
+ int plugin_child_id) {
+ // We don't call PepperPluginRegistry::AddLiveModule, as this module is
+ // managed externally.
+ return CreateOutOfProcessModule(
+ module, path, permissions, channel_handle, plugin_child_id);
+}
+
scoped_refptr<webkit::ppapi::PluginModule>
PepperPluginDelegateImpl::CreateBrowserPluginModule(
const IPC::ChannelHandle& channel_handle,
@@ -480,6 +476,35 @@
return broker;
}
+RendererPpapiHost* PepperPluginDelegateImpl::CreateOutOfProcessModule(
+ webkit::ppapi::PluginModule* module,
+ const FilePath& path,
+ ppapi::PpapiPermissions permissions,
+ const IPC::ChannelHandle& channel_handle,
+ int plugin_child_id) {
+ scoped_refptr<PepperHungPluginFilter> hung_filter(
+ new PepperHungPluginFilter(path,
+ render_view_->routing_id(),
+ plugin_child_id));
+ scoped_ptr<HostDispatcherWrapper> dispatcher(
+ new HostDispatcherWrapper(module, plugin_child_id, permissions));
+ if (!dispatcher->Init(
+ channel_handle,
+ webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(),
+ GetPreferences(),
+ permissions,
+ hung_filter.get()))
+ return NULL;
+
+ RendererPpapiHostImpl* host_impl =
+ content::RendererPpapiHostImpl::CreateOnModuleForOutOfProcess(
+ module, dispatcher->dispatcher(), permissions);
+ render_view_->PpapiPluginCreated(host_impl);
+
+ module->InitAsProxied(dispatcher.release());
+ return host_impl;
+}
+
void PepperPluginDelegateImpl::OnMenuAction(int request_id, unsigned action) {
// Just save the action.
DCHECK(!has_saved_context_menu_action_);
« no previous file with comments | « content/renderer/pepper/pepper_plugin_delegate_impl.h ('k') | content/renderer/pepper/renderer_ppapi_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698