| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/common/chrome_switches.h" | 5 #include "chrome/common/chrome_switches.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 | 9 |
| 10 namespace switches { | 10 namespace switches { |
| (...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1340 // If host is specified, it also makes initial delay shorter (5 min to 5 sec) | 1340 // If host is specified, it also makes initial delay shorter (5 min to 5 sec) |
| 1341 // to make it faster to test websocket live experiment code. | 1341 // to make it faster to test websocket live experiment code. |
| 1342 const char kWebSocketLiveExperimentHost[] = "websocket-live-experiment-host"; | 1342 const char kWebSocketLiveExperimentHost[] = "websocket-live-experiment-host"; |
| 1343 #endif | 1343 #endif |
| 1344 | 1344 |
| 1345 #if defined(HAVE_XINPUT2) | 1345 #if defined(HAVE_XINPUT2) |
| 1346 const char kTouchDevices[] = "touch-devices"; | 1346 const char kTouchDevices[] = "touch-devices"; |
| 1347 #endif | 1347 #endif |
| 1348 | 1348 |
| 1349 | 1349 |
| 1350 // USE_SECCOMP_SANDBOX controls whether the seccomp sandbox is opt-in or -out. | 1350 // SeccompSandboxEnabled() controls whether we are using Seccomp. |
| 1351 // It is currently off by default on all platforms. |
| 1351 // TODO(evan): unify all of these once we turn the seccomp sandbox always | 1352 // TODO(evan): unify all of these once we turn the seccomp sandbox always |
| 1352 // on. Also remove the #include of command_line.h above. | 1353 // on. Also remove the #include of command_line.h above. |
| 1353 #if defined(USE_SECCOMP_SANDBOX) | 1354 |
| 1354 // Disable the seccomp sandbox (Linux only) | 1355 // Disable the seccomp sandbox (Linux only) |
| 1355 const char kDisableSeccompSandbox[] = "disable-seccomp-sandbox"; | 1356 const char kDisableSeccompSandbox[] = "disable-seccomp-sandbox"; |
| 1356 #else | |
| 1357 // Enable the seccomp sandbox (Linux only) | 1357 // Enable the seccomp sandbox (Linux only) |
| 1358 const char kEnableSeccompSandbox[] = "enable-seccomp-sandbox"; | 1358 const char kEnableSeccompSandbox[] = "enable-seccomp-sandbox"; |
| 1359 #endif | |
| 1360 | 1359 |
| 1361 bool SeccompSandboxEnabled() { | 1360 bool SeccompSandboxEnabled() { |
| 1362 #if defined(USE_SECCOMP_SANDBOX) | |
| 1363 return !CommandLine::ForCurrentProcess()->HasSwitch( | |
| 1364 switches::kDisableSeccompSandbox); | |
| 1365 #else | |
| 1366 return CommandLine::ForCurrentProcess()->HasSwitch( | 1361 return CommandLine::ForCurrentProcess()->HasSwitch( |
| 1367 switches::kEnableSeccompSandbox); | 1362 switches::kEnableSeccompSandbox); |
| 1368 #endif | |
| 1369 } | 1363 } |
| 1370 | 1364 |
| 1371 // ----------------------------------------------------------------------------- | 1365 // ----------------------------------------------------------------------------- |
| 1372 // DO NOT ADD YOUR CRAP TO THE BOTTOM OF THIS FILE. | 1366 // DO NOT ADD YOUR CRAP TO THE BOTTOM OF THIS FILE. |
| 1373 // | 1367 // |
| 1374 // You were going to just dump your switches here, weren't you? Instead, | 1368 // You were going to just dump your switches here, weren't you? Instead, |
| 1375 // please put them in alphabetical order above, or in order inside the | 1369 // please put them in alphabetical order above, or in order inside the |
| 1376 // appropriate ifdef at the bottom. The order should match the header. | 1370 // appropriate ifdef at the bottom. The order should match the header. |
| 1377 // ----------------------------------------------------------------------------- | 1371 // ----------------------------------------------------------------------------- |
| 1378 | 1372 |
| 1379 } // namespace switches | 1373 } // namespace switches |
| OLD | NEW |