Chromium Code Reviews| Index: components/nacl/loader/nacl_listener.cc |
| diff --git a/components/nacl/loader/nacl_listener.cc b/components/nacl/loader/nacl_listener.cc |
| index b5ee5f74fa0039b76c9bd1d75a347bd203df3bec..b407d52107f936c0fb428747448947937579f9e4 100644 |
| --- a/components/nacl/loader/nacl_listener.cc |
| +++ b/components/nacl/loader/nacl_listener.cc |
| @@ -200,6 +200,7 @@ class BrowserValidationDBProxy : public NaClValidationDB { |
| NaClListener::NaClListener() : shutdown_event_(true, false), |
| io_thread_("NaCl_IOThread"), |
| + uses_nonsfi_mode_(false), |
| #if defined(OS_LINUX) |
| prereserved_sandbox_size_(0), |
| #endif |
| @@ -257,6 +258,9 @@ bool NaClListener::OnMessageReceived(const IPC::Message& msg) { |
| } |
| void NaClListener::OnStart(const nacl::NaClStartParams& params) { |
| +#if !defined(OS_LINUX) |
| + CHECK(!uses_nonsfi_mode_) << "Non-SFI NaCl is only supported on Linux"; |
| +#endif |
| #if defined(OS_LINUX) || defined(OS_MACOSX) |
| int urandom_fd = dup(base::GetUrandomFD()); |
| if (urandom_fd < 0) { |
| @@ -287,7 +291,8 @@ void NaClListener::OnStart(const nacl::NaClStartParams& params) { |
| ppapi_renderer_handle = IPC::Channel::GenerateVerifiedChannelID("nacl"); |
| #if defined(OS_LINUX) |
| - if (params.uses_nonsfi_mode) { |
| + if (uses_nonsfi_mode_) { |
| +#endif |
|
Mark Seaborn
2014/04/02 05:45:16
You can't move the #endif to here.
hamaji
2014/04/02 08:38:39
Done.
|
| // In non-SFI mode, we neither intercept nor rewrite the message using |
| // NaClIPCAdapter, and the channels are connected between the plugin and |
| // the hosts directly. So, the IPC::Channel instances will be created in |
| @@ -318,7 +323,6 @@ void NaClListener::OnStart(const nacl::NaClStartParams& params) { |
| ppapi_renderer_handle.socket = |
| base::FileDescriptor(renderer_client_ppapi_fd, true); |
| } else { |
| -#endif |
| // Create the PPAPI IPC channels between the NaCl IRT and the host |
| // (browser/renderer) processes. The IRT uses these channels to |
| // communicate with the host and to initialize the IPC dispatchers. |
| @@ -420,12 +424,10 @@ void NaClListener::OnStart(const nacl::NaClStartParams& params) { |
| args->prereserved_sandbox_size = prereserved_sandbox_size_; |
| #endif |
| -#if defined(OS_LINUX) |
|
Mark Seaborn
2014/04/02 05:45:16
You can't remove this #if/#endif either.
hamaji
2014/04/02 08:38:39
Done.
|
| - if (params.uses_nonsfi_mode) { |
| + if (uses_nonsfi_mode_) { |
| nacl::nonsfi::MainStart(args->imc_bootstrap_handle); |
| return; |
| } |
| -#endif |
| NaClChromeMainStartApp(nap, args); |
| NOTREACHED(); |
| } |