1 // Copyright 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 "content/public/common/content_switches.h" 6 7 #include "build/build_config.h" 8 #include "media/media_buildflags.h" 9 10 namespace switches { 11 12 // Allows processing of input before a frame has been committed. 13 // TODO(schenney): crbug.com/987626. Used by headless. Look for a way not 14 // involving a command line switch. 15 const char kAllowPreCommitInput[] = "allow-pre-commit-input"; 16 17 // By default, file:// URIs cannot read other file:// URIs. This is an 18 // override for developers who need the old behavior for testing. 19 const char kAllowFileAccessFromFiles[] = "allow-file-access-from-files"; 20 21 // Enables TLS/SSL errors on localhost to be ignored (no interstitial, 22 // no blocking of requests). 23 const char kAllowInsecureLocalhost[] = "allow-insecure-localhost"; 24 25 // Allows loopback interface to be added in network list for peer connection. 26 const char kAllowLoopbackInPeerConnection[] = 27 "allow-loopback-in-peer-connection"; 28 29 // Allow a page to send synchronus XHR during its unloading. 30 // TODO(https://crbug.com/1003101): Remove this in Chrome 88. 31 const char kAllowSyncXHRInPageDismissal[] = "allow-sync-xhr-in-page-dimissal"; 32 33 // Uses the android SkFontManager on linux. The specified directory should 34 // include the configuration xml file with the name "fonts.xml". 35 // This is used in blimp to emulate android fonts on linux. 36 const char kAndroidFontsPath[] = "android-fonts-path"; 37 38 // Allows app cache to be forced on, even when gated by an origin trial. 39 // TODO(enne): remove this once app cache has been removed. 40 const char kAppCacheForceEnabled[] = "app-cache-force-enabled"; 41 42 // Causes the browser process to crash on startup. 43 const char kBrowserCrashTest[] = "crash-test"; 44 45 // Causes the browser process to display a dialog on launch. 46 const char kBrowserStartupDialog[] = "browser-startup-dialog"; 47 48 // Path to the exe to run for the renderer and plugin subprocesses. 49 const char kBrowserSubprocessPath[] = "browser-subprocess-path"; 50 51 // Tells whether the code is running browser tests (this changes the startup URL 52 // used by the content shell and also disables features that can make tests 53 // flaky [like monitoring of memory pressure]). 54 const char kBrowserTest[] = "browser-test"; 55 56 // Causes the Conversion Measurement API to run without delays or noise. 57 const char kConversionsDebugMode[] = "conversions-debug-mode"; 58 59 // Disable antialiasing on 2d canvas. 60 const char kDisable2dCanvasAntialiasing[] = "disable-canvas-aa"; 61 62 // Disables Canvas2D rendering into a scanout buffer for overlay support. 63 const char kDisable2dCanvasImageChromium[] = "disable-2d-canvas-image-chromium"; 64 65 // Disables client-visible 3D APIs, in particular WebGL and Pepper 3D. 66 // This is controlled by policy and is kept separate from the other 67 // enable/disable switches to avoid accidentally regressing the policy 68 // support for controlling access to these APIs. 69 const char kDisable3DAPIs[] = "disable-3d-apis"; 70 71 // Disable gpu-accelerated 2d canvas. 72 const char kDisableAccelerated2dCanvas[] = "disable-accelerated-2d-canvas"; 73 74 // Enable in-progress canvas 2d API features. 75 const char kEnableNewCanvas2DAPI[] = "new-canvas-2d-api"; 76 77 // Disables hardware acceleration of video encode, where available. 78 const char kDisableAcceleratedVideoEncode[] = 79 "disable-accelerated-video-encode"; 80 81 // Disable limits on the number of backing stores. Can prevent blinking for 82 // users with many windows/tabs and lots of memory. 83 const char kDisableBackingStoreLimit[] = "disable-backing-store-limit"; 84 85 // Disable backgrounding renders for occluded windows. Done for tests to avoid 86 // nondeterministic behavior. 87 const char kDisableBackgroundingOccludedWindowsForTesting[] = 88 "disable-backgrounding-occluded-windows"; 89 90 // Disable task throttling of timer tasks from background pages. 91 const char kDisableBackgroundTimerThrottling[] = 92 "disable-background-timer-throttling"; 93 94 // Disables the BackForwardCache feature. 95 const char kDisableBackForwardCache[] = "disable-back-forward-cache"; 96 97 // Disable one or more Blink runtime-enabled features. 98 // Use names from runtime_enabled_features.json5, separated by commas. 99 // Applied after kEnableBlinkFeatures, and after other flags that change these 100 // features. 101 const char kDisableBlinkFeatures[] = "disable-blink-features"; 102 103 // Disables HTML5 DB support. 104 const char kDisableDatabases[] = "disable-databases"; 105 106 // Disable the per-domain blocking for 3D APIs after GPU reset. 107 // This switch is intended only for tests. 108 const char kDisableDomainBlockingFor3DAPIs[] = 109 "disable-domain-blocking-for-3d-apis"; 110 111 // Disables the in-process stack traces. 112 const char kDisableInProcessStackTraces[] = "disable-in-process-stack-traces"; 113 114 // Disable all versions of WebGL. 115 const char kDisableWebGL[] = "disable-webgl"; 116 117 // Disable WebGL2. 118 const char kDisableWebGL2[] = "disable-webgl2"; 119 120 // Disable FileSystem API. 121 const char kDisableFileSystem[] = "disable-file-system"; 122 123 // Disable 3D inside of flapper. 124 const char kDisableFlash3d[] = "disable-flash-3d"; 125 126 // Disable Stage3D inside of flapper. 127 const char kDisableFlashStage3d[] = "disable-flash-stage3d"; 128 129 // Disable user gesture requirement for presentation. 130 const char kDisableGestureRequirementForPresentation[] = 131 "disable-gesture-requirement-for-presentation"; 132 133 // Disables GPU hardware acceleration. If software renderer is not in place, 134 // then the GPU process won't launch. 135 const char kDisableGpu[] = "disable-gpu"; 136 137 // Prevent the compositor from using its GPU implementation. 138 const char kDisableGpuCompositing[] = "disable-gpu-compositing"; 139 140 // Disable proactive early init of GPU process. 141 const char kDisableGpuEarlyInit[] = "disable-gpu-early-init"; 142 143 // Do not force that all compositor resources be backed by GPU memory buffers. 144 const char kDisableGpuMemoryBufferCompositorResources[] = 145 "disable-gpu-memory-buffer-compositor-resources"; 146 147 // Disable GpuMemoryBuffer backed VideoFrames. 148 const char kDisableGpuMemoryBufferVideoFrames[] = 149 "disable-gpu-memory-buffer-video-frames"; 150 151 // For tests, to disable the limit on the number of times the GPU process may be 152 // restarted. 153 const char kDisableGpuProcessCrashLimit[] = "disable-gpu-process-crash-limit"; 154 155 // For tests, to disable falling back to software compositing if the GPU Process 156 // has crashed, and reached the GPU Process crash limit. 157 const char kDisableSoftwareCompositingFallback[] = 158 "disable-software-compositing-fallback"; 159 160 // Disable the thread that crashes the GPU process if it stops responding to 161 // messages. 162 const char kDisableGpuWatchdog[] = "disable-gpu-watchdog"; 163 164 // Disables the IPC flooding protection. 165 // It is activated by default. Some javascript functions can be used to flood 166 // the browser process with IPC. This protection limits the rate at which they 167 // can be used. 168 const char kDisableIpcFloodingProtection[] = "disable-ipc-flooding-protection"; 169 170 // Suppresses hang monitor dialogs in renderer processes. This may allow slow 171 // unload handlers on a page to prevent the tab from closing, but the Task 172 // Manager can be used to terminate the offending process in this case. 173 const char kDisableHangMonitor[] = "disable-hang-monitor"; 174 175 // Disable the RenderThread's HistogramCustomizer. 176 const char kDisableHistogramCustomizer[] = "disable-histogram-customizer"; 177 178 // Don't kill a child process when it sends a bad IPC message. Apart 179 // from testing, it is a bad idea from a security perspective to enable 180 // this switch. 181 const char kDisableKillAfterBadIPC[] = "disable-kill-after-bad-ipc"; 182 183 // Disables LCD text. 184 const char kDisableLCDText[] = "disable-lcd-text"; 185 186 // Disable LocalStorage. 187 const char kDisableLocalStorage[] = "disable-local-storage"; 188 189 // Force logging to be disabled. Logging is enabled by default in debug 190 // builds. 191 const char kDisableLogging[] = "disable-logging"; 192 193 // Disables using CODECAPI_AVLowLatencyMode when creating DXVA decoders. 194 const char kDisableLowLatencyDxva[] = "disable-low-latency-dxva"; 195 196 // Disables clearing the rendering output of a renderer when it didn't commit 197 // new output for a while after a top-frame navigation. 198 const char kDisableNewContentRenderingTimeout[] = 199 "disable-new-content-rendering-timeout"; 200 201 // Disables the Web Notification and the Push APIs. 202 const char kDisableNotifications[] = "disable-notifications"; 203 204 // Disable Pepper3D. 205 const char kDisablePepper3d[] = "disable-pepper-3d"; 206 207 // Disables the Permissions API. 208 const char kDisablePermissionsAPI[] = "disable-permissions-api"; 209 210 // Disable Image Chromium for Pepper 3d. 211 const char kDisablePepper3DImageChromium[] = "disable-pepper-3d-image-chromium"; 212 213 // Disables compositor-accelerated touch-screen pinch gestures. 214 const char kDisablePinch[] = "disable-pinch"; 215 216 // Disables the Presentation API. 217 const char kDisablePresentationAPI[] = "disable-presentation-api"; 218 219 // Disables throttling of history.pushState/replaceState calls. 220 const char kDisablePushStateThrottle[] = "disable-pushstate-throttle"; 221 222 // Taints all <canvas> elements, regardless of origin. 223 const char kDisableReadingFromCanvas[] = "disable-reading-from-canvas"; 224 225 // Disables remote web font support. SVG font should always work whether this 226 // option is specified or not. 227 const char kDisableRemoteFonts[] = "disable-remote-fonts"; 228 229 // Disables the RemotePlayback API. 230 const char kDisableRemotePlaybackAPI[] = "disable-remote-playback-api"; 231 232 // Turns off the accessibility in the renderer. 233 const char kDisableRendererAccessibility[] = "disable-renderer-accessibility"; 234 235 // Prevent renderer process backgrounding when set. 236 const char kDisableRendererBackgrounding[] = "disable-renderer-backgrounding"; 237 238 // Whether the ResourceScheduler is disabled. Note this is only useful for C++ 239 // Headless embedders who need to implement their own resource scheduling. 240 const char kDisableResourceScheduler[] = "disable-resource-scheduler"; 241 242 // Disable shared workers. 243 const char kDisableSharedWorkers[] = "disable-shared-workers"; 244 245 // Do not use runtime-detected high-end CPU optimizations in Skia. This is 246 // useful for forcing a baseline code path for e.g. web tests. 247 const char kDisableSkiaRuntimeOpts[] = "disable-skia-runtime-opts"; 248 249 // Disable smooth scrolling for testing. 250 const char kDisableSmoothScrolling[] = "disable-smooth-scrolling"; 251 252 // Disables the use of a 3D software rasterizer. 253 const char kDisableSoftwareRasterizer[] = "disable-software-rasterizer"; 254 255 // Disables the Web Speech API (both speech recognition and synthesis). 256 const char kDisableSpeechAPI[] = "disable-speech-api"; 257 258 // Disables the speech synthesis part of Web Speech API. 259 const char kDisableSpeechSynthesisAPI[] = "disable-speech-synthesis-api"; 260 261 // Used to communicate managed policy for the TargetBlankImpliesNoOpenerDisable 262 // behavioral change. 263 extern const char kDisableTargetBlankImpliesNoOpener[] = 264 "target-blank-implies-no-opener-disable"; 265 266 // Disables adding the test certs in the network process. 267 const char kDisableTestCerts[] = "disable-test-root-certs"; 268 269 // Disable multithreaded GPU compositing of web content. 270 const char kDisableThreadedCompositing[] = "disable-threaded-compositing"; 271 272 // Disable V8 idle tasks. 273 const char kDisableV8IdleTasks[] = "disable-v8-idle-tasks"; 274 275 // Disables WebGL rendering into a scanout buffer for overlay support. 276 const char kDisableWebGLImageChromium[] = "disable-webgl-image-chromium"; 277 278 // Don't enforce the same-origin policy. (Used by people testing their sites.) 279 const char kDisableWebSecurity[] = "disable-web-security"; 280 281 // Disable the video decoder from drawing directly to a texture. 282 const char kDisableZeroCopyDxgiVideo[] = "disable-zero-copy-dxgi-video"; 283 284 // Specifies if the |DOMAutomationController| needs to be bound in the 285 // renderer. This binding happens on per-frame basis and hence can potentially 286 // be a performance bottleneck. One should only enable it when automating dom 287 // based tests. 288 const char kDomAutomationController[] = "dom-automation"; 289 290 // Disable antialiasing on 2d canvas clips 291 const char kDisable2dCanvasClipAntialiasing[] = "disable-2d-canvas-clip-aa"; 292 293 // Disable YUV image decoding for those formats and cases where it's supported. 294 // Has no effect unless GPU rasterization is enabled. 295 const char kDisableYUVImageDecoding[] = "disable-yuv-image-decoding"; 296 297 // Logs Runtime Call Stats for Blink. --single-process also needs to be 298 // used along with this for the stats to be logged. 299 const char kDumpBlinkRuntimeCallStats[] = "dump-blink-runtime-call-stats"; 300 301 // Enables LCD text. 302 const char kEnableLCDText[] = "enable-lcd-text"; 303 304 // Enable one or more Blink runtime-enabled features. 305 // Use names from runtime_enabled_features.json5, separated by commas. 306 // Applied before kDisableBlinkFeatures, and after other flags that change these 307 // features. 308 const char kEnableBlinkFeatures[] = "enable-blink-features"; 309 310 // Enable native caret browsing, in which a moveable cursor is placed on a web 311 // page, allowing a user to select and navigate through non-editable text using 312 // just a keyboard. See https://crbug.com/977390 for links to i2i. 313 const char kEnableCaretBrowsing[] = "enable-caret-browsing"; 314 315 // Flag that turns on a group of experimental/newly added cookie-related 316 // features together, as a convenience for e.g. testing, to avoid having to set 317 // multiple switches individually which may be error-prone (not to mention 318 // tedious). There is not a corresponding switch to disable all these features, 319 // because that is discouraged, and for testing purposes you'd need to switch 320 // them off individually to identify the problematic feature anyway. 321 // 322 // At present this turns on: 323 // net::features::kCookiesWithoutSameSiteMustBeSecure 324 // net::features::kSameSiteByDefaultCookies 325 // net::features::kSameSiteDefaultChecksMethodRigorously 326 // It will soon also turn on: 327 // content_settings::kImprovedCookieControls 328 // content_settings::kImprovedCookieControlsForThirdPartyCookieBlocking 329 // net::features::kSchemefulSameSite 330 const char kEnableExperimentalCookieFeatures[] = 331 "enable-experimental-cookie-features"; 332 333 // Enables experimental WebAssembly features. 334 const char kEnableExperimentalWebAssemblyFeatures[] = 335 "enable-experimental-webassembly-features"; 336 337 // Enables Web Platform features that are in development. 338 const char kEnableExperimentalWebPlatformFeatures[] = 339 "enable-experimental-web-platform-features"; 340 341 // Enables blink runtime enabled features with status:"test" or 342 // status:"experimental", which are enabled when running web tests. 343 const char kEnableBlinkTestFeatures[] = "enable-blink-test-features"; 344 345 // Enables support for FTP URLs. See https://crbug.com/333943. 346 const char kEnableFtp[] = "enable-ftp"; 347 348 // Disables all RuntimeEnabledFeatures that can be enabled via OriginTrials. 349 const char kDisableOriginTrialControlledBlinkFeatures[] = 350 "disable-origin-trial-controlled-blink-features"; 351 352 // Enable GpuMemoryBuffer backed VideoFrames. 353 const char kEnableGpuMemoryBufferVideoFrames[] = 354 "enable-gpu-memory-buffer-video-frames"; 355 356 // Force logging to be enabled. Logging is disabled by default in release 357 // builds. 358 const char kEnableLogging[] = "enable-logging"; 359 360 // Enables the type, downlinkMax attributes of the NetInfo API. Also, enables 361 // triggering of change attribute of the NetInfo API when there is a change in 362 // the connection type. 363 const char kEnableNetworkInformationDownlinkMax[] = 364 "enable-network-information-downlink-max"; 365 366 // Disables the video decoder from drawing to an NV12 textures instead of ARGB. 367 const char kDisableNv12DxgiVideo[] = "disable-nv12-dxgi-video"; 368 369 // Enables testing features of the Plugin Placeholder. For internal use only. 370 const char kEnablePluginPlaceholderTesting[] = 371 "enable-plugin-placeholder-testing"; 372 373 // Make the values returned to window.performance.memory more granular and more 374 // up to date in shared worker. Without this flag, the memory information is 375 // still available, but it is bucketized and updated less frequently. This flag 376 // also applys to workers. 377 const char kEnablePreciseMemoryInfo[] = "enable-precise-memory-info"; 378 379 // Set options to cache V8 data. (off, preparse data, or code) 380 const char kV8CacheOptions[] = "v8-cache-options"; 381 382 // If true the ServiceProcessLauncher is used to launch services. This allows 383 // for service binaries to be loaded rather than using the utility process. This 384 // is only useful for tests. 385 const char kEnableServiceBinaryLauncher[] = "enable-service-binary-launcher"; 386 387 // Enables the Skia benchmarking extension. 388 const char kEnableSkiaBenchmarking[] = "enable-skia-benchmarking"; 389 390 // On platforms that support it, enables smooth scroll animation. 391 const char kEnableSmoothScrolling[] = "enable-smooth-scrolling"; 392 393 // Enable spatial navigation 394 const char kEnableSpatialNavigation[] = "enable-spatial-navigation"; 395 396 // Blocks all insecure requests from secure contexts, and prevents the user 397 // from overriding that decision. 398 const char kEnableStrictMixedContentChecking[] = 399 "enable-strict-mixed-content-checking"; 400 401 // Blocks insecure usage of a number of powerful features (device orientation, 402 // for example) that we haven't yet deprecated for the web at large. 403 const char kEnableStrictPowerfulFeatureRestrictions[] = 404 "enable-strict-powerful-feature-restrictions"; 405 406 // Enabled threaded compositing for web tests. 407 const char kEnableThreadedCompositing[] = "enable-threaded-compositing"; 408 409 // Enable tracing during the execution of browser tests. 410 const char kEnableTracing[] = "enable-tracing"; 411 412 // The filename to write the output of the test tracing to. If it is empty 413 // or it ends in a directory separator then an auto-generated filename will be 414 // appended. 415 const char kEnableTracingOutput[] = "enable-tracing-output"; 416 417 // Enable screen capturing support for MediaStream API. 418 const char kEnableUserMediaScreenCapturing[] = 419 "enable-usermedia-screen-capturing"; 420 421 // Enable the mode that uses zooming to implment device scale factor behavior. 422 const char kEnableUseZoomForDSF[] = "enable-use-zoom-for-dsf"; 423 424 // Enables the use of the @viewport CSS rule, which allows 425 // pages to control aspects of their own layout. This also turns on touch-screen 426 // pinch gestures. 427 const char kEnableViewport[] = "enable-viewport"; 428 429 // Enable the Vtune profiler support. 430 const char kEnableVtune[] = "enable-vtune-support"; 431 432 // Enable the WebAuthn Mojo Testing API. This is a way to interact with the 433 // virtual authenticator environment through a mojo interface and is supported 434 // only to run web-platform-tests on content shell. 435 // Removal of this deprecated API is blocked on crbug.com/937369. 436 const char kEnableWebAuthDeprecatedMojoTestingApi[] = 437 "enable-web-auth-deprecated-mojo-testing-api"; 438 439 // Enables WebGL extensions not yet approved by the community. 440 const char kEnableWebGLDraftExtensions[] = "enable-webgl-draft-extensions"; 441 442 // Enables WebGL rendering into a scanout buffer for overlay support. 443 const char kEnableWebGLImageChromium[] = "enable-webgl-image-chromium"; 444 445 // Handle to the shared memory segment containing field trial state that is to 446 // be shared between processes. The argument to this switch is the handle id 447 // (pointer on Windows) as a string, followed by a comma, then the size of the 448 // shared memory segment as a string. 449 const char kFieldTrialHandle[] = "field-trial-handle"; 450 451 // Define an alias root directory which is replaced with the replacement string 452 // in file URLs. The format is "/alias=/replacement", which would turn 453 // file:///alias/some/path.html into file:///replacement/some/path.html. 454 const char kFileUrlPathAlias[] = "file-url-path-alias"; 455 456 // Disables OOP rasterization. Takes precedence over the enable flag. 457 const char kDisableOopRasterization[] = "disable-oop-rasterization"; 458 459 // Turns on out of process raster for the renderer whenever gpu raster 460 // would have been used. Enables the chromium_raster_transport extension. 461 const char kEnableOopRasterization[] = "enable-oop-rasterization"; 462 463 // Forces use of hardware overlay for fullscreen video playback. Useful for 464 // testing the Android overlay fullscreen functionality on other platforms. 465 const char kForceOverlayFullscreenVideo[] = "force-overlay-fullscreen-video"; 466 467 // This forces pages to be loaded as presentation receivers. Useful for testing 468 // behavior specific to presentation receivers. 469 // Spec: https://www.w3.org/TR/presentation-api/#interface-presentationreceiver 470 const char kForcePresentationReceiverForTesting[] = 471 "force-presentation-receiver-for-testing"; 472 473 // Force renderer accessibility to be on instead of enabling it on demand when 474 // a screen reader is detected. The disable-renderer-accessibility switch 475 // overrides this if present. 476 const char kForceRendererAccessibility[] = "force-renderer-accessibility"; 477 478 // For development / testing only. When running content_browsertests, 479 // saves output of failing accessibility tests to their expectations files in 480 // content/test/data/accessibility/, overwriting existing file content. 481 const char kGenerateAccessibilityTestExpectations[] = 482 "generate-accessibility-test-expectations"; 483 484 // Extra command line options for launching the GPU process (normally used 485 // for debugging). Use like renderer-cmd-prefix. 486 const char kGpuLauncher[] = "gpu-launcher"; 487 488 // Makes this process a GPU sub-process. 489 const char kGpuProcess[] = "gpu-process"; 490 491 // Starts the GPU sandbox before creating a GL context. 492 const char kGpuSandboxStartEarly[] = "gpu-sandbox-start-early"; 493 494 // Causes the GPU process to display a dialog on launch. 495 const char kGpuStartupDialog[] = "gpu-startup-dialog"; 496 497 // Start the renderer with an initial virtual time override specified in 498 // seconds since the epoch. 499 const char kInitialVirtualTime[] = "initial-virtual-time"; 500 501 // Run the GPU process as a thread in the browser process. 502 const char kInProcessGPU[] = "in-process-gpu"; 503 504 // Overrides the timeout, in seconds, that a child process waits for a 505 // connection from the browser before killing itself. 506 const char kIPCConnectionTimeout[] = "ipc-connection-timeout"; 507 508 // Require dedicated processes for a set of origins, specified as a 509 // comma-separated list. For example: 510 // --isolate-origins=https://www.foo.com,https://www.bar.com 511 const char kIsolateOrigins[] = "isolate-origins"; 512 513 // Disable latest shipping ECMAScript 6 features. 514 const char kDisableJavaScriptHarmonyShipping[] = 515 "disable-javascript-harmony-shipping"; 516 517 // Enables experimental Harmony (ECMAScript 6) features. 518 const char kJavaScriptHarmony[] = "javascript-harmony"; 519 520 // Enables unsafe fast JS calls between Blink and V8. 521 const char kEnableUnsafeFastJSCalls[] = "enable-unsafe-fast-js-calls"; 522 523 // Specifies the flags passed to JS engine. 524 const char kJavaScriptFlags[] = "js-flags"; 525 526 // Flag to launch tests in the browser process. 527 const char kLaunchAsBrowser[] = "as-browser"; 528 529 // Logs GPU control list decisions when enforcing blacklist rules. 530 const char kLogGpuControlListDecisions[] = "log-gpu-control-list-decisions"; 531 532 // Sets the minimum log level. Valid values are from 0 to 3: 533 // INFO = 0, WARNING = 1, LOG_ERROR = 2, LOG_FATAL = 3. 534 const char kLoggingLevel[] = "log-level"; 535 536 // Overrides the default file name to use for general-purpose logging (does not 537 // affect which events are logged). 538 const char kLogFile[] = "log-file"; 539 540 // Resizes of the main frame are caused by changing between landscape and 541 // portrait mode (i.e. Android) so the page should be rescaled to fit. 542 const char kMainFrameResizesAreOrientationChanges[] = 543 "main-frame-resizes-are-orientation-changes"; 544 545 // Allows user to override maximum number of active WebGL contexts per 546 // renderer process. 547 const char kMaxActiveWebGLContexts[] = "max-active-webgl-contexts"; 548 549 // Sets the maximium decoded image size limitation. 550 const char kMaxDecodedImageSizeMb[] = "max-decoded-image-size-mb"; 551 552 // Indicates the utility process should run with a message loop type of UI. 553 const char kMessageLoopTypeUi[] = "message-loop-type-ui"; 554 555 // Set the default result for MockCertVerifier. This only works in test code. 556 const char kMockCertVerifierDefaultResultForTesting[] = 557 "mock-cert-verifier-default-result-for-testing"; 558 559 // Initializes Mojo Core from a shared library at the specified path, rather 560 // than using the version of Mojo Core embedded within the Content executable. 561 const char kMojoCoreLibraryPath[] = "mojo-core-library-path"; 562 563 // Use a Mojo-based LocalStorage implementation. 564 const char kMojoLocalStorage[] = "mojo-local-storage"; 565 566 // Disables the use of a zygote process for forking child processes. Instead, 567 // child processes will be forked and exec'd directly. Note that --no-sandbox 568 // should also be used together with this flag because the sandbox needs the 569 // zygote to work. 570 const char kNoZygote[] = "no-zygote"; 571 572 // Disables V8 mitigations for executing untrusted code. 573 const char kNoV8UntrustedCodeMitigations[] = "no-v8-untrusted-code-mitigations"; 574 575 // Number of worker threads used to rasterize content. 576 const char kNumRasterThreads[] = "num-raster-threads"; 577 578 // Runs PPAPI (Pepper) plugins in-process. 579 const char kPpapiInProcess[] = "ppapi-in-process"; 580 581 // Specifies a command that should be used to launch the ppapi plugin process. 582 // Useful for running the plugin process through purify or quantify. Ex: 583 // --ppapi-plugin-launcher="path\to\purify /Run=yes" 584 const char kPpapiPluginLauncher[] = "ppapi-plugin-launcher"; 585 586 // Argument to the process type that indicates a PPAPI plugin process type. 587 const char kPpapiPluginProcess[] = "ppapi"; 588 589 // Causes the PPAPI sub process to display a dialog on launch. Be sure to use 590 // --no-sandbox as well or the sandbox won't allow the dialog to display. 591 const char kPpapiStartupDialog[] = "ppapi-startup-dialog"; 592 593 // Enable the "Process Per Site" process model for all domains. This mode 594 // consolidates same-site pages so that they share a single process. 595 // 596 // More details here: 597 // - https://www.chromium.org/developers/design-documents/process-models 598 // - The class comment in site_instance.h, listing the supported process models. 599 // 600 // IMPORTANT: This isn't to be confused with --site-per-process (which is about 601 // isolation, not consolidation). You probably want the other one. 602 const char kProcessPerSite[] = "process-per-site"; 603 604 // Runs each set of script-connected tabs (i.e., a BrowsingInstance) in its own 605 // renderer process. We default to using a renderer process for each 606 // site instance (i.e., group of pages from the same registered domain with 607 // script connections to each other). 608 // TODO(creis): This flag is currently a no-op. We should refactor it to avoid 609 // "unnecessary" process swaps for cross-site navigations but still swap when 610 // needed for security (e.g., isolated origins). 611 const char kProcessPerTab[] = "process-per-tab"; 612 613 // The value of this switch determines whether the process is started as a 614 // renderer or plugin host. If it's empty, it's the browser. 615 const char kProcessType[] = "type"; 616 617 // Uses a specified proxy server, overrides system settings. This switch only 618 // affects HTTP and HTTPS requests. ARC-apps use only HTTP proxy server with the 619 // highest priority. 620 // TODO(yzshen): Move this switch back to chrome/common/chrome_switches.{h,cc}, 621 // once the network service is able to access the corresponding setting via the 622 // pref service. 623 const char kProxyServer[] = "proxy-server"; 624 625 // Enables or disables pull-to-refresh gesture in response to vertical 626 // overscroll. 627 // Set the value to '0' to disable the feature, set to '1' to enable it for both 628 // touchpad and touchscreen, and set to '2' to enable it only for touchscreen. 629 // Defaults to disabled. 630 const char kPullToRefresh[] = "pull-to-refresh"; 631 632 // Register Pepper plugins (see pepper_plugin_list.cc for its format). 633 const char kRegisterPepperPlugins[] = "register-pepper-plugins"; 634 635 // Enables remote debug over stdio pipes [in=3, out=4]. 636 // Optionally, specifies the format for the protocol messages, can be either 637 // "JSON" (the default) or "CBOR". 638 const char kRemoteDebuggingPipe[] = "remote-debugging-pipe"; 639 640 // Enables remote debug over HTTP on the specified port. 641 const char kRemoteDebuggingPort[] = "remote-debugging-port"; 642 643 const char kRendererClientId[] = "renderer-client-id"; 644 645 // The contents of this flag are prepended to the renderer command line. 646 // Useful values might be "valgrind" or "xterm -e gdb --args". 647 const char kRendererCmdPrefix[] = "renderer-cmd-prefix"; 648 649 // Causes the process to run as renderer instead of as browser. 650 const char kRendererProcess[] = "renderer"; 651 652 // Overrides the default/calculated limit to the number of renderer processes. 653 // Very high values for this setting can lead to high memory/resource usage 654 // or instability. 655 const char kRendererProcessLimit[] = "renderer-process-limit"; 656 657 // Causes the renderer process to display a dialog on launch. Passing this flag 658 // also adds sandbox::policy::kNoSandbox on Windows non-official builds, since 659 // that's needed to show a dialog. 660 const char kRendererStartupDialog[] = "renderer-startup-dialog"; 661 662 // Manual tests only run when --run-manual is specified. This allows writing 663 // tests that don't run automatically but are still in the same test binary. 664 // This is useful so that a team that wants to run a few tests doesn't have to 665 // add a new binary that must be compiled on all builds. 666 const char kRunManualTestsFlag[] = "run-manual"; 667 668 // Causes the process to run as a sandbox IPC subprocess. 669 const char kSandboxIPCProcess[] = "sandbox-ipc"; 670 671 // Describes the file descriptors passed to a child process in the following 672 // list format: 673 // 674 // <file_id>:<descriptor_id>,<file_id>:<descriptor_id>,... 675 // 676 // where <file_id> is an ID string from the manifest of the service being 677 // launched and <descriptor_id> is the numeric identifier of the descriptor for 678 // the child process can use to retrieve the file descriptor from the 679 // global descriptor table. 680 const char kSharedFiles[] = "shared-files"; 681 682 // Runs the renderer and plugins in the same process as the browser 683 const char kSingleProcess[] = "single-process"; 684 685 // Enforces a one-site-per-process security policy: 686 // * Each renderer process, for its whole lifetime, is dedicated to rendering 687 // pages for just one site. 688 // * Thus, pages from different sites are never in the same process. 689 // * A renderer process's access rights are restricted based on its site. 690 // * All cross-site navigations force process swaps. 691 // * <iframe>s are rendered out-of-process whenever the src= is cross-site. 692 // 693 // More details here: 694 // - https://www.chromium.org/developers/design-documents/site-isolation 695 // - https://www.chromium.org/developers/design-documents/process-models 696 // - The class comment in site_instance.h, listing the supported process models. 697 // 698 // IMPORTANT: this isn't to be confused with --process-per-site (which is about 699 // process consolidation, not isolation). You probably want this one. 700 const char kSitePerProcess[] = "site-per-process"; 701 702 // Disables site isolation. 703 // 704 // Note that the opt-in (to site-per-process, isolate-origins, etc.) via 705 // enterprise policy and/or cmdline takes precedence over the 706 // kDisableSiteIsolation switch (i.e. the opt-in takes effect despite potential 707 // presence of kDisableSiteIsolation switch). 708 // 709 // Note that for historic reasons the name of the switch misleadingly mentions 710 // "trials", but the switch also disables the default site isolation that ships 711 // on desktop since M67. The name of the switch is preserved for 712 // backcompatibility of chrome://flags. 713 const char kDisableSiteIsolation[] = "disable-site-isolation-trials"; 714 715 // Specifies if the browser should start in fullscreen mode, like if the user 716 // had pressed F11 right after startup. 717 const char kStartFullscreen[] = "start-fullscreen"; 718 719 // Specifies if the |StatsCollectionController| needs to be bound in the 720 // renderer. This binding happens on per-frame basis and hence can potentially 721 // be a performance bottleneck. One should only enable it when running a test 722 // that needs to access the provided statistics. 723 const char kStatsCollectionController[] = 724 "enable-stats-collection-bindings"; 725 726 // Specifies the max number of bytes that should be used by the skia font cache. 727 // If the cache needs to allocate more, skia will purge previous entries. 728 const char kSkiaFontCacheLimitMb[] = "skia-font-cache-limit-mb"; 729 730 // Specifies the max number of bytes that should be used by the skia resource 731 // cache. The previous entries are purged from the cache when the memory useage 732 // exceeds this limit. 733 const char kSkiaResourceCacheLimitMb[] = "skia-resource-cache-limit-mb"; 734 735 // Type of the current test harness ("browser" or "ui"). 736 const char kTestType[] = "test-type"; 737 738 // Enable support for touch event feature detection. 739 const char kTouchEventFeatureDetection[] = "touch-events"; 740 741 // The values the kTouchEventFeatureDetection switch may have, as in 742 // --touch-events=disabled. 743 // auto: enabled at startup when an attached touchscreen is present. 744 const char kTouchEventFeatureDetectionAuto[] = "auto"; 745 // enabled: touch events always enabled. 746 const char kTouchEventFeatureDetectionEnabled[] = "enabled"; 747 // disabled: touch events are disabled. 748 const char kTouchEventFeatureDetectionDisabled[] = "disabled"; 749 750 // Accepts specified file URL of a trustable WebBundle file. This flag 751 // should be used only for testing purpose. 752 const char kTrustableWebBundleFileUrl[] = "trustable-web-bundles-file-url"; 753 754 // Replaces the existing codecs supported in peer connection with a single fake 755 // codec entry that create a fake video encoder and decoder. 756 const char kUseFakeCodecForPeerConnection[] = 757 "use-fake-codec-for-peer-connection"; 758 759 // Bypass the media stream infobar by selecting the default device for media 760 // streams (e.g. WebRTC). Works with --use-fake-device-for-media-stream. 761 const char kUseFakeUIForMediaStream[] = "use-fake-ui-for-media-stream"; 762 763 // Texture target for CHROMIUM_image backed video frame textures. 764 const char kVideoImageTextureTarget[] = "video-image-texture-target"; 765 766 // Set when Chromium should use a mobile user agent. 767 const char kUseMobileUserAgent[] = "use-mobile-user-agent"; 768 769 // Use the MockCertVerifier. This only works in test code. 770 const char kUseMockCertVerifierForTesting[] = 771 "use-mock-cert-verifier-for-testing"; 772 773 // The contents of this flag are prepended to the utility process command line. 774 // Useful values might be "valgrind" or "xterm -e gdb --args". 775 const char kUtilityCmdPrefix[] = "utility-cmd-prefix"; 776 777 // Causes the process to run as a utility subprocess. 778 const char kUtilityProcess[] = "utility"; 779 780 // Causes the utility process to display a dialog on launch. 781 const char kUtilityStartupDialog[] = "utility-startup-dialog"; 782 783 // This switch indicates the type of a utility process. It is not used by Chrome 784 // but is added to the command line for debugging and profiling purposes. 785 const char kUtilitySubType[] = "utility-sub-type"; 786 787 // In debug builds, asserts that the stream of input events is valid. 788 const char kValidateInputEventStream[] = "validate-input-event-stream"; 789 790 // Will add kWaitForDebugger to every child processes. If a value is passed, it 791 // will be used as a filter to determine if the child process should have the 792 // kWaitForDebugger flag passed on or not. 793 const char kWaitForDebuggerChildren[] = "wait-for-debugger-children"; 794 795 // Flag used by WebUI test runners to wait for debugger to be attached. 796 const char kWaitForDebuggerWebUI[] = "wait-for-debugger-webui"; 797 798 // Set the antialiasing method used for webgl. (none, explicit, implicit) 799 const char kWebglAntialiasingMode[] = "webgl-antialiasing-mode"; 800 801 // Set a default sample count for webgl if msaa is enabled. 802 const char kWebglMSAASampleCount[] = "webgl-msaa-sample-count"; 803 804 // The prefix used when starting the zygote process. (i.e. 'gdb --args') 805 const char kZygoteCmdPrefix[] = "zygote-cmd-prefix"; 806 807 // Causes the process to run as a zygote. 808 const char kZygoteProcess[] = "zygote"; 809 810 // Enables specified backend for the Web OTP API. 811 const char kWebOtpBackend[] = "web-otp-backend"; 812 813 // Enables Sms Verification backend for Web OTP API which requires app hash in 814 // SMS body. 815 const char kWebOtpBackendSmsVerification[] = "web-otp-backend-sms-verification"; 816 817 // Enables User Consent backend for Web OTP API. 818 const char kWebOtpBackendUserConsent[] = "web-otp-backend-user-consent"; 819 820 // Enables auto backend selection for Web OTP API. 821 const char kWebOtpBackendAuto[] = "web-otp-backend-auto"; 822 823 // Disables encryption of RTP Media for WebRTC. When Chrome embeds Content, it 824 // ignores this switch on its stable and beta channels. 825 const char kDisableWebRtcEncryption[] = "disable-webrtc-encryption"; 826 827 // Disables HW decode acceleration for WebRTC. 828 const char kDisableWebRtcHWDecoding[] = "disable-webrtc-hw-decoding"; 829 830 // Disables HW encode acceleration for WebRTC. 831 const char kDisableWebRtcHWEncoding[] = "disable-webrtc-hw-encoding"; 832 833 // Enables negotiation of GCM cipher suites from RFC 7714 for SRTP in WebRTC. 834 // See https://tools.ietf.org/html/rfc7714 for further information. 835 const char kEnableWebRtcSrtpAesGcm[] = "enable-webrtc-srtp-aes-gcm"; 836 837 // Enables negotiation of encrypted header extensions from RFC 6904 for SRTP 838 // in WebRTC. 839 // See https://tools.ietf.org/html/rfc6904 for further information. 840 // TODO(https://crbug.com/954201): Remove this. 841 const char kEnableWebRtcSrtpEncryptedHeaders[] = 842 "enable-webrtc-srtp-encrypted-headers"; 843 844 // Enables Origin header in Stun messages for WebRTC. 845 const char kEnableWebRtcStunOrigin[] = "enable-webrtc-stun-origin"; 846 847 // Enforce IP Permission check. TODO(guoweis): Remove this once the feature is 848 // not under finch and becomes the default. 849 const char kEnforceWebRtcIPPermissionCheck[] = 850 "enforce-webrtc-ip-permission-check"; 851 852 // Override WebRTC IP handling policy to mimic the behavior when WebRTC IP 853 // handling policy is specified in Preferences. 854 const char kForceWebRtcIPHandlingPolicy[] = "force-webrtc-ip-handling-policy"; 855 856 // Override the maximum framerate as can be specified in calls to getUserMedia. 857 // This flag expects a value. Example: --max-gum-fps=17.5 858 const char kWebRtcMaxCaptureFramerate[] = "max-gum-fps"; 859 860 // Configure the maximum CPU time percentage of a single core that can be 861 // consumed for desktop capturing. Default is 50. Set 100 to disable the 862 // throttling of the capture. 863 const char kWebRtcMaxCpuConsumptionPercentage[] = 864 "webrtc-max-cpu-consumption-percentage"; 865 866 // Renderer process parameter for WebRTC Stun probe trial to determine the 867 // interval. Please see SetupStunProbeTrial in 868 // chrome_browser_field_trials_desktop.cc for more detail. 869 const char kWebRtcStunProbeTrialParameter[] = "webrtc-stun-probe-trial"; 870 871 // Enable capture and local storage of WebRTC event logs without visiting 872 // chrome://webrtc-internals. This is useful for automated testing. It accepts 873 // the path to which the local logs would be stored. Disabling is not possible 874 // without restarting the browser and relaunching without this flag. 875 const char kWebRtcLocalEventLogging[] = "webrtc-event-logging"; 876 877 // This switch disables the ScrollToTextFragment feature. 878 const char kDisableScrollToTextFragment[] = "disable-scroll-to-text-fragment"; 879 880 // Forcibly enable and select the specified runtime for webxr. 881 // Note that this provides an alternative means of enabling a runtime, and will 882 // also functionally disable all other runtimes. 883 const char kWebXrForceRuntime[] = "force-webxr-runtime"; 884 885 // Tell WebXr to assume that it does not support any runtimes. 886 const char kWebXrRuntimeNone[] = "no-vr-runtime"; 887 888 const char kWebXrRuntimeOrientationSensors[] = "orientation-sensors"; 889 890 // The following are the runtimes that WebXr supports. 891 const char kWebXrRuntimeOpenXr[] = "openxr"; 892 const char kWebXrRuntimeWMR[] = "windows-mixed-reality"; 893 894 // Disables hardware acceleration of video decode, where available. 895 const char kDisableAcceleratedVideoDecode[] = 896 "disable-accelerated-video-decode"; 897 898 #if (defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)) || defined(OS_BSD) 899 // Enables hardware acceleration of video decoding on linux. (defaults to off) 900 const char kEnableAcceleratedVideoDecode[] = "enable-accelerated-video-decode"; 901 #endif 902 903 #if defined(OS_ANDROID) 904 // Disable Media Session API 905 const char kDisableMediaSessionAPI[] = "disable-media-session-api"; 906 907 // Disable overscroll edge effects like those found in Android views. 908 const char kDisableOverscrollEdgeEffect[] = "disable-overscroll-edge-effect"; 909 910 // Disable the pull-to-refresh effect when vertically overscrolling content. 911 const char kDisablePullToRefreshEffect[] = "disable-pull-to-refresh-effect"; 912 913 // Disable the locking feature of the screen orientation API. 914 const char kDisableScreenOrientationLock[] = "disable-screen-orientation-lock"; 915 916 // Just like kDisableSiteIsolation, but doesn't show the "stability and security 917 // will suffer" butter bar warning. 918 const char kDisableSiteIsolationForPolicy[] = 919 "disable-site-isolation-for-policy"; 920 921 // Disable timeouts that may cause the browser to die when running slowly. This 922 // is useful if running with profiling (such as debug malloc). 923 const char kDisableTimeoutsForProfiling[] = "disable-timeouts-for-profiling"; 924 925 // Enable inverting of selection handles so that they are not clipped by the 926 // viewport boundaries. 927 const char kEnableAdaptiveSelectionHandleOrientation[] = 928 "enable-adaptive-selection-handle-orientation"; 929 930 // Enable drag manipulation of longpress-triggered text selections. 931 const char kEnableLongpressDragSelection[] = "enable-longpress-drag-selection"; 932 933 // Prevent the offline indicator from showing. 934 const char kForceOnlineConnectionStateForIndicator[] = 935 "force-online-connection-state-for-indicator"; 936 937 // The telephony region (ISO country code) to use in phone number detection. 938 const char kNetworkCountryIso[] = "network-country-iso"; 939 940 // Enables remote debug over HTTP on the specified socket name. 941 const char kRemoteDebuggingSocketName[] = "remote-debugging-socket-name"; 942 943 // Block ChildProcessMain thread of the renderer's ChildProcessService until a 944 // Java debugger is attached. 945 const char kRendererWaitForJavaDebugger[] = "renderer-wait-for-java-debugger"; 946 947 // Disables debug crash dumps for OOPR. 948 const char kDisableOoprDebugCrashDump[] = "disable-oopr-debug-crash-dump"; 949 #endif 950 951 // Enable the experimental Accessibility Object Model APIs in development. 952 const char kEnableAccessibilityObjectModel[] = 953 "enable-accessibility-object-model"; 954 955 // Enable the aggressive flushing of DOM Storage to minimize data loss. 956 const char kEnableAggressiveDOMStorageFlushing[] = 957 "enable-aggressive-domstorage-flushing"; 958 959 // Enable indication that browser is controlled by automation. 960 const char kEnableAutomation[] = "enable-automation"; 961 962 #if (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || (defined(OS_FREEBSD) || \ 963 defined(OS_DRAGONFLY)) 964 // Allows sending text-to-speech requests to speech-dispatcher, a common 965 // Linux speech service. Because it's buggy, the user must explicitly 966 // enable it so that visiting a random webpage can't cause instability. 967 const char kEnableSpeechDispatcher[] = "enable-speech-dispatcher"; 968 #endif 969 970 #if defined(OS_WIN) 971 // /prefetch:# arguments to use when launching various process types. It has 972 // been observed that when file reads are consistent for 3 process launches with 973 // the same /prefetch:# argument, the Windows prefetcher starts issuing reads in 974 // batch at process launch. Because reads depend on the process type, the 975 // prefetcher wouldn't be able to observe consistent reads if no /prefetch:# 976 // arguments were used. Note that the browser process has no /prefetch:# 977 // argument; as such all other processes must have one in order to avoid 978 // polluting its profile. Note: # must always be in [1, 8]; otherwise it is 979 // ignored by the Windows prefetcher. 980 const char kPrefetchArgumentRenderer[] = "/prefetch:1"; 981 const char kPrefetchArgumentGpu[] = "/prefetch:2"; 982 const char kPrefetchArgumentPpapi[] = "/prefetch:3"; 983 const char kPrefetchArgumentPpapiBroker[] = "/prefetch:4"; 984 // /prefetch:5, /prefetch:6 and /prefetch:7 are reserved for content embedders 985 // and are not to be used by content itself. 986 987 // /prefetch:# argument shared by all process types that don't have their own. 988 // It is likely that the prefetcher won't work for these process types as it 989 // won't be able to observe consistent file reads across launches. However, 990 // having a valid prefetch argument for these process types is required to 991 // prevent them from interfering with the prefetch profile of the browser 992 // process. 993 const char kPrefetchArgumentOther[] = "/prefetch:8"; 994 995 // Device scale factor passed to certain processes like renderers, etc. 996 const char kDeviceScaleFactor[] = "device-scale-factor"; 997 998 // Disable the Legacy Window which corresponds to the size of the WebContents. 999 const char kDisableLegacyIntermediateWindow[] = "disable-legacy-window"; 1000 1001 // Enables H264 HW decode acceleration for WebRtc on Win 7. 1002 const char kEnableWin7WebRtcHWH264Decoding[] = 1003 "enable-win7-webrtc-hw-h264-decoding"; 1004 1005 // DirectWrite FontCache is shared by browser to renderers using shared memory. 1006 // This switch allows us to pass the shared memory handle to the renderer. 1007 const char kFontCacheSharedHandle[] = "font-cache-shared-handle"; 1008 1009 // The boolean value (0/1) of FontRenderParams::antialiasing to be passed to 1010 // Ppapi processes. 1011 const char kPpapiAntialiasedTextEnabled[] = "ppapi-antialiased-text-enabled"; 1012 1013 // The enum value of FontRenderParams::subpixel_rendering to be passed to Ppapi 1014 // processes. 1015 const char kPpapiSubpixelRenderingSetting[] = 1016 "ppapi-subpixel-rendering-setting"; 1017 1018 // Raise the timer interrupt frequency in all Chrome processes, for experimental 1019 // purposes. This feature is needed because as of Windows 10 2004 the scheduling 1020 // effects of changing the timer interrupt frequency are not global, and this 1021 // lets us prove/disprove whether this matters. See https://crbug.com/1128917 1022 const char kRaiseTimerFrequency[] = "raise-timer-frequency"; 1023 1024 // Causes the second GPU process used for gpu info collection to display a 1025 // dialog on launch. 1026 const char kGpu2StartupDialog[] = "gpu2-startup-dialog"; 1027 #endif 1028 1029 #if defined(ENABLE_IPC_FUZZER) 1030 // Dumps IPC messages sent from renderer processes to the browser process to 1031 // the given directory. Used primarily to gather samples for IPC fuzzing. 1032 const char kIpcDumpDirectory[] = "ipc-dump-directory"; 1033 1034 // Specifies the testcase used by the IPC fuzzer. 1035 const char kIpcFuzzerTestcase[] = "ipc-fuzzer-testcase"; 1036 #endif 1037 1038 // Don't dump stuff here, follow the same order as the header. 1039 1040 } // namespace switches 1041