OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_COMMON_SECCOMP_SANDBOX_H_ | 5 #ifndef CONTENT_COMMON_SECCOMP_SANDBOX_H_ |
6 #define CONTENT_COMMON_SECCOMP_SANDBOX_H_ | 6 #define CONTENT_COMMON_SECCOMP_SANDBOX_H_ |
7 #pragma once | |
8 | 7 |
9 // Seccomp enable/disable logic is centralized here. | 8 // Seccomp enable/disable logic is centralized here. |
10 // - We define SECCOMP_SANDBOX if seccomp is compiled in at all: currently, | 9 // - We define SECCOMP_SANDBOX if seccomp is compiled in at all: currently, |
11 // on non-views (non-ChromeOS) non-ARM non-Clang Linux only. | 10 // on non-views (non-ChromeOS) non-ARM non-Clang Linux only. |
12 // - If we have SECCOMP_SANDBOX, we provide SeccompSandboxEnabled() as | 11 // - If we have SECCOMP_SANDBOX, we provide SeccompSandboxEnabled() as |
13 // a run-time test to determine whether to turn on seccomp: | 12 // a run-time test to determine whether to turn on seccomp: |
14 // currently, on by default in debug builds and off by default in | 13 // currently, on by default in debug builds and off by default in |
15 // release. | 14 // release. |
16 | 15 |
17 #include "base/command_line.h" | 16 #include "base/command_line.h" |
(...skipping 18 matching lines...) Expand all Loading... |
36 switches::kEnableSeccompSandbox); | 35 switches::kEnableSeccompSandbox); |
37 #else | 36 #else |
38 // On by default; allow turning off with a switch. | 37 // On by default; allow turning off with a switch. |
39 return !CommandLine::ForCurrentProcess()->HasSwitch( | 38 return !CommandLine::ForCurrentProcess()->HasSwitch( |
40 switches::kDisableSeccompSandbox); | 39 switches::kDisableSeccompSandbox); |
41 #endif // NDEBUG | 40 #endif // NDEBUG |
42 } | 41 } |
43 #endif // SECCOMP_SANDBOX | 42 #endif // SECCOMP_SANDBOX |
44 | 43 |
45 #endif // CONTENT_COMMON_SECCOMP_SANDBOX_H_ | 44 #endif // CONTENT_COMMON_SECCOMP_SANDBOX_H_ |
OLD | NEW |