• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2012 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "base/base_switches.h"
6 #include "build/build_config.h"
7 #include "build/chromeos_buildflags.h"
8 
9 namespace switches {
10 
11 // Delays execution of TaskPriority::BEST_EFFORT tasks until shutdown.
12 const char kDisableBestEffortTasks[] = "disable-best-effort-tasks";
13 
14 // Disables the crash reporting.
15 const char kDisableBreakpad[]               = "disable-breakpad";
16 
17 // Comma-separated list of feature names to disable. See also kEnableFeatures.
18 const char kDisableFeatures[] = "disable-features";
19 
20 // Force disabling of low-end device mode when set.
21 const char kDisableLowEndDeviceMode[] = "disable-low-end-device-mode";
22 
23 // Indicates that crash reporting should be enabled. On platforms where helper
24 // processes cannot access to files needed to make this decision, this flag is
25 // generated internally.
26 const char kEnableCrashReporter[]           = "enable-crash-reporter";
27 
28 // Comma-separated list of feature names to enable. See also kDisableFeatures.
29 const char kEnableFeatures[] = "enable-features";
30 
31 // Force low-end device mode when set.
32 const char kEnableLowEndDeviceMode[]        = "enable-low-end-device-mode";
33 
34 // Enable the use of background thread priorities for background tasks in the
35 // ThreadPool even on systems where it is disabled by default, e.g. due to
36 // concerns about priority inversions.
37 const char kEnableBackgroundThreadPool[] = "enable-background-thread-pool";
38 
39 // Handle to the shared memory segment containing field trial state that is to
40 // be shared between processes. The argument to this switch is made of segments
41 // separated by commas:
42 // - The platform-specific handle id for the shared memory as a string.
43 // - (Windows only) i=inherited by duplication or p=child must open parent.
44 // - The high 64 bits of the shared memory block GUID.
45 // - The low 64 bits of the shared memory block GUID.
46 // - The size of the shared memory segment as a string.
47 const char kFieldTrialHandle[] = "field-trial-handle";
48 
49 // This option can be used to force field trials when testing changes locally.
50 // The argument is a list of name and value pairs, separated by slashes. If a
51 // trial name is prefixed with an asterisk, that trial will start activated.
52 // For example, the following argument defines two trials, with the second one
53 // activated: "GoogleNow/Enable/*MaterialDesignNTP/Default/" This option can
54 // also be used by the browser process to send the list of trials to a
55 // non-browser process, using the same format. See
56 // FieldTrialList::CreateTrialsFromString() in field_trial.h for details.
57 const char kForceFieldTrials[]              = "force-fieldtrials";
58 
59 // Generates full memory crash dump.
60 const char kFullMemoryCrashReport[] = "full-memory-crash-report";
61 
62 // Logs information about all tasks posted with TaskPriority::BEST_EFFORT. Use
63 // this to diagnose issues that are thought to be caused by
64 // TaskPriority::BEST_EFFORT execution fences. Note: Tasks posted to a
65 // non-BEST_EFFORT UpdateableSequencedTaskRunner whose priority is later lowered
66 // to BEST_EFFORT are not logged.
67 const char kLogBestEffortTasks[] = "log-best-effort-tasks";
68 
69 // Handle to the shared memory segment a child process should use to transmit
70 // histograms back to the browser process.
71 const char kMetricsSharedMemoryHandle[] = "metrics-shmem-handle";
72 
73 // Suppresses all error dialogs when present.
74 const char kNoErrorDialogs[]                = "noerrdialogs";
75 
76 // Starts the sampling based profiler for the browser process at startup. This
77 // will only work if chrome has been built with the gn arg enable_profiling =
78 // true. The output will go to the value of kProfilingFile.
79 const char kProfilingAtStart[] = "profiling-at-start";
80 
81 // Specifies a location for profiling output. This will only work if chrome has
82 // been built with the gyp variable profiling=1 or gn arg enable_profiling=true.
83 //
84 //   {pid} if present will be replaced by the pid of the process.
85 //   {count} if present will be incremented each time a profile is generated
86 //           for this process.
87 // The default is chrome-profile-{pid} for the browser and test-profile-{pid}
88 // for tests.
89 const char kProfilingFile[] = "profiling-file";
90 
91 // Controls whether profile data is periodically flushed to a file. Normally
92 // the data gets written on exit but cases exist where chromium doesn't exit
93 // cleanly (especially when using single-process). A time in seconds can be
94 // specified.
95 const char kProfilingFlush[] = "profiling-flush";
96 
97 // When running certain tests that spawn child processes, this switch indicates
98 // to the test framework that the current process is a child process.
99 const char kTestChildProcess[] = "test-child-process";
100 
101 // Sends trace events from these categories to a file.
102 // --trace-to-file on its own sends to default categories.
103 const char kTraceToFile[] = "trace-to-file";
104 
105 // Specifies the file name for --trace-to-file. If unspecified, it will
106 // go to a default file name.
107 const char kTraceToFileName[] = "trace-to-file-name";
108 
109 // Gives the default maximal active V-logging level; 0 is the default.
110 // Normally positive values are used for V-logging levels.
111 const char kV[] = "v";
112 
113 // Gives the per-module maximal V-logging levels to override the value
114 // given by --v.  E.g. "my_module=2,foo*=3" would change the logging
115 // level for all code in source files "my_module.*" and "foo*.*"
116 // ("-inl" suffixes are also disregarded for this matching).
117 //
118 // Any pattern containing a forward or backward slash will be tested
119 // against the whole pathname and not just the module.  E.g.,
120 // "*/foo/bar/*=2" would change the logging level for all code in
121 // source files under a "foo/bar" directory.
122 const char kVModule[] = "vmodule";
123 
124 // Will wait for 60 seconds for a debugger to come to attach to the process.
125 const char kWaitForDebugger[] = "wait-for-debugger";
126 
127 #if BUILDFLAG(IS_WIN)
128 // Disable high-resolution timer on Windows.
129 const char kDisableHighResTimer[] = "disable-highres-timer";
130 
131 // Disables the USB keyboard detection for blocking the OSK on Windows.
132 const char kDisableUsbKeyboardDetect[]      = "disable-usb-keyboard-detect";
133 #endif
134 
135 #if BUILDFLAG(IS_LINUX)
136 // The /dev/shm partition is too small in certain VM environments, causing
137 // Chrome to fail or crash (see http://crbug.com/715363). Use this flag to
138 // work-around this issue (a temporary directory will always be used to create
139 // anonymous shared memory files).
140 const char kDisableDevShmUsage[] = "disable-dev-shm-usage";
141 #endif
142 
143 #if BUILDFLAG(IS_POSIX)
144 // Used for turning on Breakpad crash reporting in a debug environment where
145 // crash reporting is typically compiled but disabled.
146 const char kEnableCrashReporterForTesting[] =
147     "enable-crash-reporter-for-testing";
148 #endif
149 
150 #if BUILDFLAG(IS_ANDROID)
151 // Default country code to be used for search engine localization.
152 const char kDefaultCountryCodeAtInstall[] = "default-country-code";
153 
154 // Adds additional thread idle time information into the trace event output.
155 const char kEnableIdleTracing[] = "enable-idle-tracing";
156 
157 // When we retrieve the package name within the SDK Runtime, we need to use
158 // a bit of a hack to do this by taking advantage of the fact that the pid
159 // is the same pid as the application's pid + 10000.
160 // see:
161 // https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/core/java/android/os/Process.java;l=292;drc=47fffdd53115a9af1820e3f89d8108745be4b55d
162 // When the render process is created however, it is just a regular isolated
163 // process with no particular association so we can't perform the same hack.
164 // When creating minidumps, the package name is retrieved from the process
165 // meaning the render process minidumps would end up reporting a generic
166 // process name not associated with the app.
167 // We work around this by feeding through the host package information to the
168 // render process when launching it.
169 const char kHostPackageName[] = "host-package-name";
170 const char kHostPackageLabel[] = "host-package-label";
171 const char kHostVersionCode[] = "host-version-code";
172 const char kPackageName[] = "package-name";
173 const char kPackageVersionName[] = "package-version-name";
174 #endif
175 
176 #if BUILDFLAG(IS_CHROMEOS)
177 // Override the default scheduling boosting value for urgent tasks.
178 // This can be adjusted if a specific chromeos device shows better perf/power
179 // ratio (e.g. by running video conference tests).
180 // Currently, this values directs to linux scheduler's utilization min clamp.
181 // Range is 0(no biased load) ~ 100(mamximum load value).
182 const char kSchedulerBoostUrgent[] = "scheduler-boost-urgent";
183 #endif
184 
185 }  // namespace switches
186