summaryrefslogtreecommitdiffstats
path: root/chrome/nacl
diff options
context:
space:
mode:
authormseaborn@chromium.org <mseaborn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-08 20:49:43 +0000
committermseaborn@chromium.org <mseaborn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-08 20:49:43 +0000
commit08cf125f544b93da1ca4c3ed2840bce7fc9ff3fb (patch)
tree4a9efc495cec1225f7b4d75ec709676b83bc322e /chrome/nacl
parent44b94b8f2d7a1b9a4990f0ad5c0805397215813a (diff)
downloadchromium_src-08cf125f544b93da1ca4c3ed2840bce7fc9ff3fb.zip
chromium_src-08cf125f544b93da1ca4c3ed2840bce7fc9ff3fb.tar.gz
chromium_src-08cf125f544b93da1ca4c3ed2840bce7fc9ff3fb.tar.bz2
NaCl: Supply MakeSharedMemorySegmentViaIPC() via dependency injection
This will allow NaCl's #include of a Chromium header to be removed. The extra "executable" argument is in preparation for implementing this function for Mac OS X. BUG=http://code.google.com/p/nativeclient/issues/detail?id=469 BUG=http://code.google.com/p/nativeclient/issues/detail?id=583 TEST=NaCl's test_runner.html with NaCl-side change applied Review URL: http://codereview.chromium.org/4361001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65419 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/nacl')
-rw-r--r--chrome/nacl/DEPS7
-rw-r--r--chrome/nacl/nacl_thread.cc9
2 files changed, 16 insertions, 0 deletions
diff --git a/chrome/nacl/DEPS b/chrome/nacl/DEPS
index 8bdeefd..c2468b9 100644
--- a/chrome/nacl/DEPS
+++ b/chrome/nacl/DEPS
@@ -1,5 +1,12 @@
include_rules = [
"+app",
+ # TODO(mseaborn): Remove chrome/renderer from this list. This is
+ # here because we need chrome/renderer/renderer_sandbox_support_linux.h
+ # for creating shared memory segments. We should probably move this
+ # sandbox support code out of chrome/renderer. (Previously, this
+ # header was #included from the native_client directory, which was
+ # worse.)
+ "+chrome/renderer",
"+chrome/test",
"+sandbox/src",
"+native_client/src",
diff --git a/chrome/nacl/nacl_thread.cc b/chrome/nacl/nacl_thread.cc
index c0a64a7..709b976 100644
--- a/chrome/nacl/nacl_thread.cc
+++ b/chrome/nacl/nacl_thread.cc
@@ -7,6 +7,11 @@
#include "base/scoped_ptr.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/nacl_messages.h"
+#include "native_client/src/shared/imc/nacl_imc.h"
+
+#if defined(OS_LINUX)
+#include "chrome/renderer/renderer_sandbox_support_linux.h"
+#endif
// This is ugly. We need an interface header file for the exported
// sel_ldr interfaces.
@@ -40,6 +45,10 @@ void NaClThread::OnControlMessageReceived(const IPC::Message& msg) {
}
void NaClThread::OnStartSelLdr(std::vector<nacl::FileDescriptor> handles) {
+#if defined(OS_LINUX)
+ nacl::SetCreateMemoryObjectFunc(
+ renderer_sandbox_support::MakeSharedMemorySegmentViaIPCExecutable);
+#endif
scoped_array<NaClHandle> array(new NaClHandle[handles.size()]);
for (size_t i = 0; i < handles.size(); i++) {
array[i] = nacl::ToNativeHandle(handles[i]);