diff options
author | gregoryd@google.com <gregoryd@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-18 01:46:27 +0000 |
---|---|---|
committer | gregoryd@google.com <gregoryd@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-18 01:46:27 +0000 |
commit | ea5ac0e47d18753dbe971a35cce7f657ba64bae8 (patch) | |
tree | 54713ad26e136bbb9b0bf0062229092c537df533 /chrome/renderer | |
parent | eb4035b0048a7c9e3eeae7e189161f0cfbf3db22 (diff) | |
download | chromium_src-ea5ac0e47d18753dbe971a35cce7f657ba64bae8.zip chromium_src-ea5ac0e47d18753dbe971a35cce7f657ba64bae8.tar.gz chromium_src-ea5ac0e47d18753dbe971a35cce7f657ba64bae8.tar.bz2 |
This is a copy of http://codereview.chromium.org/153002/show
First step towards NaCl-Chrome integration:1. NaCl plugin becomes a built-in plugin in Chrome and runs in the renderer process.2. Most of the changes are related to launching the NaCl process (that loads and runs the NaCl module) and establishing the initial communication between that process and the NaCl plugin.3. This CL relies on another CL that contains the changes on the Native Client side: http://codereview.chromium.org/1501904. Command line flag "--internal-nacl" is required to enable the built-in NaCl plugin.5. NaCl still cannot run in Chrome sandbox, so the "--no-sandbox" flag is also required
TBR=bradnelson
Review URL: http://codereview.chromium.org/207025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26540 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/render_process.cc | 12 | ||||
-rw-r--r-- | chrome/renderer/render_view.cc | 8 |
2 files changed, 19 insertions, 1 deletions
diff --git a/chrome/renderer/render_process.cc b/chrome/renderer/render_process.cc index 610e5d3..6968d93 100644 --- a/chrome/renderer/render_process.cc +++ b/chrome/renderer/render_process.cc @@ -30,7 +30,9 @@ #include "ipc/ipc_channel.h" #include "ipc/ipc_message_utils.h" #include "media/base/media.h" +#include "native_client/src/trusted/plugin/nacl_entry_points.h" #include "webkit/glue/webkit_glue.h" +#include "webkit/glue/plugins/plugin_list.h" //----------------------------------------------------------------------------- @@ -80,6 +82,16 @@ RenderProcess::RenderProcess() StatisticsRecorder::set_dump_on_exit(true); } + if (command_line.HasSwitch(switches::kInternalNaCl)) { + NPAPI::PluginEntryPoints entry_points = { +#if !defined(OS_LINUX) + NaCl_NP_GetEntryPoints, +#endif + NaCl_NP_Initialize, + NaCl_NP_Shutdown}; + NPAPI::PluginList::UseInternalNaCl(&entry_points); + } + FilePath module_path; initialized_media_library_ = PathService::Get(base::DIR_MODULE, &module_path) && diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 4a2335c..bf59158 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -2281,7 +2281,13 @@ webkit_glue::WebPluginDelegate* RenderView::CreatePluginDelegate( else mime_type_to_use = &mime_type; - if (RenderProcess::current()->in_process_plugins()) { + bool in_process_plugin = RenderProcess::current()->in_process_plugins(); + if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInternalNaCl)) { + if (mime_type == "application/x-nacl-srpc") { + in_process_plugin = true; + } + } + if (in_process_plugin) { #if defined(OS_WIN) // In-proc plugins aren't supported on Linux or Mac. return WebPluginDelegateImpl::Create( path, *mime_type_to_use, gfx::NativeViewFromId(host_window_)); |