base_switches.cc 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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. #include "base/base_switches.h"
  5. #include "build/build_config.h"
  6. #include "build/chromeos_buildflags.h"
  7. namespace switches {
  8. // Delays execution of TaskPriority::BEST_EFFORT tasks until shutdown.
  9. const char kDisableBestEffortTasks[] = "disable-best-effort-tasks";
  10. // Disables the crash reporting.
  11. const char kDisableBreakpad[] = "disable-breakpad";
  12. // Comma-separated list of feature names to disable. See also kEnableFeatures.
  13. const char kDisableFeatures[] = "disable-features";
  14. // Force disabling of low-end device mode when set.
  15. const char kDisableLowEndDeviceMode[] = "disable-low-end-device-mode";
  16. // Indicates that crash reporting should be enabled. On platforms where helper
  17. // processes cannot access to files needed to make this decision, this flag is
  18. // generated internally.
  19. const char kEnableCrashReporter[] = "enable-crash-reporter";
  20. // Comma-separated list of feature names to enable. See also kDisableFeatures.
  21. const char kEnableFeatures[] = "enable-features";
  22. // Force low-end device mode when set.
  23. const char kEnableLowEndDeviceMode[] = "enable-low-end-device-mode";
  24. // Enable the use of background thread priorities for background tasks in the
  25. // ThreadPool even on systems where it is disabled by default, e.g. due to
  26. // concerns about priority inversions.
  27. const char kEnableBackgroundThreadPool[] = "enable-background-thread-pool";
  28. // Handle to the shared memory segment containing field trial state that is to
  29. // be shared between processes. The argument to this switch is made of 4
  30. // segments, separated by commas:
  31. // 1. The platform-specific handle id for the shared memory as a string.
  32. // 2. The high 64 bits of the shared memory block GUID.
  33. // 3. The low 64 bits of the shared memory block GUID.
  34. // 4. The size of the shared memory segment as a string.
  35. const char kFieldTrialHandle[] = "field-trial-handle";
  36. // This option can be used to force field trials when testing changes locally.
  37. // The argument is a list of name and value pairs, separated by slashes. If a
  38. // trial name is prefixed with an asterisk, that trial will start activated.
  39. // For example, the following argument defines two trials, with the second one
  40. // activated: "GoogleNow/Enable/*MaterialDesignNTP/Default/" This option can
  41. // also be used by the browser process to send the list of trials to a
  42. // non-browser process, using the same format. See
  43. // FieldTrialList::CreateTrialsFromString() in field_trial.h for details.
  44. const char kForceFieldTrials[] = "force-fieldtrials";
  45. // Generates full memory crash dump.
  46. const char kFullMemoryCrashReport[] = "full-memory-crash-report";
  47. // Logs information about all tasks posted with TaskPriority::BEST_EFFORT. Use
  48. // this to diagnose issues that are thought to be caused by
  49. // TaskPriority::BEST_EFFORT execution fences. Note: Tasks posted to a
  50. // non-BEST_EFFORT UpdateableSequencedTaskRunner whose priority is later lowered
  51. // to BEST_EFFORT are not logged.
  52. const char kLogBestEffortTasks[] = "log-best-effort-tasks";
  53. // Suppresses all error dialogs when present.
  54. const char kNoErrorDialogs[] = "noerrdialogs";
  55. // Starts the sampling based profiler for the browser process at startup. This
  56. // will only work if chrome has been built with the gn arg enable_profiling =
  57. // true. The output will go to the value of kProfilingFile.
  58. const char kProfilingAtStart[] = "profiling-at-start";
  59. // Specifies a location for profiling output. This will only work if chrome has
  60. // been built with the gyp variable profiling=1 or gn arg enable_profiling=true.
  61. //
  62. // {pid} if present will be replaced by the pid of the process.
  63. // {count} if present will be incremented each time a profile is generated
  64. // for this process.
  65. // The default is chrome-profile-{pid} for the browser and test-profile-{pid}
  66. // for tests.
  67. const char kProfilingFile[] = "profiling-file";
  68. // Controls whether profile data is periodically flushed to a file. Normally
  69. // the data gets written on exit but cases exist where chromium doesn't exit
  70. // cleanly (especially when using single-process). A time in seconds can be
  71. // specified.
  72. const char kProfilingFlush[] = "profiling-flush";
  73. // When running certain tests that spawn child processes, this switch indicates
  74. // to the test framework that the current process is a child process.
  75. const char kTestChildProcess[] = "test-child-process";
  76. // When running certain tests that spawn child processes, this switch indicates
  77. // to the test framework that the current process should not initialize ICU to
  78. // avoid creating any scoped handles too early in startup.
  79. const char kTestDoNotInitializeIcu[] = "test-do-not-initialize-icu";
  80. // Sends trace events from these categories to a file.
  81. // --trace-to-file on its own sends to default categories.
  82. const char kTraceToFile[] = "trace-to-file";
  83. // Specifies the file name for --trace-to-file. If unspecified, it will
  84. // go to a default file name.
  85. const char kTraceToFileName[] = "trace-to-file-name";
  86. // Gives the default maximal active V-logging level; 0 is the default.
  87. // Normally positive values are used for V-logging levels.
  88. const char kV[] = "v";
  89. // Gives the per-module maximal V-logging levels to override the value
  90. // given by --v. E.g. "my_module=2,foo*=3" would change the logging
  91. // level for all code in source files "my_module.*" and "foo*.*"
  92. // ("-inl" suffixes are also disregarded for this matching).
  93. //
  94. // Any pattern containing a forward or backward slash will be tested
  95. // against the whole pathname and not just the module. E.g.,
  96. // "*/foo/bar/*=2" would change the logging level for all code in
  97. // source files under a "foo/bar" directory.
  98. const char kVModule[] = "vmodule";
  99. // Will wait for 60 seconds for a debugger to come to attach to the process.
  100. const char kWaitForDebugger[] = "wait-for-debugger";
  101. #if BUILDFLAG(IS_WIN)
  102. // Disable high-resolution timer on Windows.
  103. const char kDisableHighResTimer[] = "disable-highres-timer";
  104. // Disables the USB keyboard detection for blocking the OSK on Win8+.
  105. const char kDisableUsbKeyboardDetect[] = "disable-usb-keyboard-detect";
  106. #endif
  107. // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
  108. // of lacros-chrome is complete.
  109. #if BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS_ASH) && \
  110. !BUILDFLAG(IS_CHROMEOS_LACROS)
  111. // The /dev/shm partition is too small in certain VM environments, causing
  112. // Chrome to fail or crash (see http://crbug.com/715363). Use this flag to
  113. // work-around this issue (a temporary directory will always be used to create
  114. // anonymous shared memory files).
  115. const char kDisableDevShmUsage[] = "disable-dev-shm-usage";
  116. #endif
  117. #if BUILDFLAG(IS_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. #if BUILDFLAG(IS_ANDROID)
  124. // Enables the reached code profiler that samples all threads in all processes
  125. // to determine which functions are almost never executed.
  126. const char kEnableReachedCodeProfiler[] = "enable-reached-code-profiler";
  127. // Specifies the profiling interval in microseconds for reached code profiler.
  128. const char kReachedCodeSamplingIntervalUs[] =
  129. "reached-code-sampling-interval-us";
  130. // Default country code to be used for search engine localization.
  131. const char kDefaultCountryCodeAtInstall[] = "default-country-code";
  132. // Adds additional thread idle time information into the trace event output.
  133. const char kEnableIdleTracing[] = "enable-idle-tracing";
  134. // The field trial parameters and their values when testing changes locally.
  135. const char kForceFieldTrialParams[] = "force-fieldtrial-params";
  136. #endif
  137. #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
  138. // TODO(crbug.com/1176772): Remove kEnableCrashpad and IsCrashpadEnabled() when
  139. // Crashpad is fully enabled on Linux. Indicates that Crashpad should be
  140. // enabled.
  141. extern const char kEnableCrashpad[] = "enable-crashpad";
  142. #endif
  143. #if BUILDFLAG(IS_CHROMEOS)
  144. // Override the default scheduling boosting value for urgent tasks.
  145. // This can be adjusted if a specific chromeos device shows better perf/power
  146. // ratio (e.g. by running video conference tests).
  147. // Currently, this values directs to linux scheduler's utilization min clamp.
  148. // Range is 0(no biased load) ~ 100(mamximum load value).
  149. const char kSchedulerBoostUrgent[] = "scheduler-boost-urgent";
  150. #endif
  151. } // namespace switches