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

Unified Diff: components/nacl/renderer/ppb_nacl_private_impl.cc

Issue 279693002: Split NaCl SFI and non-SFI helpers into separate processes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactor IsNonSFIModeEnabled() into nacl/common 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/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..f350305333ab046349331da5da1dbf559279d433 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 IsNonSFIModeEnabled() ? PP_TRUE : PP_FALSE;
Mark Seaborn 2014/05/12 22:49:26 Maybe use PP_FromBool as the original code did?
mdempsky 2014/05/12 22:54:24 Done.
}
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,

Powered by Google App Engine
This is Rietveld 408576698