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

Unified Diff: content/renderer/pepper/renderer_ppapi_host_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
« no previous file with comments | « content/renderer/pepper/pepper_plugin_delegate_impl.cc ('k') | webkit/plugins/ppapi/plugin_module.h » ('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
===================================================================
--- content/renderer/pepper/renderer_ppapi_host_impl.cc (revision 162270)
+++ content/renderer/pepper/renderer_ppapi_host_impl.cc (working copy)
@@ -4,6 +4,7 @@
#include "content/renderer/pepper/renderer_ppapi_host_impl.h"
+#include "base/file_path.h"
#include "base/logging.h"
#include "content/renderer/pepper/pepper_in_process_resource_creation.h"
#include "content/renderer/pepper/pepper_in_process_router.h"
@@ -11,16 +12,44 @@
#include "content/renderer/render_view_impl.h"
#include "ppapi/proxy/host_dispatcher.h"
#include "webkit/plugins/ppapi/host_globals.h"
+#include "webkit/plugins/ppapi/plugin_module.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
using webkit::ppapi::HostGlobals;
using webkit::ppapi::PluginInstance;
+using webkit::ppapi::PluginModule;
namespace content {
+// static
+CONTENT_EXPORT RendererPpapiHost*
+RendererPpapiHost::CreateExternalPluginModule(
+ scoped_refptr<PluginModule> plugin_module,
+ PluginInstance* plugin_instance,
+ const FilePath& file_path,
+ ppapi::PpapiPermissions permissions,
+ const IPC::ChannelHandle& channel_handle,
+ int plugin_child_id) {
+ RendererPpapiHost* renderer_ppapi_host = NULL;
+ // Since we're the embedder, we can make assumptions about the delegate on
+ // the instance.
+ PepperPluginDelegateImpl* pepper_plugin_delegate =
+ static_cast<PepperPluginDelegateImpl*>(plugin_instance->delegate());
+ if (pepper_plugin_delegate) {
+ renderer_ppapi_host = pepper_plugin_delegate->CreateExternalPluginModule(
+ plugin_module,
+ file_path,
+ permissions,
+ channel_handle,
+ plugin_child_id);
+ }
+ return renderer_ppapi_host;
+}
+
+
// Out-of-process constructor.
RendererPpapiHostImpl::RendererPpapiHostImpl(
- webkit::ppapi::PluginModule* module,
+ PluginModule* module,
ppapi::proxy::HostDispatcher* dispatcher,
const ppapi::PpapiPermissions& permissions)
: module_(module) {
@@ -34,7 +63,7 @@
// In-process constructor.
RendererPpapiHostImpl::RendererPpapiHostImpl(
- webkit::ppapi::PluginModule* module,
+ PluginModule* module,
const ppapi::PpapiPermissions& permissions)
: module_(module) {
// Hook the host up to the in-process router.
@@ -50,7 +79,7 @@
// static
RendererPpapiHostImpl* RendererPpapiHostImpl::CreateOnModuleForOutOfProcess(
- webkit::ppapi::PluginModule* module,
+ PluginModule* module,
ppapi::proxy::HostDispatcher* dispatcher,
const ppapi::PpapiPermissions& permissions) {
DCHECK(!module->GetEmbedderState());
@@ -59,14 +88,14 @@
// Takes ownership of pointer.
module->SetEmbedderState(
- scoped_ptr<webkit::ppapi::PluginModule::EmbedderState>(result));
+ scoped_ptr<PluginModule::EmbedderState>(result));
return result;
}
// static
RendererPpapiHostImpl* RendererPpapiHostImpl::CreateOnModuleForInProcess(
- webkit::ppapi::PluginModule* module,
+ PluginModule* module,
const ppapi::PpapiPermissions& permissions) {
DCHECK(!module->GetEmbedderState());
RendererPpapiHostImpl* result = new RendererPpapiHostImpl(
@@ -74,7 +103,7 @@
// Takes ownership of pointer.
module->SetEmbedderState(
- scoped_ptr<webkit::ppapi::PluginModule::EmbedderState>(result));
+ scoped_ptr<PluginModule::EmbedderState>(result));
return result;
}
@@ -94,7 +123,7 @@
scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>
RendererPpapiHostImpl::CreateInProcessResourceCreationAPI(
- webkit::ppapi::PluginInstance* instance) {
+ PluginInstance* instance) {
return scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>(
new PepperInProcessResourceCreation(this, instance));
}
« no previous file with comments | « content/renderer/pepper/pepper_plugin_delegate_impl.cc ('k') | webkit/plugins/ppapi/plugin_module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698