Index: components/nacl/renderer/ppb_nacl_private_impl.cc |
diff --git a/components/nacl/renderer/ppb_nacl_private_impl.cc b/components/nacl/renderer/ppb_nacl_private_impl.cc |
index 2623e28b89cf73d3447687dbf6a79dde173ef397..88d8c5140f2486fc08c8a7951dffa4e90077f7c9 100644 |
--- a/components/nacl/renderer/ppb_nacl_private_impl.cc |
+++ b/components/nacl/renderer/ppb_nacl_private_impl.cc |
@@ -18,6 +18,7 @@ |
#include "base/rand_util.h" |
#include "components/nacl/common/nacl_host_messages.h" |
#include "components/nacl/common/nacl_messages.h" |
+#include "components/nacl/common/nacl_nonsfi_util.h" |
#include "components/nacl/common/nacl_switches.h" |
#include "components/nacl/common/nacl_types.h" |
#include "components/nacl/renderer/histogram.h" |
@@ -523,19 +524,8 @@ int32_t GetNumberOfProcessors() { |
return num_processors; |
} |
-PP_Bool IsNonSFIModeEnabled() { |
-// Note that this only indicates whether non-sfi mode *can* run for a given |
-// platform and if nonsfi manifest entries are preferred. There can be other |
-// restrictions which prevent a particular module from launching. See |
-// NaClProcessHost::Launch which makes the final determination. |
-#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
- return PP_TRUE; |
-#elif defined(OS_LINUX) |
- return PP_FromBool(CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kEnableNaClNonSfiMode)); |
-#else |
- return PP_FALSE; |
-#endif |
+PP_Bool PPIsNonSFIModeEnabled() { |
+ return PP_FromBool(IsNonSFIModeEnabled()); |
} |
int32_t GetNexeFd(PP_Instance instance, |
@@ -1005,7 +995,7 @@ int32_t CreateJsonManifest(PP_Instance instance, |
new nacl::JsonManifest( |
manifest_url, |
isa_type, |
- PP_ToBool(IsNonSFIModeEnabled()), |
+ IsNonSFIModeEnabled(), |
PP_ToBool(NaClDebugEnabledForURL(manifest_url)))); |
JsonManifest::ErrorInfo error_info; |
if (j->Init(manifest_data, &error_info)) { |
@@ -1238,7 +1228,7 @@ const PPB_NaCl_Private nacl_interface = { |
&GetReadonlyPnaclFD, |
&CreateTemporaryFile, |
&GetNumberOfProcessors, |
- &IsNonSFIModeEnabled, |
+ &PPIsNonSFIModeEnabled, |
&GetNexeFd, |
&ReportTranslationFinished, |
&OpenNaClExecutable, |