content_switches.cc revision f8ee788a64d60abd8f2d742a5fdedde054ecd910
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 "content/public/common/content_switches.h"
6
7#include "base/command_line.h"
8
9namespace switches {
10
11// The number of MSAA samples for canvas2D. Requires MSAA support by GPU to
12// have an effect. 0 disables MSAA.
13const char kAcceleratedCanvas2dMSAASampleCount[] = "canvas-msaa-sample-count";
14
15// By default, file:// URIs cannot read other file:// URIs. This is an
16// override for developers who need the old behavior for testing.
17const char kAllowFileAccessFromFiles[]      = "allow-file-access-from-files";
18
19// Allows frames with an https origin to use WebSockets with an insecure URL
20// (ws://).
21const char kAllowInsecureWebSocketFromHttpsOrigin[] =
22    "allow-insecure-websocket-from-https-origin";
23
24// Allows loopback interface to be added in network list for peer connection.
25const char kAllowLoopbackInPeerConnection[] =
26    "allow-loopback-in-peer-connection";
27
28// Enables the sandboxed processes to run without a job object assigned to them.
29// This flag is required to allow Chrome to run in RemoteApps or Citrix. This
30// flag can reduce the security of the sandboxed processes and allow them to do
31// certain API calls like shut down Windows or access the clipboard. Also we
32// lose the chance to kill some processes until the outer job that owns them
33// finishes.
34const char kAllowNoSandboxJob[]             = "allow-no-sandbox-job";
35
36// Allows debugging of sandboxed processes (see zygote_main_linux.cc).
37const char kAllowSandboxDebugging[]         = "allow-sandbox-debugging";
38
39// The same as kAuditHandles except all handles are enumerated.
40const char kAuditAllHandles[]               = "enable-handle-auditing-all";
41
42// Enumerates and prints a child process' most dangerous handles when it
43// is terminated.
44const char kAuditHandles[]                  = "enable-handle-auditing";
45
46// Choose which logging channels in blink platform to activate.  See
47// Logging.cpp in blink's Source/platform for a list of available channels.
48const char kBlinkPlatformLogChannels[]      = "blink-platform-log-channels";
49
50// Block cross-site documents (i.e., HTML/XML/JSON) from being loaded in
51// subresources when a document is not supposed to read them.  This will later
52// allow us to block them from the entire renderer process when site isolation
53// is enabled.
54const char kBlockCrossSiteDocuments[]     = "block-cross-site-documents";
55
56// Causes the browser process to throw an assertion on startup.
57const char kBrowserAssertTest[]             = "assert-test";
58
59// Causes the browser process to crash on startup.
60const char kBrowserCrashTest[]              = "crash-test";
61
62// Path to the exe to run for the renderer and plugin subprocesses.
63const char kBrowserSubprocessPath[]         = "browser-subprocess-path";
64
65// Dumps extra logging about plugin loading to the log file.
66const char kDebugPluginLoading[] = "debug-plugin-loading";
67
68// Sets the tile size used by composited layers.
69const char kDefaultTileWidth[]              = "default-tile-width";
70const char kDefaultTileHeight[]             = "default-tile-height";
71
72// Disable antialiasing on 2d canvas.
73const char kDisable2dCanvasAntialiasing[]   = "disable-canvas-aa";
74
75// Disables client-visible 3D APIs, in particular WebGL and Pepper 3D.
76// This is controlled by policy and is kept separate from the other
77// enable/disable switches to avoid accidentally regressing the policy
78// support for controlling access to these APIs.
79const char kDisable3DAPIs[]                 = "disable-3d-apis";
80
81// Disable gpu-accelerated 2d canvas.
82const char kDisableAccelerated2dCanvas[]    = "disable-accelerated-2d-canvas";
83
84// Disables accelerated compositing for backgrounds of root layers with
85// background-attachment: fixed.
86const char kDisableAcceleratedFixedRootBackground[] =
87    "disable-accelerated-fixed-root-background";
88
89// Disables accelerated compositing for overflow scroll.
90const char kDisableAcceleratedOverflowScroll[] =
91    "disable-accelerated-overflow-scroll";
92
93// Disables layer squashing.
94const char kDisableLayerSquashing[] =
95    "disable-layer-squashing";
96
97// Disables hardware acceleration of video decode, where available.
98const char kDisableAcceleratedVideoDecode[] =
99    "disable-accelerated-video-decode";
100
101// Disable the ApplicationCache.
102const char kDisableApplicationCache[]       = "disable-application-cache";
103
104// Disable limits on the number of backing stores. Can prevent blinking for
105// users with many windows/tabs and lots of memory.
106const char kDisableBackingStoreLimit[]      = "disable-backing-store-limit";
107
108// See comment for kEnableCompositingForFixedPosition.
109const char kDisableCompositingForFixedPosition[] =
110     "disable-fixed-position-compositing";
111
112// See comment for kEnableCompositingForTransition.
113const char kDisableCompositingForTransition[] =
114     "disable-transition-compositing";
115
116// Disables HTML5 DB support.
117const char kDisableDatabases[]              = "disable-databases";
118
119// Disables delegated renderer.
120const char kDisableDelegatedRenderer[]      = "disable-delegated-renderer";
121
122// Disables desktop notifications (default enabled on windows).
123const char kDisableDesktopNotifications[]   = "disable-desktop-notifications";
124
125// Disables experimental navigator content utils implementation.
126const char kDisableNavigatorContentUtils[]  =
127      "disable-navigator-content-utils";
128
129// Handles URL requests by NPAPI plugins through the renderer.
130const char kDisableDirectNPAPIRequests[]    = "disable-direct-npapi-requests";
131
132// Disable the per-domain blocking for 3D APIs after GPU reset.
133// This switch is intended only for tests.
134extern const char kDisableDomainBlockingFor3DAPIs[] =
135    "disable-domain-blocking-for-3d-apis";
136
137// Disable running the SharedWorker inside the renderer process.
138const char kDisableEmbeddedSharedWorker[]    = "disable-embedded-shared-worker";
139
140// Disable experimental WebGL support.
141const char kDisableExperimentalWebGL[]      = "disable-webgl";
142
143// Disable the fast text autosizing implementation.
144const char kDisableFastTextAutosizing[]     = "disable-fast-text-autosizing";
145
146// Disable FileSystem API.
147const char kDisableFileSystem[]             = "disable-file-system";
148
149// Disable 3D inside of flapper.
150const char kDisableFlash3d[]                = "disable-flash-3d";
151
152// Disable Stage3D inside of flapper.
153const char kDisableFlashStage3d[]           = "disable-flash-stage3d";
154
155const char kDisableGestureTapHighlight[]    = "disable-gesture-tap-highlight";
156
157// Disables GPU hardware acceleration.  If software renderer is not in place,
158// then the GPU process won't launch.
159const char kDisableGpu[]                    = "disable-gpu";
160
161// Prevent the compositor from using its GPU implementation.
162const char kDisableGpuCompositing[]         = "disable-gpu-compositing";
163
164// Disable the limit on the number of times the GPU process may be restarted
165// This switch is intended only for tests.
166extern const char kDisableGpuProcessCrashLimit[] =
167    "disable-gpu-process-crash-limit";
168
169// Disable GPU rasterization, i.e. rasterize on the CPU only.
170// Overrides the kEnableGpuRasterization and kForceGpuRasterization flags.
171const char kDisableGpuRasterization[]       = "disable-gpu-rasterization";
172
173// When using CPU rasterizing disable low resolution tiling. This uses
174// less power, particularly during animations, but more white may be seen
175// during fast scrolling especially on slower devices.
176const char kDisableLowResTiling[] = "disable-low-res-tiling";
177
178// Disable the GPU process sandbox.
179const char kDisableGpuSandbox[]             = "disable-gpu-sandbox";
180
181// Disable the thread that crashes the GPU process if it stops responding to
182// messages.
183const char kDisableGpuWatchdog[]            = "disable-gpu-watchdog";
184
185// Suppresses hang monitor dialogs in renderer processes.  This may allow slow
186// unload handlers on a page to prevent the tab from closing, but the Task
187// Manager can be used to terminate the offending process in this case.
188const char kDisableHangMonitor[]            = "disable-hang-monitor";
189
190// Disable the RenderThread's HistogramCustomizer.
191const char kDisableHistogramCustomizer[]    = "disable-histogram-customizer";
192
193// Paint content on the main thread instead of the compositor thread.
194// Overrides the kEnableImplSidePainting flag.
195const char kDisableImplSidePainting[]       = "disable-impl-side-painting";
196
197// Prevent Java from running.
198const char kDisableJava[]                   = "disable-java";
199
200// Don't execute JavaScript (browser JS like the new tab page still runs).
201const char kDisableJavaScript[]             = "disable-javascript";
202
203// Don't kill a child process when it sends a bad IPC message.  Apart
204// from testing, it is a bad idea from a security perspective to enable
205// this switch.
206const char kDisableKillAfterBadIPC[]        = "disable-kill-after-bad-ipc";
207
208// Disables prefixed Encrypted Media API (e.g. webkitGenerateKeyRequest()).
209const char kDisablePrefixedEncryptedMedia[] =
210    "disable-prefixed-encrypted-media";
211
212// Disables LCD text.
213const char kDisableLCDText[]                = "disable-lcd-text";
214
215// Disables distance field text.
216const char kDisableDistanceFieldText[]      = "disable-distance-field-text";
217
218// Disable LocalStorage.
219const char kDisableLocalStorage[]           = "disable-local-storage";
220
221// Force logging to be disabled.  Logging is enabled by default in debug
222// builds.
223const char kDisableLogging[]                = "disable-logging";
224
225// Disables Media Source API (i.e., the MediaSource object).
226const char kDisableMediaSource[]            = "disable-media-source";
227
228// Disable Pepper3D.
229const char kDisablePepper3d[]               = "disable-pepper-3d";
230
231// Disables compositor-accelerated touch-screen pinch gestures.
232const char kDisablePinch[]                  = "disable-pinch";
233
234// Prevent plugins from running.
235const char kDisablePlugins[]                = "disable-plugins";
236
237// Disable discovering third-party plug-ins. Effectively loading only
238// ones shipped with the browser plus third-party ones as specified by
239// --extra-plugin-dir and --load-plugin switches.
240const char kDisablePluginsDiscovery[]       = "disable-plugins-discovery";
241
242// Disables remote web font support. SVG font should always work whether this
243// option is specified or not.
244const char kDisableRemoteFonts[]            = "disable-remote-fonts";
245
246// Turns off the accessibility in the renderer.
247const char kDisableRendererAccessibility[]  = "disable-renderer-accessibility";
248
249// Disables the new layout/paint system which paints after layout is complete.
250const char kDisableRepaintAfterLayout[]     = "disable-repaint-after-layout";
251
252// Disable the seccomp filter sandbox (seccomp-bpf) (Linux only).
253const char kDisableSeccompFilterSandbox[]   = "disable-seccomp-filter-sandbox";
254
255// Disable session storage.
256const char kDisableSessionStorage[]         = "disable-session-storage";
257
258// Disable the setuid sandbox (Linux only).
259const char kDisableSetuidSandbox[]          = "disable-setuid-sandbox";
260
261// Enable shared workers. Functionality not yet complete.
262const char kDisableSharedWorkers[]          = "disable-shared-workers";
263
264// Disables site-specific tailoring to compatibility issues in WebKit.
265const char kDisableSiteSpecificQuirks[]     = "disable-site-specific-quirks";
266
267// Disable smooth scrolling for testing.
268const char kDisableSmoothScrolling[]        = "disable-smooth-scrolling";
269
270// Disables the use of a 3D software rasterizer.
271const char kDisableSoftwareRasterizer[]     = "disable-software-rasterizer";
272
273// Disable False Start in SSL and TLS connections.
274const char kDisableSSLFalseStart[]          = "disable-ssl-false-start";
275
276// Disable multithreaded GPU compositing of web content.
277const char kDisableThreadedCompositing[]     = "disable-threaded-compositing";
278
279// Don't enforce the same-origin policy. (Used by people testing their sites.)
280const char kDisableWebSecurity[]            = "disable-web-security";
281
282// Disables support for XSLT.
283const char kDisableXSLT[]                   = "disable-xslt";
284
285// Disables Blink's XSSAuditor. The XSSAuditor mitigates reflective XSS.
286const char kDisableXSSAuditor[]             = "disable-xss-auditor";
287
288// Disable rasterizer that writes directly to GPU memory associated with tiles.
289// Overrides the kEnableZeroCopy flag.
290const char kDisableZeroCopy[]               = "disable-zero-copy";
291
292// Specifies if the |DOMAutomationController| needs to be bound in the
293// renderer. This binding happens on per-frame basis and hence can potentially
294// be a performance bottleneck. One should only enable it when automating dom
295// based tests.
296const char kDomAutomationController[]       = "dom-automation";
297
298// Enable bleeding-edge code to make Chrome draw content faster. The changes
299// behind this path are very likely to break lots of content.
300// ** DO NOT use this flag unless you know what you are doing. **
301const char kEnableBleedingEdgeRenderingFastPaths[] =
302    "enable-bleeding-edge-rendering-fast-paths";
303
304// Disable deferred image filters.
305const char kDisableDeferredFilters[]         = "disable-deferred-filters";
306
307// Enables accelerated compositing for backgrounds of root layers with
308// background-attachment: fixed.
309const char kEnableAcceleratedFixedRootBackground[] =
310    "enable-accelerated-fixed-root-background";
311
312// Enables accelerated compositing for overflow scroll. Promotes eligible
313// overflow:scroll elements to layers to enable accelerated scrolling for them.
314const char kEnableAcceleratedOverflowScroll[] =
315    "enable-accelerated-overflow-scroll";
316
317// Enables LCD text.
318const char kEnableLCDText[]                 = "enable-lcd-text";
319
320// Enables using signed distance fields when rendering text.
321// Only valid if GPU rasterization is enabled as well.
322const char kEnableDistanceFieldText[]       = "enable-distance-field-text";
323
324// Enables experimental feature that maps multiple RenderLayers to
325// one composited layer to avoid pathological layer counts.
326const char kEnableLayerSquashing[] =
327    "enable-layer-squashing";
328
329// Enable experimental container node culling.
330const char kEnableContainerCulling[]        = "enable-container-culling";
331
332// Use a BeginFrame signal from browser to renderer to schedule rendering.
333const char kEnableBeginFrameScheduling[]    = "enable-begin-frame-scheduling";
334
335// Enable the creation of compositing layers for fixed position
336// elements. Three options are needed to support four possible scenarios:
337//  1. Default (disabled)
338//  2. Enabled always (to allow dogfooding)
339//  3. Disabled always (to give safety fallback for users)
340//  4. Enabled only if we detect a highDPI display
341//
342// Option #4 may soon be the default, because the feature is needed soon for
343// high DPI, but cannot be used (yet) for low DPI. Options #2 and #3 will
344// override Option #4.
345const char kEnableCompositingForFixedPosition[] =
346     "enable-fixed-position-compositing";
347
348// Enable/Disable the creation of compositing layers for RenderLayers with a
349// transition on a property that supports accelerated animation (that is,
350// opacity, -webkit-transform, and -webkit-filter), even when no animation is
351// running. These options allow for three possible scenarios:
352//  1. Default (enabled only if we dectect a highDPI display)
353//  2. Enabled always.
354//  3. Disabled always.
355const char kEnableCompositingForTransition[] =
356     "enable-transition-compositing";
357
358// Defer image decoding in WebKit until painting.
359const char kEnableDeferredImageDecoding[]   = "enable-deferred-image-decoding";
360
361// Enables delegated renderer.
362const char kEnableDelegatedRenderer[]       = "enable-delegated-renderer";
363
364// Enables restarting interrupted downloads.
365const char kEnableDownloadResumption[]      = "enable-download-resumption";
366
367// Enables support for Encrypted Media Extensions (e.g. MediaKeys).
368const char kEnableEncryptedMedia[] = "enable-encrypted-media";
369
370// Enable experimental canvas features, e.g. canvas 2D context attributes
371const char kEnableExperimentalCanvasFeatures[] =
372    "enable-experimental-canvas-features";
373
374// Enables Web Platform features that are in development.
375const char kEnableExperimentalWebPlatformFeatures[] =
376    "enable-experimental-web-platform-features";
377
378// By default, cookies are not allowed on file://. They are needed for testing,
379// for example page cycler and layout tests. See bug 1157243.
380const char kEnableFileCookies[]             = "enable-file-cookies";
381
382// Enable the fast text autosizing implementation.
383const char kEnableFastTextAutosizing[]      = "enable-fast-text-autosizing";
384
385// Enable Gesture Tap Highlight
386const char kEnableGestureTapHighlight[]     = "enable-gesture-tap-highlight";
387
388// Enables TRACE for GL calls in the renderer.
389const char kEnableGpuClientTracing[]        = "enable-gpu-client-tracing";
390
391// Allow heuristics to determine when a layer tile should be drawn with the
392// Skia GPU backend. Only valid with GPU accelerated compositing +
393// impl-side painting.
394const char kEnableGpuRasterization[]        = "enable-gpu-rasterization";
395
396// When using CPU rasterizing generate low resolution tiling. Low res
397// tiles may be displayed during fast scrolls especially on slower devices.
398const char kEnableLowResTiling[] = "enable-low-res-tiling";
399
400// See comment for kEnableCompositingForFixedPosition.
401const char kEnableHighDpiCompositingForFixedPosition[] =
402     "enable-high-dpi-fixed-position-compositing";
403
404// Paint content on the compositor thread instead of the main thread.
405const char kEnableImplSidePainting[]        = "enable-impl-side-painting";
406
407// Enables support for inband text tracks in media content.
408const char kEnableInbandTextTracks[]        = "enable-inband-text-tracks";
409
410// Force logging to be enabled.  Logging is disabled by default in release
411// builds.
412const char kEnableLogging[]                 = "enable-logging";
413
414// Enables the memory benchmarking extension
415const char kEnableMemoryBenchmarking[]      = "enable-memory-benchmarking";
416
417// Enable rasterizer that writes directly to GPU memory.
418const char kEnableOneCopy[]                 = "enable-one-copy";
419
420// Enables use of hardware overlay for fullscreen video playback. Android only.
421const char kEnableOverlayFullscreenVideo[]  = "enable-overlay-fullscreen-video";
422
423// Disables blink subtitle and media control on top of overlay fullscreen video.
424const char kDisableOverlayFullscreenVideoSubtitle[] =
425    "disable-overlay-fullscreen-video-subtitle";
426
427// Forward overscroll event data from the renderer to the browser.
428const char kEnableOverscrollNotifications[] = "enable-overscroll-notifications";
429
430// Enables compositor-accelerated touch-screen pinch gestures.
431const char kEnablePinch[]                   = "enable-pinch";
432
433// Make the values returned to window.performance.memory more granular and more
434// up to date in shared worker. Without this flag, the memory information is
435// still available, but it is bucketized and updated less frequently. This flag
436// also applys to workers.
437const char kEnablePreciseMemoryInfo[] = "enable-precise-memory-info";
438
439// Enable caching of pre-parsed JS script data.  See http://crbug.com/32407.
440const char kEnablePreparsedJsCaching[]      = "enable-preparsed-js-caching";
441
442// Enables the CSS multicol implementation that uses the regions implementation.
443const char kEnableRegionBasedColumns[] =
444    "enable-region-based-columns";
445
446// Enables the new layout/paint system which paints after layout is complete.
447const char kEnableRepaintAfterLayout[] =
448    "enable-repaint-after-layout";
449
450// Enables targeted style recalculation optimizations.
451const char kEnableTargetedStyleRecalc[] =
452    "enable-targeted-style-recalc";
453
454// Cause the OS X sandbox write to syslog every time an access to a resource
455// is denied by the sandbox.
456const char kEnableSandboxLogging[]          = "enable-sandbox-logging";
457
458// Enables seccomp-bpf support for Android. Requires experimental kernel
459// support. <http://crbug.com/166704>
460const char kEnableSeccompFilterSandbox[] =
461    "enable-seccomp-filter-sandbox";
462
463// Enables the Skia benchmarking extension
464const char kEnableSkiaBenchmarking[]        = "enable-skia-benchmarking";
465
466// On platforms that support it, enables smooth scroll animation.
467const char kEnableSmoothScrolling[]         = "enable-smooth-scrolling";
468
469// Enable spatial navigation
470const char kEnableSpatialNavigation[]       = "enable-spatial-navigation";
471
472// Enables the synthesis part of the Web Speech API.
473const char kEnableSpeechSynthesis[]         = "enable-speech-synthesis";
474
475// Enables StatsTable, logging statistics to a global named shared memory table.
476const char kEnableStatsTable[]              = "enable-stats-table";
477
478// Experimentally ensures that each renderer process:
479// 1) Only handles rendering for pages from a single site, apart from iframes.
480// (Note that a page can reference content from multiple origins due to images,
481// JavaScript files, etc.  Cross-site iframes are also loaded in-process.)
482// 2) Only has authority to see or use cookies for the page's top-level origin.
483// (So if a.com iframes b.com, the b.com network request will be sent without
484// cookies.)
485// This is expected to break compatibility with many pages for now.  Unlike the
486// --site-per-process flag, this allows cross-site iframes, but it blocks all
487// cookies on cross-site requests.
488const char kEnableStrictSiteIsolation[]     = "enable-strict-site-isolation";
489
490// Enable support for ServiceWorker. See
491// https://github.com/slightlyoff/ServiceWorker for more information.
492const char kEnableServiceWorker[]           = "enable-service-worker";
493
494// Enable support for sync events in ServiceWorkers.
495const char kEnableServiceWorkerSync[]       = "enable-service-worker-sync";
496
497// Enable use of experimental TCP sockets API for sending data in the
498// SYN packet.
499const char kEnableTcpFastOpen[]             = "enable-tcp-fastopen";
500
501// Enable multithreaded GPU compositing of web content.
502const char kEnableThreadedCompositing[]     = "enable-threaded-compositing";
503
504// Enable screen capturing support for MediaStream API.
505const char kEnableUserMediaScreenCapturing[] =
506    "enable-usermedia-screen-capturing";
507
508// Enables the use of the @viewport CSS rule, which allows
509// pages to control aspects of their own layout. This also turns on touch-screen
510// pinch gestures.
511const char kEnableViewport[]                = "enable-viewport";
512
513// Enables the use of the legacy viewport meta tag. Turning this on also
514// turns on the @viewport CSS rule
515const char kEnableViewportMeta[]            = "enable-viewport-meta";
516
517// Resizes of the main frame are the caused by changing between landscape
518// and portrait mode (i.e. Android) so the page should be rescaled to fit
519const char kMainFrameResizesAreOrientationChanges[] =
520    "main-frame-resizes-are-orientation-changes";
521
522// Enable the Vtune profiler support.
523const char kEnableVtune[]                   = "enable-vtune-support";
524
525// Enable SVG Animations on the Web Animations model.
526const char kEnableWebAnimationsSVG[]        = "enable-web-animations-svg";
527
528// Enables WebGL extensions not yet approved by the community.
529const char kEnableWebGLDraftExtensions[] = "enable-webgl-draft-extensions";
530
531// Enables WebGL rendering into a scanout buffer for overlay support.
532const char kEnableWebGLImageChromium[] = "enable-webgl-image-chromium";
533
534// Enables Web MIDI API.
535const char kEnableWebMIDI[]                 = "enable-web-midi";
536
537// Enable rasterizer that writes directly to GPU memory associated with tiles.
538const char kEnableZeroCopy[]                = "enable-zero-copy";
539
540// Load NPAPI plugins from the specified directory.
541const char kExtraPluginDir[]                = "extra-plugin-dir";
542
543// Some field trials may be randomized in the browser, and the randomly selected
544// outcome needs to be propagated to the renderer. For instance, this is used
545// to modify histograms recorded in the renderer, or to get the renderer to
546// also set of its state (initialize, or not initialize components) to match the
547// experiment(s). The option is also useful for forcing field trials when
548// testing changes locally. The argument is a list of name and value pairs,
549// separated by slashes. See FieldTrialList::CreateTrialsFromString() in
550// field_trial.h for details.
551const char kForceFieldTrials[]              = "force-fieldtrials";
552
553// Always use the Skia GPU backend for drawing layer tiles. Only valid with GPU
554// accelerated compositing + impl-side painting. Overrides the
555// kEnableGpuRasterization flag.
556const char kForceGpuRasterization[]        = "force-gpu-rasterization";
557
558// Force renderer accessibility to be on instead of enabling it on demand when
559// a screen reader is detected. The disable-renderer-accessibility switch
560// overrides this if present.
561const char kForceRendererAccessibility[]    = "force-renderer-accessibility";
562
563// Passes gpu device_id from browser process to GPU process.
564const char kGpuDeviceID[]                   = "gpu-device-id";
565
566// Passes gpu driver_vendor from browser process to GPU process.
567const char kGpuDriverVendor[]               = "gpu-driver-vendor";
568
569// Passes gpu driver_version from browser process to GPU process.
570const char kGpuDriverVersion[]              = "gpu-driver-version";
571
572// Extra command line options for launching the GPU process (normally used
573// for debugging). Use like renderer-cmd-prefix.
574const char kGpuLauncher[]                   = "gpu-launcher";
575
576// Makes this process a GPU sub-process.
577const char kGpuProcess[]                    = "gpu-process";
578
579// Allow shmat system call in GPU sandbox.
580const char kGpuSandboxAllowSysVShm[]        = "gpu-sandbox-allow-sysv-shm";
581
582// Makes GPU sandbox failures fatal.
583const char kGpuSandboxFailuresFatal[]       = "gpu-sandbox-failures-fatal";
584
585// Allow GPU sandbox to start later
586const char kGpuSandboxStartAfterInitialization[] =
587    "gpu-sandbox-start-after-initialization";
588
589// Causes the GPU process to display a dialog on launch.
590const char kGpuStartupDialog[]              = "gpu-startup-dialog";
591
592// Passes gpu vendor_id from browser process to GPU process.
593const char kGpuVendorID[]                   = "gpu-vendor-id";
594
595// These mappings only apply to the host resolver.
596const char kHostResolverRules[]             = "host-resolver-rules";
597
598// Ignores certificate-related errors.
599const char kIgnoreCertificateErrors[]       = "ignore-certificate-errors";
600
601// Ignores GPU blacklist.
602const char kIgnoreGpuBlacklist[]            = "ignore-gpu-blacklist";
603
604// Run the GPU process as a thread in the browser process.
605const char kInProcessGPU[]                  = "in-process-gpu";
606
607// Specifies the flags passed to JS engine
608const char kJavaScriptFlags[]               = "js-flags";
609
610// Load an NPAPI plugin from the specified path.
611const char kLoadPlugin[]                    = "load-plugin";
612
613// Logs GPU control list decisions when enforcing blacklist rules.
614const char kLogGpuControlListDecisions[]    = "log-gpu-control-list-decisions";
615
616// Sets the minimum log level. Valid values are from 0 to 3:
617// INFO = 0, WARNING = 1, LOG_ERROR = 2, LOG_FATAL = 3.
618const char kLoggingLevel[]                  = "log-level";
619
620// Enables saving net log events to a file and sets the file name to use.
621const char kLogNetLog[]                     = "log-net-log";
622
623// Make plugin processes log their sent and received messages to VLOG(1).
624const char kLogPluginMessages[]             = "log-plugin-messages";
625
626// Sets the width and height above which a composited layer will get tiled.
627const char kMaxUntiledLayerHeight[]         = "max-untiled-layer-height";
628const char kMaxUntiledLayerWidth[]          = "max-untiled-layer-width";
629
630// Sample memory usage with high frequency and store the results to the
631// Renderer.Memory histogram. Used in memory tests.
632const char kMemoryMetrics[]                 = "memory-metrics";
633
634// Mutes audio sent to the audio device so it is not audible during
635// automated testing.
636const char kMuteAudio[]                     = "mute-audio";
637
638// Don't send HTTP-Referer headers.
639const char kNoReferrers[]                   = "no-referrers";
640
641// Disables the sandbox for all process types that are normally sandboxed.
642const char kNoSandbox[]                     = "no-sandbox";
643
644// Number of worker threads used to rasterize content.
645const char kNumRasterThreads[]              = "num-raster-threads";
646
647// Enables or disables history navigation in response to horizontal overscroll.
648// Set the value to '1' to enable the feature, and set to '0' to disable.
649// Defaults to enabled.
650const char kOverscrollHistoryNavigation[] =
651    "overscroll-history-navigation";
652
653// Specifies a command that should be used to launch the plugin process.  Useful
654// for running the plugin process through purify or quantify.  Ex:
655//   --plugin-launcher="path\to\purify /Run=yes"
656const char kPluginLauncher[]                = "plugin-launcher";
657
658// Tells the plugin process the path of the plugin to load
659const char kPluginPath[]                    = "plugin-path";
660
661// Causes the process to run as a plugin subprocess.
662const char kPluginProcess[]                 = "plugin";
663
664// Causes the plugin process to display a dialog on launch.
665const char kPluginStartupDialog[]           = "plugin-startup-dialog";
666
667// Argument to the process type that indicates a PPAPI broker process type.
668const char kPpapiBrokerProcess[]            = "ppapi-broker";
669
670// "Command-line" arguments for the PPAPI Flash; used for debugging options.
671const char kPpapiFlashArgs[]                = "ppapi-flash-args";
672
673// Runs PPAPI (Pepper) plugins in-process.
674const char kPpapiInProcess[]                = "ppapi-in-process";
675
676// Like kPluginLauncher for PPAPI plugins.
677const char kPpapiPluginLauncher[]           = "ppapi-plugin-launcher";
678
679// Argument to the process type that indicates a PPAPI plugin process type.
680const char kPpapiPluginProcess[]            = "ppapi";
681
682// Causes the PPAPI sub process to display a dialog on launch. Be sure to use
683// --no-sandbox as well or the sandbox won't allow the dialog to display.
684const char kPpapiStartupDialog[]            = "ppapi-startup-dialog";
685
686// Runs a single process for each site (i.e., group of pages from the same
687// registered domain) the user visits.  We default to using a renderer process
688// for each site instance (i.e., group of pages from the same registered
689// domain with script connections to each other).
690const char kProcessPerSite[]                = "process-per-site";
691
692// Runs each set of script-connected tabs (i.e., a BrowsingInstance) in its own
693// renderer process.  We default to using a renderer process for each
694// site instance (i.e., group of pages from the same registered domain with
695// script connections to each other).
696const char kProcessPerTab[]                 = "process-per-tab";
697
698// The value of this switch determines whether the process is started as a
699// renderer or plugin host.  If it's empty, it's the browser.
700const char kProcessType[]                   = "type";
701
702// Enables more web features over insecure connections. Designed to be used
703// for testing purposes only.
704const char kReduceSecurityForTesting[]      = "reduce-security-for-testing";
705
706// Register Pepper plugins (see pepper_plugin_list.cc for its format).
707const char kRegisterPepperPlugins[]         = "register-pepper-plugins";
708
709// Enables remote debug over HTTP on the specified port.
710const char kRemoteDebuggingPort[]           = "remote-debugging-port";
711
712// Causes the renderer process to throw an assertion on launch.
713const char kRendererAssertTest[]            = "renderer-assert-test";
714
715// On POSIX only: the contents of this flag are prepended to the renderer
716// command line. Useful values might be "valgrind" or "xterm -e gdb --args".
717const char kRendererCmdPrefix[]             = "renderer-cmd-prefix";
718
719// Causes the process to run as renderer instead of as browser.
720const char kRendererProcess[]               = "renderer";
721
722// Overrides the default/calculated limit to the number of renderer processes.
723// Very high values for this setting can lead to high memory/resource usage
724// or instability.
725const char kRendererProcessLimit[]          = "renderer-process-limit";
726
727// Causes the renderer process to display a dialog on launch.
728const char kRendererStartupDialog[]         = "renderer-startup-dialog";
729
730// Causes the process to run as a sandbox IPC subprocess.
731const char kSandboxIPCProcess[]             = "sandbox-ipc";
732
733// Enables or disables scroll end effect in response to vertical overscroll.
734// Set the value to '1' to enable the feature, and set to '0' to disable.
735// Defaults to disabled.
736const char kScrollEndEffect[] = "scroll-end-effect";
737
738// Visibly render a border around paint rects in the web page to help debug
739// and study painting behavior.
740const char kShowPaintRects[]                = "show-paint-rects";
741
742// Runs the renderer and plugins in the same process as the browser
743const char kSingleProcess[]                 = "single-process";
744
745// Experimentally enforces a one-site-per-process security policy.
746// All cross-site navigations force process swaps, and we can restrict a
747// renderer process's access rights based on its site.  For details, see:
748// http://www.chromium.org/developers/design-documents/site-isolation
749//
750// Unlike --enable-strict-site-isolation (which allows cross-site iframes),
751// this flag does not affect which cookies are attached to cross-site requests.
752// Support is being added to render cross-site iframes in a different process
753// than their parent pages.
754const char kSitePerProcess[]                = "site-per-process";
755
756// Skip gpu info collection, blacklist loading, and blacklist auto-update
757// scheduling at browser startup time.
758// Therefore, all GPU features are available, and about:gpu page shows empty
759// content. The switch is intended only for layout tests.
760// TODO(gab): Get rid of this switch entirely.
761const char kSkipGpuDataLoading[]            = "skip-gpu-data-loading";
762
763// Specifies if the browser should start in fullscreen mode, like if the user
764// had pressed F11 right after startup.
765const char kStartFullscreen[] = "start-fullscreen";
766
767// Specifies if the |StatsCollectionController| needs to be bound in the
768// renderer. This binding happens on per-frame basis and hence can potentially
769// be a performance bottleneck. One should only enable it when running a test
770// that needs to access the provided statistics.
771const char kStatsCollectionController[] =
772    "enable-stats-collection-bindings";
773
774// Upscale defaults to "good".
775const char kTabCaptureDownscaleQuality[]    = "tab-capture-downscale-quality";
776
777// Scaling quality for capturing tab. Should be one of "fast", "good" or "best".
778// One flag for upscaling, one for downscaling.
779// Upscale defaults to "best".
780const char kTabCaptureUpscaleQuality[]      = "tab-capture-upscale-quality";
781
782// Allows for forcing socket connections to http/https to use fixed ports.
783const char kTestingFixedHttpPort[]          = "testing-fixed-http-port";
784const char kTestingFixedHttpsPort[]         = "testing-fixed-https-port";
785
786// Type of the current test harness ("browser" or "ui").
787const char kTestType[]                      = "test-type";
788
789const char kTouchScrollingMode[]            = "touch-scrolling-mode";
790const char kTouchScrollingModeAsyncTouchmove[] = "async-touchmove";
791const char kTouchScrollingModeSyncTouchmove[] = "sync-touchmove";
792const char kTouchScrollingModeTouchcancel[] = "touchcancel";
793
794// Causes TRACE_EVENT flags to be recorded beginning with shutdown. Optionally,
795// can specify the specific trace categories to include (e.g.
796// --trace-shutdown=base,net) otherwise, all events are recorded.
797// --trace-shutdown-file can be used to control where the trace log gets stored
798// to since there is otherwise no way to access the result.
799const char kTraceShutdown[]                 = "trace-shutdown";
800
801// If supplied, sets the file which shutdown tracing will be stored into, if
802// omitted the default will be used "chrometrace.log" in the current directory.
803// Has no effect unless --trace-shutdown is also supplied.
804// Example: --trace-shutdown --trace-shutdown-file=/tmp/trace_event.log
805const char kTraceShutdownFile[]             = "trace-shutdown-file";
806
807// Causes TRACE_EVENT flags to be recorded from startup. Optionally, can
808// specify the specific trace categories to include (e.g.
809// --trace-startup=base,net) otherwise, all events are recorded. Setting this
810// flag results in the first call to BeginTracing() to receive all trace events
811// since startup. In Chrome, you may find --trace-startup-file and
812// --trace-startup-duration to control the auto-saving of the trace (not
813// supported in the base-only TraceLog component).
814const char kTraceStartup[]                  = "trace-startup";
815
816// Sets the time in seconds until startup tracing ends. If omitted a default of
817// 5 seconds is used. Has no effect without --trace-startup, or if
818// --startup-trace-file=none was supplied.
819const char kTraceStartupDuration[]          = "trace-startup-duration";
820
821// If supplied, sets the file which startup tracing will be stored into, if
822// omitted the default will be used "chrometrace.log" in the current directory.
823// Has no effect unless --trace-startup is also supplied.
824// Example: --trace-startup --trace-startup-file=/tmp/trace_event.log
825// As a special case, can be set to 'none' - this disables automatically saving
826// the result to a file and the first manually recorded trace will then receive
827// all events since startup.
828const char kTraceStartupFile[]              = "trace-startup-file";
829
830
831
832// Prioritizes the UI's command stream in the GPU process
833extern const char kUIPrioritizeInGpuProcess[] =
834    "ui-prioritize-in-gpu-process";
835
836// Overrides the preferred discardable memory implementation.
837const char kUseDiscardableMemory[] = "use-discardable-memory";
838
839// Bypass the media stream infobar by selecting the default device for media
840// streams (e.g. WebRTC). Works with --use-fake-device-for-media-stream.
841const char kUseFakeUIForMediaStream[]     = "use-fake-ui-for-media-stream";
842
843// Set when Chromium should use a mobile user agent.
844const char kUseMobileUserAgent[] = "use-mobile-user-agent";
845
846// Use the new surfaces system to handle compositor delegation.
847const char kUseSurfaces[] = "use-surfaces";
848
849// On POSIX only: the contents of this flag are prepended to the utility
850// process command line. Useful values might be "valgrind" or "xterm -e gdb
851// --args".
852const char kUtilityCmdPrefix[]              = "utility-cmd-prefix";
853
854// Causes the process to run as a utility subprocess.
855const char kUtilityProcess[]                = "utility";
856
857// The utility process is sandboxed, with access to one directory. This flag
858// specifies the directory that can be accessed.
859const char kUtilityProcessAllowedDir[]      = "utility-allowed-dir";
860
861// Allows MDns to access network in sandboxed process.
862const char kUtilityProcessEnableMDns[]      = "utility-enable-mdns";
863
864const char kUtilityProcessRunningElevated[] = "utility-run-elevated";
865
866// In debug builds, asserts that the stream of input events is valid.
867const char kValidateInputEventStream[] = "validate-input-event-stream";
868
869// Will add kWaitForDebugger to every child processes. If a value is passed, it
870// will be used as a filter to determine if the child process should have the
871// kWaitForDebugger flag passed on or not.
872const char kWaitForDebuggerChildren[]       = "wait-for-debugger-children";
873
874// Causes the process to run as a worker subprocess.
875const char kWorkerProcess[]                 = "worker";
876
877// The prefix used when starting the zygote process. (i.e. 'gdb --args')
878const char kZygoteCmdPrefix[]               = "zygote-cmd-prefix";
879
880// Causes the process to run as a renderer zygote.
881const char kZygoteProcess[]                 = "zygote";
882
883#if defined(ENABLE_WEBRTC)
884// Disables audio processing in a MediaStreamTrack. When this flag is on, AEC,
885// NS and AGC will be done in PeerConnection instead of MediaStreamTrack.
886const char kDisableAudioTrackProcessing[]    = "disable-audio-track-processing";
887
888// Disables WebRTC device enumeration.
889const char kDisableDeviceEnumeration[]      = "disable-device-enumeration";
890
891// Disables HW decode acceleration for WebRTC.
892const char kDisableWebRtcHWDecoding[]       = "disable-webrtc-hw-decoding";
893
894// Disables encryption of RTP Media for WebRTC. When Chrome embeds Content, it
895// ignores this switch on its stable and beta channels.
896const char kDisableWebRtcEncryption[]      = "disable-webrtc-encryption";
897
898// Disables HW encode acceleration for WebRTC.
899const char kDisableWebRtcHWEncoding[]       = "disable-webrtc-hw-encoding";
900
901// Enables VP8 HW encode acceleration for WebRTC.
902const char kEnableWebRtcHWVp8Encoding[]     = "enable-webrtc-hw-vp8-encoding";
903#endif
904
905#if defined(OS_ANDROID)
906// Disable user gesture requirement for media playback.
907const char kDisableGestureRequirementForMediaPlayback[] =
908    "disable-gesture-requirement-for-media-playback";
909
910// Disable the click delay by sending click events during double tap.
911const char kDisableClickDelay[]             = "disable-click-delay";
912
913// Disable overscroll edge effects like those found in Android views.
914const char kDisableOverscrollEdgeEffect[]   = "disable-overscroll-edge-effect";
915
916// WebRTC is enabled by default on Android.
917const char kDisableWebRTC[]                 = "disable-webrtc";
918
919// Enable the recognition part of the Web Speech API.
920const char kEnableSpeechRecognition[]       = "enable-speech-recognition";
921
922// Always use the video overlay for the embedded video.
923// This switch is intended only for tests.
924const char kForceUseOverlayEmbeddedVideo[] = "force-use-overlay-embedded-video";
925
926// The telephony region (ISO country code) to use in phone number detection.
927const char kNetworkCountryIso[] = "network-country-iso";
928
929// Enables remote debug over HTTP on the specified socket name.
930const char kRemoteDebuggingSocketName[]     = "remote-debugging-socket-name";
931#endif
932
933// Disable web audio API.
934const char kDisableWebAudio[]               = "disable-webaudio";
935
936#if defined(OS_CHROMEOS)
937// Disables panel fitting (used for mirror mode).
938const char kDisablePanelFitting[]           = "disable-panel-fitting";
939#endif
940
941#if defined(OS_MACOSX) && !defined(OS_IOS)
942const char kEnableCarbonInterposing[]       = "enable-carbon-interposing";
943
944// Disables support for Core Animation plugins. This is triggered when
945// accelerated compositing is disabled. See http://crbug.com/122430 .
946const char kDisableCoreAnimationPlugins[] =
947    "disable-core-animation-plugins";
948#endif
949
950#if defined(OS_WIN)
951// Device scale factor passed to certain processes like renderers, etc.
952const char kDeviceScaleFactor[]     = "device-scale-factor";
953
954// Disables the DirectWrite font rendering system on windows.
955const char kDisableDirectWrite[]             = "disable-direct-write";
956
957// Disable the Legacy Window which corresponds to the size of the WebContents.
958const char kDisableLegacyIntermediateWindow[] = "disable-legacy-window";
959
960// Use high resolution timers for TimeTicks.
961const char kEnableHighResolutionTime[]      = "enable-high-resolution-time";
962
963// Enable the Win32K process mitigation policy for renderer processes which
964// prevents them from invoking user32 and gdi32 system calls which enter
965// the kernel. This is only supported on Windows 8 and beyond.
966const char kEnableWin32kRendererLockDown[]
967    = "enable_win32k_renderer_lockdown";
968#endif
969
970// Don't dump stuff here, follow the same order as the header.
971
972}  // namespace switches
973