Chromium Code Reviews| 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..c70bd38fd47fd87f0ed2296a84c8a4e9d7f1c3b5 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,6 +607,8 @@ bool NaClProcessHost::LaunchSelLdr() { |
| CopyNaClCommandLineArguments(cmd_line.get()); |
| cmd_line->AppendSwitchASCII(switches::kProcessType, |
| + uses_nonsfi_mode_ ? |
| + switches::kNaClLoaderNonSfiProcess : |
|
hidehiko
2014/03/31 18:56:17
nit: indent?
Mark Seaborn
2014/03/31 19:35:56
Or '()' brackets, i.e.
foo(blah,
(blah ?
hamaji
2014/04/01 06:53:09
Done.
|
| switches::kNaClLoaderProcess); |
| cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); |
| if (NaClBrowser::GetDelegate()->DialogsAreSuppressed()) |
| @@ -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; |