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
3 // found in the LICENSE file.
4 
5 #include "base/base_switches.h"
6 #include "build/build_config.h"
7 
8 namespace switches {
9 
10 // Disables the crash reporting.
11 const char kDisableBreakpad[]               = "disable-breakpad";
12 
13 // Indicates that crash reporting should be enabled. On platforms where helper
14 // processes cannot access to files needed to make this decision, this flag is
15 // generated internally.
16 const char kEnableCrashReporter[]           = "enable-crash-reporter";
17 
18 // Makes memory allocators keep track of their allocations and context, so a
19 // detailed breakdown of memory usage can be presented in chrome://tracing when
20 // the memory-infra category is enabled.
21 const char kEnableHeapProfiling[]           = "enable-heap-profiling";
22 
23 // Report pseudo allocation traces. Pseudo traces are derived from currently
24 // active trace events.
25 const char kEnableHeapProfilingModePseudo[] = "";
26 
27 // Report native (walk the stack) allocation traces. By default pseudo stacks
28 // derived from trace events are reported.
29 const char kEnableHeapProfilingModeNative[] = "native";
30 
31 // Report per-task heap usage and churn in the task profiler.
32 // Does not keep track of individual allocations unlike the default and native
33 // mode. Keeps only track of summarized churn stats in the task profiler
34 // (chrome://profiler).
35 const char kEnableHeapProfilingTaskProfiler[] = "task-profiler";
36 
37 // Generates full memory crash dump.
38 const char kFullMemoryCrashReport[]         = "full-memory-crash-report";
39 
40 // Force low-end device mode when set.
41 const char kEnableLowEndDeviceMode[]        = "enable-low-end-device-mode";
42 
43 // Force disabling of low-end device mode when set.
44 const char kDisableLowEndDeviceMode[]       = "disable-low-end-device-mode";
45 
46 // This option can be used to force field trials when testing changes locally.
47 // The argument is a list of name and value pairs, separated by slashes. If a
48 // trial name is prefixed with an asterisk, that trial will start activated.
49 // For example, the following argument defines two trials, with the second one
50 // activated: "GoogleNow/Enable/*MaterialDesignNTP/Default/" This option can
51 // also be used by the browser process to send the list of trials to a
52 // non-browser process, using the same format. See
53 // FieldTrialList::CreateTrialsFromString() in field_trial.h for details.
54 const char kForceFieldTrials[]              = "force-fieldtrials";
55 
56 // Suppresses all error dialogs when present.
57 const char kNoErrorDialogs[]                = "noerrdialogs";
58 
59 // When running certain tests that spawn child processes, this switch indicates
60 // to the test framework that the current process is a child process.
61 const char kTestChildProcess[]              = "test-child-process";
62 
63 // When running certain tests that spawn child processes, this switch indicates
64 // to the test framework that the current process should not initialize ICU to
65 // avoid creating any scoped handles too early in startup.
66 const char kTestDoNotInitializeIcu[]        = "test-do-not-initialize-icu";
67 
68 // Gives the default maximal active V-logging level; 0 is the default.
69 // Normally positive values are used for V-logging levels.
70 const char kV[]                             = "v";
71 
72 // Gives the per-module maximal V-logging levels to override the value
73 // given by --v.  E.g. "my_module=2,foo*=3" would change the logging
74 // level for all code in source files "my_module.*" and "foo*.*"
75 // ("-inl" suffixes are also disregarded for this matching).
76 //
77 // Any pattern containing a forward or backward slash will be tested
78 // against the whole pathname and not just the module.  E.g.,
79 // "*/foo/bar/*=2" would change the logging level for all code in
80 // source files under a "foo/bar" directory.
81 const char kVModule[]                       = "vmodule";
82 
83 // Will wait for 60 seconds for a debugger to come to attach to the process.
84 const char kWaitForDebugger[]               = "wait-for-debugger";
85 
86 // Sends trace events from these categories to a file.
87 // --trace-to-file on its own sends to default categories.
88 const char kTraceToFile[]                   = "trace-to-file";
89 
90 // Specifies the file name for --trace-to-file. If unspecified, it will
91 // go to a default file name.
92 const char kTraceToFileName[]               = "trace-to-file-name";
93 
94 // Configure whether chrome://profiler will contain timing information. This
95 // option is enabled by default. A value of "0" will disable profiler timing,
96 // while all other values will enable it.
97 const char kProfilerTiming[]                = "profiler-timing";
98 // Value of the --profiler-timing flag that will disable timing information for
99 // chrome://profiler.
100 const char kProfilerTimingDisabledValue[]   = "0";
101 
102 // Specifies a location for profiling output. This will only work if chrome has
103 // been built with the gyp variable profiling=1 or gn arg enable_profiling=true.
104 //
105 //   {pid} if present will be replaced by the pid of the process.
106 //   {count} if present will be incremented each time a profile is generated
107 //           for this process.
108 // The default is chrome-profile-{pid} for the browser and test-profile-{pid}
109 // for tests.
110 const char kProfilingFile[] = "profiling-file";
111 
112 #if defined(OS_WIN)
113 // Disables the USB keyboard detection for blocking the OSK on Win8+.
114 const char kDisableUsbKeyboardDetect[]      = "disable-usb-keyboard-detect";
115 #endif
116 
117 #if defined(OS_POSIX)
118 // Used for turning on Breakpad crash reporting in a debug environment where
119 // crash reporting is typically compiled but disabled.
120 const char kEnableCrashReporterForTesting[] =
121     "enable-crash-reporter-for-testing";
122 #endif
123 
124 }  // namespace switches
125