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

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

Issue 264923011: Add a whitelist check for nacl-nonsfi mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add includes (windows compile fail) Created 6 years, 7 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
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 6ef4986aecb87d005a8e83e4eefeafaadbc53ba4..a2a7f535163a3991147f9a21a996c11f180ee557 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,23 @@ void NaClProcessHost::Launch(
}
if (uses_nonsfi_mode_) {
+ bool nonsfi_mode_forced_by_command_line = false;
+ bool nonsfi_mode_allowed = false;
#if defined(OS_LINUX)
- const bool kNonSFIModeSupported = true;
-#else
- const bool kNonSFIModeSupported = false;
+ nonsfi_mode_forced_by_command_line =
+ cmd->HasSwitch(switches::kEnableNaClNonSfiMode);
+#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
+ nonsfi_mode_allowed = NaClBrowser::GetDelegate()->IsNonSfiModeAllowed(
+ nacl_host_message_filter->profile_directory(), manifest_url_);
+#endif
#endif
- if (!kNonSFIModeSupported ||
- !cmd->HasSwitch(switches::kEnableNaClNonSfiMode)) {
- SendErrorToRenderer("NaCl non-SFI mode works only on Linux with"
- " --enable-nacl-nonsfi-mode specified");
+ bool nonsfi_mode_enabled =
+ nonsfi_mode_forced_by_command_line || nonsfi_mode_allowed;
+
+ if (!nonsfi_mode_enabled) {
+ SendErrorToRenderer(
+ "NaCl non-SFI mode is not available for this platform"
+ " and NaCl module.");
delete this;
return;
}
« no previous file with comments | « components/nacl/browser/nacl_browser_delegate.h ('k') | components/nacl/browser/test_nacl_browser_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698