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 ff88399e67227e1e12c0d1f083acd3ed6c543fe4..8073fb597e6354accae8630399eb4f3c880ab46a 100644 |
| --- a/components/nacl/browser/nacl_process_host.cc |
| +++ b/components/nacl/browser/nacl_process_host.cc |
| @@ -27,6 +27,7 @@ |
| #include "base/win/windows_version.h" |
| #include "build/build_config.h" |
| #include "components/nacl/browser/nacl_browser.h" |
| +#include "components/nacl/browser/nacl_browser_delegate.h" |
| #include "components/nacl/browser/nacl_host_message_filter.h" |
| #include "components/nacl/common/nacl_cmd_line.h" |
| #include "components/nacl/common/nacl_host_messages.h" |
| @@ -430,15 +431,21 @@ void NaClProcessHost::Launch( |
| } |
| if (uses_nonsfi_mode_) { |
|
Mark Seaborn
2014/05/03 01:37:59
Note that this code path was originally just meant
elijahtaylor1
2014/05/06 05:56:15
I'll address this in ppb_nacl_private_impl.cc
|
| -#if defined(OS_LINUX) |
| + const bool kNonSFIModeSwitchEnabled = |
|
Mark Seaborn
2014/05/03 01:37:59
Nit: I think the "k" naming style is only for valu
elijahtaylor1
2014/05/06 05:56:15
Done.
|
| + cmd->HasSwitch(switches::kEnableNaClNonSfiMode); |
| +#if defined(OS_CHROMEOS) |
|
Mark Seaborn
2014/05/03 01:37:59
We also need to make this ARM-only.
elijahtaylor1
2014/05/06 05:56:15
Done.
|
| const bool kNonSFIModeSupported = true; |
| +#elif defined(OS_LINUX) |
| + const bool kNonSFIModeSupported = kNonSFIModeSwitchEnabled; |
| #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"); |
| + bool is_enabled = kNonSFIModeSwitchEnabled || |
| + NaClBrowser::GetDelegate()->IsNonSfiModeAllowed(manifest_url_); |
| + |
| + if (!kNonSFIModeSupported || !is_enabled) { |
| + SendErrorToRenderer("NaCl non-SFI mode is not available for this platform" |
| + " and NaCl module."); |
| delete this; |
| return; |
| } |