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

Side by Side Diff: chrome/common/chrome_switches.cc

Issue 1558003: linux: enable seccomp sandbox by default (Closed)
Patch Set: better Created 10 years, 8 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 unified diff | Download patch
OLDNEW
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 9
9 namespace switches { 10 namespace switches {
10 11
11 // ----------------------------------------------------------------------------- 12 // -----------------------------------------------------------------------------
12 // Can't find the switch you are looking for? try looking in 13 // Can't find the switch you are looking for? try looking in
13 // base/base_switches.cc instead. 14 // base/base_switches.cc instead.
14 // ----------------------------------------------------------------------------- 15 // -----------------------------------------------------------------------------
15 16
16 // Activate (make foreground) myself on launch. Helpful when Chrome 17 // Activate (make foreground) myself on launch. Helpful when Chrome
17 // is launched on the command line (e.g. by Selenium). Only needed on Mac. 18 // is launched on the command line (e.g. by Selenium). Only needed on Mac.
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 // Enable Native Web Worker support. 281 // Enable Native Web Worker support.
281 const char kEnableNativeWebWorkers[] = "enable-native-web-workers"; 282 const char kEnableNativeWebWorkers[] = "enable-native-web-workers";
282 283
283 // Enable Privacy Blacklists. 284 // Enable Privacy Blacklists.
284 const char kEnablePrivacyBlacklists[] = "enable-privacy-blacklists"; 285 const char kEnablePrivacyBlacklists[] = "enable-privacy-blacklists";
285 286
286 // Turns on the accessibility in the renderer. Off by default until 287 // Turns on the accessibility in the renderer. Off by default until
287 // http://b/issue?id=1432077 is fixed. 288 // http://b/issue?id=1432077 is fixed.
288 const char kEnableRendererAccessibility[] = "enable-renderer-accessibility"; 289 const char kEnableRendererAccessibility[] = "enable-renderer-accessibility";
289 290
290 // Enable the seccomp sandbox (Linux only)
291 const char kEnableSeccompSandbox[] = "enable-seccomp-sandbox";
292
293 // Enables StatsTable, logging statistics to a global named shared memory table. 291 // Enables StatsTable, logging statistics to a global named shared memory table.
294 const char kEnableStatsTable[] = "enable-stats-table"; 292 const char kEnableStatsTable[] = "enable-stats-table";
295 293
296 // Enable syncing browser data to a Google Account. 294 // Enable syncing browser data to a Google Account.
297 const char kEnableSync[] = "enable-sync"; 295 const char kEnableSync[] = "enable-sync";
298 296
299 // Enable syncing browser autofill. 297 // Enable syncing browser autofill.
300 const char kEnableSyncAutofill[] = "enable-sync-autofill"; 298 const char kEnableSyncAutofill[] = "enable-sync-autofill";
301 299
302 // Enable syncing browser bookmarks. 300 // Enable syncing browser bookmarks.
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 874
877 // Makes sure any sync login attempt will fail with an error. (Only 875 // Makes sure any sync login attempt will fail with an error. (Only
878 // used for testing.) 876 // used for testing.)
879 const char kInvalidateSyncLogin[] = "invalidate-sync-login"; 877 const char kInvalidateSyncLogin[] = "invalidate-sync-login";
880 878
881 // Makes sure any sync xmpp login attempt will fail with an error. (Only 879 // Makes sure any sync xmpp login attempt will fail with an error. (Only
882 // used for testing.) 880 // used for testing.)
883 const char kInvalidateSyncXmppLogin[] = "invalidate-sync-xmpp-login"; 881 const char kInvalidateSyncXmppLogin[] = "invalidate-sync-xmpp-login";
884 #endif 882 #endif
885 883
884 // USE_SECCOMP_SANDBOX controls whether the seccomp sandbox is opt-in or -out.
885 // TODO(evan): unify all of these once we turn the seccomp sandbox always
886 // on. Also remove the #include of command_line.h above.
887 #if defined(USE_SECCOMP_SANDBOX)
888 // Disable the seccomp sandbox (Linux only)
889 const char kDisableSeccompSandbox[] = "disable-seccomp-sandbox";
890 #else
891 // Enable the seccomp sandbox (Linux only)
892 const char kEnableSeccompSandbox[] = "enable-seccomp-sandbox";
893 #endif
894
895 bool SeccompSandboxEnabled() {
896 #if defined(USE_SECCOMP_SANDBOX)
897 return !CommandLine::ForCurrentProcess()->HasSwitch(
898 switches::kDisableSeccompSandbox);
899 #else
900 return CommandLine::ForCurrentProcess()->HasSwitch(
901 switches::kEnableSeccompSandbox);
902 #endif
903 }
904
886 // ----------------------------------------------------------------------------- 905 // -----------------------------------------------------------------------------
887 // DO NOT ADD YOUR CRAP TO THE BOTTOM OF THIS FILE. 906 // DO NOT ADD YOUR CRAP TO THE BOTTOM OF THIS FILE.
888 // 907 //
889 // You were going to just dump your switches here, weren't you? Instead, 908 // You were going to just dump your switches here, weren't you? Instead,
890 // please put them in alphabetical order above, or in order inside the 909 // please put them in alphabetical order above, or in order inside the
891 // appropriate ifdef at the bottom. The order should match the header. 910 // appropriate ifdef at the bottom. The order should match the header.
892 // ----------------------------------------------------------------------------- 911 // -----------------------------------------------------------------------------
893 912
894 } // namespace switches 913 } // namespace switches
OLDNEW
« no previous file with comments | « chrome/common/chrome_switches.h ('k') | chrome/renderer/renderer_main_platform_delegate_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698