summaryrefslogtreecommitdiffstats
path: root/chrome/nacl/nacl_fork_delegate_linux.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-16 22:33:41 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-16 22:33:41 +0000
commit5214902ed0a0419a8d13954fb233b8953140eb58 (patch)
tree73dc59b1002c4adca7002f8bca0047b395615350 /chrome/nacl/nacl_fork_delegate_linux.cc
parent4a91d85a0201d32309bf4523a02db44cc292ca12 (diff)
downloadchromium_src-5214902ed0a0419a8d13954fb233b8953140eb58.zip
chromium_src-5214902ed0a0419a8d13954fb233b8953140eb58.tar.gz
chromium_src-5214902ed0a0419a8d13954fb233b8953140eb58.tar.bz2
Revert 97040 - Reserve 1GB at the base address of linux nacl_helper for Native Client.
Use PathService instead of command line flag to obtain path for helper. Adds a nacl_helper_bootstrap executable that implements the actual space reservation. BUG=nativeclient:480 TEST=manual for now Review URL: http://codereview.chromium.org/7599011 TBR=bradchen@google.com Review URL: http://codereview.chromium.org/7669004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97042 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/nacl/nacl_fork_delegate_linux.cc')
-rw-r--r--chrome/nacl/nacl_fork_delegate_linux.cc22
1 files changed, 7 insertions, 15 deletions
diff --git a/chrome/nacl/nacl_fork_delegate_linux.cc b/chrome/nacl/nacl_fork_delegate_linux.cc
index e5ee01a..794cfda 100644
--- a/chrome/nacl/nacl_fork_delegate_linux.cc
+++ b/chrome/nacl/nacl_fork_delegate_linux.cc
@@ -13,11 +13,9 @@
#include "base/eintr_wrapper.h"
#include "base/logging.h"
#include "base/file_path.h"
-#include "base/path_service.h"
#include "base/process_util.h"
#include "content/common/unix_domain_socket_posix.h"
#include "content/common/zygote_fork_delegate_linux.h"
-#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/nacl_helper_linux.h"
@@ -42,24 +40,18 @@ void NaClForkDelegate::Init(const bool sandboxed,
base::file_handle_mapping_vector fds_to_map;
fds_to_map.push_back(std::make_pair(fds[1], kNaClZygoteDescriptor));
fds_to_map.push_back(std::make_pair(sandboxdesc, kNaClSandboxDescriptor));
- // TODO(bradchen): To make this the default for release builds,
- // remove command line switch.
+ // TODO(bradchen): Before making this the default for release builds,
+ // replace command line switch with PathService::Get().
+ const std::string nacl_zygote_exe =
+ CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kNaClLinuxHelper);
ready_ = false;
- const bool use_helper = CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kNaClLinuxHelper);
- FilePath helper_exe;
- if (use_helper && PathService::Get(chrome::FILE_NACL_HELPER, &helper_exe)) {
+ if (nacl_zygote_exe.length() != 0) {
CommandLine::StringVector argv = CommandLine::ForCurrentProcess()->argv();
- argv[0] = helper_exe.value();
+ argv[0] = nacl_zygote_exe;
base::LaunchOptions options;
options.fds_to_remap = &fds_to_map;
options.clone_flags = CLONE_FS | SIGCHLD;
- // LD_BIND_NOW forces non-lazy binding in the dynamic linker, to
- // prevent the linker from trying to look at the text of the nacl_helper
- // program after it has been replaced by the nacl module.
- base::environment_vector env;
- env.push_back(std::make_pair("LD_BIND_NOW", "1"));
- options.environ = &env;
ready_ = base::LaunchProcess(argv, options, NULL);
// parent and error cases are handled below
}