xref: /aosp_15_r20/external/libchrome/base/base_switches.cc (revision 635a864187cb8b6c713ff48b7e790a6b21769273)
1*635a8641SAndroid Build Coastguard Worker // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2*635a8641SAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be
3*635a8641SAndroid Build Coastguard Worker // found in the LICENSE file.
4*635a8641SAndroid Build Coastguard Worker 
5*635a8641SAndroid Build Coastguard Worker #include "base/base_switches.h"
6*635a8641SAndroid Build Coastguard Worker #include "build/build_config.h"
7*635a8641SAndroid Build Coastguard Worker 
8*635a8641SAndroid Build Coastguard Worker namespace switches {
9*635a8641SAndroid Build Coastguard Worker 
10*635a8641SAndroid Build Coastguard Worker // Delays execution of base::TaskPriority::BACKGROUND tasks until shutdown.
11*635a8641SAndroid Build Coastguard Worker const char kDisableBackgroundTasks[] = "disable-background-tasks";
12*635a8641SAndroid Build Coastguard Worker 
13*635a8641SAndroid Build Coastguard Worker // Disables the crash reporting.
14*635a8641SAndroid Build Coastguard Worker const char kDisableBreakpad[]               = "disable-breakpad";
15*635a8641SAndroid Build Coastguard Worker 
16*635a8641SAndroid Build Coastguard Worker // Comma-separated list of feature names to disable. See also kEnableFeatures.
17*635a8641SAndroid Build Coastguard Worker const char kDisableFeatures[] = "disable-features";
18*635a8641SAndroid Build Coastguard Worker 
19*635a8641SAndroid Build Coastguard Worker // Indicates that crash reporting should be enabled. On platforms where helper
20*635a8641SAndroid Build Coastguard Worker // processes cannot access to files needed to make this decision, this flag is
21*635a8641SAndroid Build Coastguard Worker // generated internally.
22*635a8641SAndroid Build Coastguard Worker const char kEnableCrashReporter[]           = "enable-crash-reporter";
23*635a8641SAndroid Build Coastguard Worker 
24*635a8641SAndroid Build Coastguard Worker // Comma-separated list of feature names to enable. See also kDisableFeatures.
25*635a8641SAndroid Build Coastguard Worker const char kEnableFeatures[] = "enable-features";
26*635a8641SAndroid Build Coastguard Worker 
27*635a8641SAndroid Build Coastguard Worker // Generates full memory crash dump.
28*635a8641SAndroid Build Coastguard Worker const char kFullMemoryCrashReport[]         = "full-memory-crash-report";
29*635a8641SAndroid Build Coastguard Worker 
30*635a8641SAndroid Build Coastguard Worker // Force low-end device mode when set.
31*635a8641SAndroid Build Coastguard Worker const char kEnableLowEndDeviceMode[]        = "enable-low-end-device-mode";
32*635a8641SAndroid Build Coastguard Worker 
33*635a8641SAndroid Build Coastguard Worker // Force disabling of low-end device mode when set.
34*635a8641SAndroid Build Coastguard Worker const char kDisableLowEndDeviceMode[]       = "disable-low-end-device-mode";
35*635a8641SAndroid Build Coastguard Worker 
36*635a8641SAndroid Build Coastguard Worker // This option can be used to force field trials when testing changes locally.
37*635a8641SAndroid Build Coastguard Worker // The argument is a list of name and value pairs, separated by slashes. If a
38*635a8641SAndroid Build Coastguard Worker // trial name is prefixed with an asterisk, that trial will start activated.
39*635a8641SAndroid Build Coastguard Worker // For example, the following argument defines two trials, with the second one
40*635a8641SAndroid Build Coastguard Worker // activated: "GoogleNow/Enable/*MaterialDesignNTP/Default/" This option can
41*635a8641SAndroid Build Coastguard Worker // also be used by the browser process to send the list of trials to a
42*635a8641SAndroid Build Coastguard Worker // non-browser process, using the same format. See
43*635a8641SAndroid Build Coastguard Worker // FieldTrialList::CreateTrialsFromString() in field_trial.h for details.
44*635a8641SAndroid Build Coastguard Worker const char kForceFieldTrials[]              = "force-fieldtrials";
45*635a8641SAndroid Build Coastguard Worker 
46*635a8641SAndroid Build Coastguard Worker // Suppresses all error dialogs when present.
47*635a8641SAndroid Build Coastguard Worker const char kNoErrorDialogs[]                = "noerrdialogs";
48*635a8641SAndroid Build Coastguard Worker 
49*635a8641SAndroid Build Coastguard Worker // When running certain tests that spawn child processes, this switch indicates
50*635a8641SAndroid Build Coastguard Worker // to the test framework that the current process is a child process.
51*635a8641SAndroid Build Coastguard Worker const char kTestChildProcess[]              = "test-child-process";
52*635a8641SAndroid Build Coastguard Worker 
53*635a8641SAndroid Build Coastguard Worker // When running certain tests that spawn child processes, this switch indicates
54*635a8641SAndroid Build Coastguard Worker // to the test framework that the current process should not initialize ICU to
55*635a8641SAndroid Build Coastguard Worker // avoid creating any scoped handles too early in startup.
56*635a8641SAndroid Build Coastguard Worker const char kTestDoNotInitializeIcu[]        = "test-do-not-initialize-icu";
57*635a8641SAndroid Build Coastguard Worker 
58*635a8641SAndroid Build Coastguard Worker // Gives the default maximal active V-logging level; 0 is the default.
59*635a8641SAndroid Build Coastguard Worker // Normally positive values are used for V-logging levels.
60*635a8641SAndroid Build Coastguard Worker const char kV[]                             = "v";
61*635a8641SAndroid Build Coastguard Worker 
62*635a8641SAndroid Build Coastguard Worker // Gives the per-module maximal V-logging levels to override the value
63*635a8641SAndroid Build Coastguard Worker // given by --v.  E.g. "my_module=2,foo*=3" would change the logging
64*635a8641SAndroid Build Coastguard Worker // level for all code in source files "my_module.*" and "foo*.*"
65*635a8641SAndroid Build Coastguard Worker // ("-inl" suffixes are also disregarded for this matching).
66*635a8641SAndroid Build Coastguard Worker //
67*635a8641SAndroid Build Coastguard Worker // Any pattern containing a forward or backward slash will be tested
68*635a8641SAndroid Build Coastguard Worker // against the whole pathname and not just the module.  E.g.,
69*635a8641SAndroid Build Coastguard Worker // "*/foo/bar/*=2" would change the logging level for all code in
70*635a8641SAndroid Build Coastguard Worker // source files under a "foo/bar" directory.
71*635a8641SAndroid Build Coastguard Worker const char kVModule[]                       = "vmodule";
72*635a8641SAndroid Build Coastguard Worker 
73*635a8641SAndroid Build Coastguard Worker // Will wait for 60 seconds for a debugger to come to attach to the process.
74*635a8641SAndroid Build Coastguard Worker const char kWaitForDebugger[]               = "wait-for-debugger";
75*635a8641SAndroid Build Coastguard Worker 
76*635a8641SAndroid Build Coastguard Worker // Sends trace events from these categories to a file.
77*635a8641SAndroid Build Coastguard Worker // --trace-to-file on its own sends to default categories.
78*635a8641SAndroid Build Coastguard Worker const char kTraceToFile[]                   = "trace-to-file";
79*635a8641SAndroid Build Coastguard Worker 
80*635a8641SAndroid Build Coastguard Worker // Specifies the file name for --trace-to-file. If unspecified, it will
81*635a8641SAndroid Build Coastguard Worker // go to a default file name.
82*635a8641SAndroid Build Coastguard Worker const char kTraceToFileName[]               = "trace-to-file-name";
83*635a8641SAndroid Build Coastguard Worker 
84*635a8641SAndroid Build Coastguard Worker // Specifies a location for profiling output. This will only work if chrome has
85*635a8641SAndroid Build Coastguard Worker // been built with the gyp variable profiling=1 or gn arg enable_profiling=true.
86*635a8641SAndroid Build Coastguard Worker //
87*635a8641SAndroid Build Coastguard Worker //   {pid} if present will be replaced by the pid of the process.
88*635a8641SAndroid Build Coastguard Worker //   {count} if present will be incremented each time a profile is generated
89*635a8641SAndroid Build Coastguard Worker //           for this process.
90*635a8641SAndroid Build Coastguard Worker // The default is chrome-profile-{pid} for the browser and test-profile-{pid}
91*635a8641SAndroid Build Coastguard Worker // for tests.
92*635a8641SAndroid Build Coastguard Worker const char kProfilingFile[] = "profiling-file";
93*635a8641SAndroid Build Coastguard Worker 
94*635a8641SAndroid Build Coastguard Worker #if defined(OS_WIN)
95*635a8641SAndroid Build Coastguard Worker // Disables the USB keyboard detection for blocking the OSK on Win8+.
96*635a8641SAndroid Build Coastguard Worker const char kDisableUsbKeyboardDetect[]      = "disable-usb-keyboard-detect";
97*635a8641SAndroid Build Coastguard Worker #endif
98*635a8641SAndroid Build Coastguard Worker 
99*635a8641SAndroid Build Coastguard Worker #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
100*635a8641SAndroid Build Coastguard Worker // The /dev/shm partition is too small in certain VM environments, causing
101*635a8641SAndroid Build Coastguard Worker // Chrome to fail or crash (see http://crbug.com/715363). Use this flag to
102*635a8641SAndroid Build Coastguard Worker // work-around this issue (a temporary directory will always be used to create
103*635a8641SAndroid Build Coastguard Worker // anonymous shared memory files).
104*635a8641SAndroid Build Coastguard Worker const char kDisableDevShmUsage[] = "disable-dev-shm-usage";
105*635a8641SAndroid Build Coastguard Worker #endif
106*635a8641SAndroid Build Coastguard Worker 
107*635a8641SAndroid Build Coastguard Worker #if defined(OS_POSIX)
108*635a8641SAndroid Build Coastguard Worker // Used for turning on Breakpad crash reporting in a debug environment where
109*635a8641SAndroid Build Coastguard Worker // crash reporting is typically compiled but disabled.
110*635a8641SAndroid Build Coastguard Worker const char kEnableCrashReporterForTesting[] =
111*635a8641SAndroid Build Coastguard Worker     "enable-crash-reporter-for-testing";
112*635a8641SAndroid Build Coastguard Worker #endif
113*635a8641SAndroid Build Coastguard Worker 
114*635a8641SAndroid Build Coastguard Worker #if defined(OS_ANDROID)
115*635a8641SAndroid Build Coastguard Worker // Optimizes memory layout of the native library using the orderfile symbols
116*635a8641SAndroid Build Coastguard Worker // given in base/android/library_loader/anchor_functions.h, via madvise and
117*635a8641SAndroid Build Coastguard Worker // changing the library prefetch behavior.
118*635a8641SAndroid Build Coastguard Worker const char kOrderfileMemoryOptimization[] = "orderfile-memory-optimization";
119*635a8641SAndroid Build Coastguard Worker #endif
120*635a8641SAndroid Build Coastguard Worker 
121*635a8641SAndroid Build Coastguard Worker }  // namespace switches
122