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

Unified Diff: content/common/sandbox_seccomp_bpf_linux.cc

Issue 103293003: Add build_config_functions.h to avoid #ifdef (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: content/common/sandbox_seccomp_bpf_linux.cc
diff --git a/content/common/sandbox_seccomp_bpf_linux.cc b/content/common/sandbox_seccomp_bpf_linux.cc
index fea84bf444cd86443b5215359b328b41ffd8d3bf..8e8a761df097d3bc4a4caded5d8260d8fa42f4db 100644
--- a/content/common/sandbox_seccomp_bpf_linux.cc
+++ b/content/common/sandbox_seccomp_bpf_linux.cc
@@ -30,6 +30,7 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "build/build_config.h"
+#include "build/build_config_functions.h"
#include "content/common/sandbox_linux.h"
#include "content/common/sandbox_seccomp_bpf_linux.h"
#include "content/public/common/content_switches.h"
@@ -56,54 +57,6 @@ namespace {
void StartSandboxWithPolicy(Sandbox::EvaluateSyscall syscall_policy,
BrokerProcess* broker_process);
-inline bool RunningOnASAN() {
-#if defined(ADDRESS_SANITIZER)
- return true;
-#else
- return false;
-#endif
-}
-
-inline bool IsChromeOS() {
-#if defined(OS_CHROMEOS)
- return true;
-#else
- return false;
-#endif
-}
-
-inline bool IsArchitectureX86_64() {
-#if defined(__x86_64__)
- return true;
-#else
- return false;
-#endif
-}
-
-inline bool IsArchitectureI386() {
-#if defined(__i386__)
- return true;
-#else
- return false;
-#endif
-}
-
-inline bool IsArchitectureArm() {
-#if defined(__arm__)
- return true;
-#else
- return false;
-#endif
-}
-
-inline bool IsUsingToolKitGtk() {
-#if defined(TOOLKIT_GTK)
- return true;
-#else
- return false;
-#endif
-}
-
// Write |error_message| to stderr. Similar to RawLog(), but a bit more careful
// about async-signal safety. |size| is the size to write and should typically
// not include a terminating \0.
@@ -1593,7 +1546,7 @@ ErrorCode ArmGpuBrokerProcessPolicy(Sandbox* sandbox,
// Don't restrict on ASAN.
ErrorCode RestrictCloneToThreadsAndEPERMFork(Sandbox* sandbox) {
// Glibc's pthread.
- if (!RunningOnASAN()) {
+ if (!IsASANBuild()) {
return sandbox->Cond(0, ErrorCode::TP_32BIT, ErrorCode::OP_EQUAL,
CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
CLONE_THREAD | CLONE_SYSVSEM | CLONE_SETTLS |

Powered by Google App Engine
This is Rietveld 408576698