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

Unified Diff: components/nacl/loader/nacl_sandbox_linux.cc

Issue 117803002: Make building seccomp-bpf a GYP condition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Excludes files to be IDE friendly. Created 7 years 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
« no previous file with comments | « components/nacl.gyp ('k') | content/common/sandbox_linux/sandbox_seccomp_bpf_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/loader/nacl_sandbox_linux.cc
diff --git a/components/nacl/loader/nacl_sandbox_linux.cc b/components/nacl/loader/nacl_sandbox_linux.cc
index 14ba18ff53ebc76ef88f31ac424ab0908bbb9544..f1e4a49a4f71b1ab1efaaade862ea8a9d9f399b2 100644
--- a/components/nacl/loader/nacl_sandbox_linux.cc
+++ b/components/nacl/loader/nacl_sandbox_linux.cc
@@ -13,6 +13,8 @@
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "build/build_config.h"
+
+#if defined(USE_SECCOMP_BPF)
#include "content/public/common/sandbox_init.h"
#include "sandbox/linux/seccomp-bpf/sandbox_bpf.h"
#include "sandbox/linux/seccomp-bpf/sandbox_bpf_policy.h"
@@ -151,12 +153,22 @@ void RunSandboxSanityChecks() {
} // namespace
+#else
+
+#if !defined(ARCH_CPU_MIPS_FAMILY)
+#error "Seccomp-bpf disabled on supported architecture!"
+#endif
+
+#endif // defined(USE_SECCOMP_BPF)
+
bool InitializeBPFSandbox() {
+#if defined(USE_SECCOMP_BPF)
bool sandbox_is_initialized = content::InitializeSandbox(
scoped_ptr<SandboxBPFPolicy>(new NaClBPFSandboxPolicy()));
if (sandbox_is_initialized) {
RunSandboxSanityChecks();
return true;
}
+#endif // defined(USE_SECCOMP_BPF)
return false;
}
« no previous file with comments | « components/nacl.gyp ('k') | content/common/sandbox_linux/sandbox_seccomp_bpf_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698