summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/render_process.cc
diff options
context:
space:
mode:
authorgregoryd@google.com <gregoryd@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-26 09:47:54 +0000
committergregoryd@google.com <gregoryd@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-26 09:47:54 +0000
commit08127f528cf213bd2d24539e0dd78436df0cd434 (patch)
tree27090d8cc7a2e431b6099383dd96ee92798e16e8 /chrome/renderer/render_process.cc
parent09843b5f0930b2f19a55a3b405aeacb48fc90f01 (diff)
downloadchromium_src-08127f528cf213bd2d24539e0dd78436df0cd434.zip
chromium_src-08127f528cf213bd2d24539e0dd78436df0cd434.tar.gz
chromium_src-08127f528cf213bd2d24539e0dd78436df0cd434.tar.bz2
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. Command line flag "--internal-nacl" is required to enable the built-in NaCl plugin. NaCl still cannot run in Chrome sandbox, the flag automatically disables the sandboxCommitted: http://src.chromium.org/viewvc/chrome?view=rev&revision=27315
Review URL: http://codereview.chromium.org/153002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27324 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_process.cc')
-rw-r--r--chrome/renderer/render_process.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/renderer/render_process.cc b/chrome/renderer/render_process.cc
index 610e5d3..0c579ea 100644
--- a/chrome/renderer/render_process.cc
+++ b/chrome/renderer/render_process.cc
@@ -25,11 +25,13 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/render_messages.h"
+#include "chrome/common/nacl_types.h"
#include "chrome/common/transport_dib.h"
#include "chrome/renderer/render_view.h"
#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"
//-----------------------------------------------------------------------------
@@ -80,6 +82,9 @@ RenderProcess::RenderProcess()
StatisticsRecorder::set_dump_on_exit(true);
}
+ if (command_line.HasSwitch(switches::kInternalNaCl))
+ RegisterInternalNaClPlugin(RenderProcess::LaunchNaClProcess);
+
FilePath module_path;
initialized_media_library_ =
PathService::Get(base::DIR_MODULE, &module_path) &&
@@ -112,6 +117,19 @@ bool RenderProcess::InProcessPlugins() {
#endif
}
+bool RenderProcess::LaunchNaClProcess(int imc_fd,
+ nacl::Handle* handle) {
+ // TODO(gregoryd): nacl::FileDescriptor will be soon merged with
+ // base::FileDescriptor
+ nacl::FileDescriptor descriptor;
+ if (!RenderThread::current()->Send(
+ new ViewHostMsg_LaunchNaCl(imc_fd, &descriptor))) {
+ return false;
+ }
+ *handle = NATIVE_HANDLE(descriptor);
+ return true;
+}
+
// -----------------------------------------------------------------------------
// Platform specific code for dealing with bitmap transport...