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

Unified Diff: components/nacl/browser/nacl_process_host.cc

Issue 216603002: Tell nacl_helper to use non SFI mode in HandleForkRequest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | « chrome/app/chrome_main_delegate.cc ('k') | components/nacl/common/nacl_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/browser/nacl_process_host.cc
diff --git a/components/nacl/browser/nacl_process_host.cc b/components/nacl/browser/nacl_process_host.cc
index 13169747becf4399c8193930c4d46448730d6c43..89e3f80a3b142fef063c0f0cdb25a7fecc98494e 100644
--- a/components/nacl/browser/nacl_process_host.cc
+++ b/components/nacl/browser/nacl_process_host.cc
@@ -429,6 +429,21 @@ void NaClProcessHost::Launch(
return;
}
+ if (uses_nonsfi_mode_) {
+#if defined(OS_LINUX)
+ const bool kNonSFIModeSupported = true;
+#else
+ const bool kNonSFIModeSupported = false;
+#endif
+ if (!kNonSFIModeSupported ||
+ !cmd->HasSwitch(switches::kEnableNaClNonSfiMode)) {
+ SendErrorToRenderer("NaCl non-SFI mode works only on Linux with"
+ " --enable-nacl-nonsfi-mode specified");
+ delete this;
+ return;
+ }
+ }
+
// Rather than creating a socket pair in the renderer, and passing
// one side through the browser to sel_ldr, socket pairs are created
// in the browser and then passed to the renderer and sel_ldr.
@@ -592,7 +607,9 @@ bool NaClProcessHost::LaunchSelLdr() {
CopyNaClCommandLineArguments(cmd_line.get());
cmd_line->AppendSwitchASCII(switches::kProcessType,
- switches::kNaClLoaderProcess);
+ (uses_nonsfi_mode_ ?
+ switches::kNaClLoaderNonSfiProcess :
+ switches::kNaClLoaderProcess));
cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id);
if (NaClBrowser::GetDelegate()->DialogsAreSuppressed())
cmd_line->AppendSwitch(switches::kNoErrorDialogs);
@@ -777,7 +794,6 @@ bool NaClProcessHost::StartNaClExecution() {
params.enable_ipc_proxy = enable_ppapi_proxy();
params.uses_irt = uses_irt_;
params.enable_dyncode_syscalls = enable_dyncode_syscalls_;
- params.uses_nonsfi_mode = uses_nonsfi_mode_;
const ChildProcessData& data = process_->GetData();
if (!ShareHandleToSelLdr(data.handle,
@@ -827,19 +843,6 @@ bool NaClProcessHost::StartNaClExecution() {
}
#endif
- if (params.uses_nonsfi_mode) {
-#if defined(OS_LINUX)
- const bool kNonSFIModeSupported = true;
-#else
- const bool kNonSFIModeSupported = false;
-#endif
- if (!kNonSFIModeSupported ||
- !CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableNaClNonSfiMode)) {
- return false;
- }
- }
-
process_->Send(new NaClProcessMsg_Start(params));
internal_->socket_for_sel_ldr = NACL_INVALID_HANDLE;
« no previous file with comments | « chrome/app/chrome_main_delegate.cc ('k') | components/nacl/common/nacl_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698