LCOV - code coverage report
Current view: top level - modules/libpref/init - StaticPrefList.h (source / functions) Hit Total Coverage
Test: output.info Lines: 76 98 77.6 %
Date: 2018-08-07 16:42:27 Functions: 0 0 -
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
       2             : /* vim: set ts=8 sts=2 et sw=2 tw=80: */
       3             : /* This Source Code Form is subject to the terms of the Mozilla Public
       4             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       5             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
       6             : 
       7             : // This file defines static prefs, i.e. those that are defined at startup and
       8             : // used entirely or mostly from C++ code.
       9             : //
      10             : // If a pref is listed here and also in a prefs data file such as all.js, the
      11             : // value from the latter will override the value given here. For vanilla
      12             : // browser builds such overrides are discouraged, but they are necessary for
      13             : // some configurations (e.g. Thunderbird).
      14             : //
      15             : // The file is separated into sections, where the sections are determined by
      16             : // the first segment of the prefnames within (e.g. "network.predictor.enabled"
      17             : // is within the "Network" section). Sections should be kept in alphabetical
      18             : // order, but prefs within sections need not be.
      19             : //
      20             : // Normal prefs
      21             : // ------------
      22             : // Definitions of normal prefs in this file have the following form.
      23             : //
      24             : //   PREF(<pref-name-string>, <cpp-type>, <default-value>)
      25             : //
      26             : // - <pref-name-string> is the name of the pref, as it appears in about:config.
      27             : //   It is used in most libpref API functions (from both C++ and JS code).
      28             : //
      29             : // - <cpp-type> is one of bool, int32_t, float, or String (which is just a
      30             : //   typedef for `const char*` in StaticPrefs.h). Note that float prefs are
      31             : //   stored internally as strings.
      32             : //
      33             : // - <default-value> is the default value. Its type should match <cpp-type>.
      34             : //
      35             : // VarCache prefs
      36             : // --------------
      37             : // A VarCache pref is a special type of pref. It can be accessed via the normal
      38             : // pref hash table lookup functions, but it also has an associated global
      39             : // variable (the VarCache) that mirrors the pref value in the prefs hash table,
      40             : // and a getter function that reads that global variable. Using the getter to
      41             : // read the pref's value has the two following advantages over the normal API
      42             : // functions.
      43             : //
      44             : // - A direct global variable access is faster than a hash table lookup.
      45             : //
      46             : // - A global variable can be accessed off the main thread. If a pref *is*
      47             : //   accessed off the main thread, it should use an atomic type. (But note that
      48             : //   many VarCaches that should be atomic are not, in particular because
      49             : //   Atomic<float> is not available, alas.)
      50             : //
      51             : // Definitions of VarCache prefs in this file has the following form.
      52             : //
      53             : //   VARCACHE_PREF(
      54             : //     <pref-name-string>,
      55             : //     <pref-name-id>,
      56             : //     <cpp-type>, <default-value>
      57             : //   )
      58             : //
      59             : // - <pref-name-string> is the same as for normal prefs.
      60             : //
      61             : // - <pref-name-id> is the name of the static getter function generated within
      62             : //   the StaticPrefs class. For consistency, the identifier for every pref
      63             : //   should be created by starting with <pref-name-string> and converting any
      64             : //   '.' or '-' chars to '_'. For example, "foo.bar_baz" becomes
      65             : //   |foo_bar_baz|. This is arguably ugly, but clear, and you can search for
      66             : //   both using the regexp /foo.bar.baz/.
      67             : //
      68             : // - <cpp-type> is one of bool, int32_t, uint32_t, float, or an Atomic version
      69             : //   of one of those. The C++ preprocessor doesn't like template syntax in a
      70             : //   macro argument, so use the typedefs defines in StaticPrefs.h; for example,
      71             : //   use `ReleaseAcquireAtomicBool` instead of `Atomic<bool, ReleaseAcquire>`.
      72             : //
      73             : // - <default-value> is the same as for normal prefs.
      74             : //
      75             : // Note that Rust code must access the global variable directly, rather than via
      76             : // the getter.
      77             : 
      78             : // clang-format off
      79             : 
      80             : //---------------------------------------------------------------------------
      81             : // Accessibility prefs
      82             : //---------------------------------------------------------------------------
      83             : 
      84           0 : VARCACHE_PREF(
      85             :   "accessibility.monoaudio.enable",
      86             :    accessibility_monoaudio_enable,
      87             :   RelaxedAtomicBool, false
      88             : )
      89             : 
      90             : //---------------------------------------------------------------------------
      91             : // DOM prefs
      92             : //---------------------------------------------------------------------------
      93             : 
      94           0 : VARCACHE_PREF(
      95             :   "dom.webcomponents.shadowdom.report_usage",
      96             :    dom_webcomponents_shadowdom_report_usage,
      97             :   bool, false
      98             : )
      99             : 
     100             : // Whether we disable triggering mutation events for changes to style
     101             : // attribute via CSSOM.
     102           0 : VARCACHE_PREF(
     103             :   "dom.mutation-events.cssom.disabled",
     104             :    dom_mutation_events_cssom_disabled,
     105             :   bool, true
     106             : )
     107             : 
     108             : //---------------------------------------------------------------------------
     109             : // Full-screen prefs
     110             : //---------------------------------------------------------------------------
     111             : 
     112             : #ifdef RELEASE_OR_BETA
     113             : # define PREF_VALUE false
     114             : #else
     115             : # define PREF_VALUE true
     116             : #endif
     117           0 : VARCACHE_PREF(
     118             :   "full-screen-api.unprefix.enabled",
     119             :    full_screen_api_unprefix_enabled,
     120             :   bool, PREF_VALUE
     121             : )
     122             : #undef PREF_VALUE
     123             : 
     124             : //---------------------------------------------------------------------------
     125             : // Graphics prefs
     126             : //---------------------------------------------------------------------------
     127             : 
     128           0 : VARCACHE_PREF(
     129             :   "gfx.font_rendering.opentype_svg.enabled",
     130             :    gfx_font_rendering_opentype_svg_enabled,
     131             :   bool, true
     132             : )
     133             : 
     134             : //---------------------------------------------------------------------------
     135             : // HTML5 parser prefs
     136             : //---------------------------------------------------------------------------
     137             : 
     138             : // Toggle which thread the HTML5 parser uses for stream parsing.
     139           0 : VARCACHE_PREF(
     140             :   "html5.offmainthread",
     141             :    html5_offmainthread,
     142             :   bool, true
     143             : )
     144             : 
     145             : // Time in milliseconds between the time a network buffer is seen and the timer
     146             : // firing when the timer hasn't fired previously in this parse in the
     147             : // off-the-main-thread HTML5 parser.
     148           0 : VARCACHE_PREF(
     149             :   "html5.flushtimer.initialdelay",
     150             :    html5_flushtimer_initialdelay,
     151             :   RelaxedAtomicInt32, 120
     152             : )
     153             : 
     154             : // Time in milliseconds between the time a network buffer is seen and the timer
     155             : // firing when the timer has already fired previously in this parse.
     156           0 : VARCACHE_PREF(
     157             :   "html5.flushtimer.subsequentdelay",
     158             :    html5_flushtimer_subsequentdelay,
     159             :   RelaxedAtomicInt32, 120
     160             : )
     161             : 
     162             : //---------------------------------------------------------------------------
     163             : // Layout prefs
     164             : //---------------------------------------------------------------------------
     165             : 
     166             : // Is parallel CSS parsing enabled?
     167           0 : VARCACHE_PREF(
     168             :   "layout.css.parsing.parallel",
     169             :    layout_css_parsing_parallel,
     170             :   bool, true
     171             : )
     172             : 
     173             : // Is CSS error reporting enabled?
     174           0 : VARCACHE_PREF(
     175             :   "layout.css.report_errors",
     176             :   layout_css_report_errors,
     177             :   bool, true
     178             : )
     179             : 
     180             : // Is support for the font-display @font-face descriptor enabled?
     181           0 : VARCACHE_PREF(
     182             :   "layout.css.font-display.enabled",
     183             :    layout_css_font_display_enabled,
     184             :   bool, true
     185             : )
     186             : 
     187             : // Are webkit-prefixed properties & property-values supported?
     188           1 : VARCACHE_PREF(
     189             :   "layout.css.prefixes.webkit",
     190             :    layout_css_prefixes_webkit,
     191             :   bool, true
     192             : )
     193             : 
     194             : // Are "-webkit-{min|max}-device-pixel-ratio" media queries supported? (Note:
     195             : // this pref has no effect if the master 'layout.css.prefixes.webkit' pref is
     196             : // set to false.)
     197           0 : VARCACHE_PREF(
     198             :   "layout.css.prefixes.device-pixel-ratio-webkit",
     199             :    layout_css_prefixes_device_pixel_ratio_webkit,
     200             :   bool, false
     201             : )
     202             : 
     203             : // Is -moz-prefixed gradient functions enabled?
     204           1 : VARCACHE_PREF(
     205             :   "layout.css.prefixes.gradients",
     206             :    layout_css_prefixes_gradients,
     207             :   bool, true
     208             : )
     209             : 
     210             : // Should stray control characters be rendered visibly?
     211             : #ifdef RELEASE_OR_BETA
     212             : # define PREF_VALUE false
     213             : #else
     214             : # define PREF_VALUE true
     215             : #endif
     216          36 : VARCACHE_PREF(
     217             :   "layout.css.control-characters.visible",
     218             :    layout_css_control_characters_visible,
     219             :   bool, PREF_VALUE
     220             : )
     221             : #undef PREF_VALUE
     222             : 
     223             : // Is support for the frames() timing function enabled?
     224             : #ifdef RELEASE_OR_BETA
     225             : # define PREF_VALUE false
     226             : #else
     227             : # define PREF_VALUE true
     228             : #endif
     229           1 : VARCACHE_PREF(
     230             :   "layout.css.frames-timing.enabled",
     231             :    layout_css_frames_timing_enabled,
     232             :   bool, PREF_VALUE
     233             : )
     234             : #undef PREF_VALUE
     235             : 
     236             : // Should the :visited selector ever match (otherwise :link matches instead)?
     237           0 : VARCACHE_PREF(
     238             :   "layout.css.visited_links_enabled",
     239             :    layout_css_visited_links_enabled,
     240             :   bool, true
     241             : )
     242             : 
     243             : // Pref to control whether @-moz-document rules are enabled in content pages.
     244           1 : VARCACHE_PREF(
     245             :   "layout.css.moz-document.content.enabled",
     246             :    layout_css_moz_document_content_enabled,
     247             :   bool, false
     248             : )
     249             : 
     250             : // Pref to control whether @-moz-document url-prefix() is parsed in content
     251             : // pages. Only effective when layout.css.moz-document.content.enabled is false.
     252             : #ifdef EARLY_BETA_OR_EARLIER
     253             : #define PREF_VALUE false
     254             : #else
     255             : #define PREF_VALUE true
     256             : #endif
     257           1 : VARCACHE_PREF(
     258             :   "layout.css.moz-document.url-prefix-hack.enabled",
     259             :    layout_css_moz_document_url_prefix_hack_enabled,
     260             :   bool, PREF_VALUE
     261             : )
     262             : #undef PREF_VALUE
     263             : 
     264           1 : VARCACHE_PREF(
     265             :   "layout.css.xul-display-values.content.enabled",
     266             :    layout_css_xul_display_values_content_enabled,
     267             :   bool, false
     268             : )
     269             : 
     270             : // Is support for CSS "grid-template-{columns,rows}: subgrid X" enabled?
     271           1 : VARCACHE_PREF(
     272             :   "layout.css.grid-template-subgrid-value.enabled",
     273             :    layout_css_grid_template_subgrid_value_enabled,
     274             :   bool, false
     275             : )
     276             : 
     277             : // Is support for variation fonts enabled?
     278           1 : VARCACHE_PREF(
     279             :   "layout.css.font-variations.enabled",
     280             :    layout_css_font_variations_enabled,
     281             :   RelaxedAtomicBool, true
     282             : )
     283             : 
     284             : // Are we emulating -moz-{inline}-box layout using CSS flexbox?
     285         106 : VARCACHE_PREF(
     286             :   "layout.css.emulate-moz-box-with-flex",
     287             :    layout_css_emulate_moz_box_with_flex,
     288             :   bool, false
     289             : )
     290             : 
     291             : //---------------------------------------------------------------------------
     292             : // JavaScript prefs
     293             : //---------------------------------------------------------------------------
     294             : 
     295             : // nsJSEnvironmentObserver observes the memory-pressure notifications and
     296             : // forces a garbage collection and cycle collection when it happens, if the
     297             : // appropriate pref is set.
     298             : #ifdef ANDROID
     299             :   // Disable the JS engine's GC on memory pressure, since we do one in the
     300             :   // mobile browser (bug 669346).
     301             :   // XXX: this value possibly should be changed, or the pref removed entirely.
     302             :   //      See bug 1450787.
     303             : # define PREF_VALUE false
     304             : #else
     305             : # define PREF_VALUE true
     306             : #endif
     307           1 : VARCACHE_PREF(
     308             :   "javascript.options.gc_on_memory_pressure",
     309             :    javascript_options_gc_on_memory_pressure,
     310             :   bool, PREF_VALUE
     311             : )
     312             : #undef PREF_VALUE
     313             : 
     314           0 : VARCACHE_PREF(
     315             :   "javascript.options.compact_on_user_inactive",
     316             :    javascript_options_compact_on_user_inactive,
     317             :   bool, true
     318             : )
     319             : 
     320             : // The default amount of time to wait from the user being idle to starting a
     321             : // shrinking GC.
     322             : #ifdef NIGHTLY_BUILD
     323             : # define PREF_VALUE  15000  // ms
     324             : #else
     325             : # define PREF_VALUE 300000  // ms
     326             : #endif
     327           0 : VARCACHE_PREF(
     328             :   "javascript.options.compact_on_user_inactive_delay",
     329             :    javascript_options_compact_on_user_inactive_delay,
     330             :    uint32_t, PREF_VALUE
     331             : )
     332             : #undef PREF_VALUE
     333             : 
     334           1 : VARCACHE_PREF(
     335             :   "javascript.options.mem.log",
     336             :    javascript_options_mem_log,
     337             :   bool, false
     338             : )
     339             : 
     340           1 : VARCACHE_PREF(
     341             :   "javascript.options.mem.notify",
     342             :    javascript_options_mem_notify,
     343             :   bool, false
     344             : )
     345             : 
     346             : //---------------------------------------------------------------------------
     347             : // Media prefs
     348             : //---------------------------------------------------------------------------
     349             : 
     350             : // These prefs use camel case instead of snake case for the getter because one
     351             : // reviewer had an unshakeable preference for that.
     352             : 
     353             : // File-backed MediaCache size.
     354             : #ifdef ANDROID
     355             : # define PREF_VALUE  32768  // Measured in KiB
     356             : #else
     357             : # define PREF_VALUE 512000  // Measured in KiB
     358             : #endif
     359           1 : VARCACHE_PREF(
     360             :   "media.cache_size",
     361             :    MediaCacheSize,
     362             :   RelaxedAtomicUint32, PREF_VALUE
     363             : )
     364             : #undef PREF_VALUE
     365             : 
     366             : // If a resource is known to be smaller than this size (in kilobytes), a
     367             : // memory-backed MediaCache may be used; otherwise the (single shared global)
     368             : // file-backed MediaCache is used.
     369           0 : VARCACHE_PREF(
     370             :   "media.memory_cache_max_size",
     371             :    MediaMemoryCacheMaxSize,
     372             :   uint32_t, 8192      // Measured in KiB
     373             : )
     374             : 
     375             : // Don't create more memory-backed MediaCaches if their combined size would go
     376             : // above this absolute size limit.
     377             : #ifdef ANDROID
     378             : # define PREF_VALUE  32768    // Measured in KiB
     379             : #else
     380             : # define PREF_VALUE 524288    // Measured in KiB
     381             : #endif
     382           1 : VARCACHE_PREF(
     383             :   "media.memory_caches_combined_limit_kb",
     384             :    MediaMemoryCachesCombinedLimitKb,
     385             :   uint32_t, PREF_VALUE
     386             : )
     387             : #undef PREF_VALUE
     388             : 
     389             : // Don't create more memory-backed MediaCaches if their combined size would go
     390             : // above this relative size limit (a percentage of physical memory).
     391           0 : VARCACHE_PREF(
     392             :   "media.memory_caches_combined_limit_pc_sysmem",
     393             :    MediaMemoryCachesCombinedLimitPcSysmem,
     394             :   uint32_t, 5         // A percentage
     395             : )
     396             : 
     397             : // When a network connection is suspended, don't resume it until the amount of
     398             : // buffered data falls below this threshold (in seconds).
     399             : #ifdef ANDROID
     400             : # define PREF_VALUE 10  // Use a smaller limit to save battery.
     401             : #else
     402             : # define PREF_VALUE 30
     403             : #endif
     404           1 : VARCACHE_PREF(
     405             :   "media.cache_resume_threshold",
     406             :    MediaCacheResumeThreshold,
     407             :   RelaxedAtomicInt32, PREF_VALUE
     408             : )
     409             : #undef PREF_VALUE
     410             : 
     411             : // Stop reading ahead when our buffered data is this many seconds ahead of the
     412             : // current playback position. This limit can stop us from using arbitrary
     413             : // amounts of network bandwidth prefetching huge videos.
     414             : #ifdef ANDROID
     415             : # define PREF_VALUE 30  // Use a smaller limit to save battery.
     416             : #else
     417             : # define PREF_VALUE 60
     418             : #endif
     419           1 : VARCACHE_PREF(
     420             :   "media.cache_readahead_limit",
     421             :    MediaCacheReadaheadLimit,
     422             :   RelaxedAtomicInt32, PREF_VALUE
     423             : )
     424             : #undef PREF_VALUE
     425             : 
     426             : // AudioSink
     427           1 : VARCACHE_PREF(
     428             :   "media.resampling.enabled",
     429             :    MediaResamplingEnabled,
     430             :   RelaxedAtomicBool, false
     431             : )
     432             : 
     433             : #if defined(XP_WIN) || defined(XP_DARWIN) || defined(MOZ_PULSEAUDIO)
     434             : // libcubeb backend implement .get_preferred_channel_layout
     435             : # define PREF_VALUE false
     436             : #else
     437             : # define PREF_VALUE true
     438             : #endif
     439           1 : VARCACHE_PREF(
     440             :   "media.forcestereo.enabled",
     441             :    MediaForcestereoEnabled,
     442             :   RelaxedAtomicBool, PREF_VALUE
     443             : )
     444             : #undef PREF_VALUE
     445             : 
     446             : // VideoSink
     447           1 : VARCACHE_PREF(
     448             :   "media.ruin-av-sync.enabled",
     449             :    MediaRuinAvSyncEnabled,
     450             :   RelaxedAtomicBool, false
     451             : )
     452             : 
     453             : // Encrypted Media Extensions
     454             : #if defined(ANDROID)
     455             : # if defined(NIGHTLY_BUILD)
     456             : #  define PREF_VALUE true
     457             : # else
     458             : #  define PREF_VALUE false
     459             : # endif
     460             : #elif defined(XP_LINUX)
     461             :   // On Linux EME is visible but disabled by default. This is so that the "Play
     462             :   // DRM content" checkbox in the Firefox UI is unchecked by default. DRM
     463             :   // requires downloading and installing proprietary binaries, which users on
     464             :   // an open source operating systems didn't opt into. The first time a site
     465             :   // using EME is encountered, the user will be prompted to enable DRM,
     466             :   // whereupon the EME plugin binaries will be downloaded if permission is
     467             :   // granted.
     468             : # define PREF_VALUE false
     469             : #else
     470             : # define PREF_VALUE true
     471             : #endif
     472           1 : VARCACHE_PREF(
     473             :   "media.eme.enabled",
     474             :    MediaEmeEnabled,
     475             :   bool, PREF_VALUE
     476             : )
     477             : #undef PREF_VALUE
     478             : 
     479           1 : VARCACHE_PREF(
     480             :   "media.clearkey.persistent-license.enabled",
     481             :    MediaClearkeyPersistentLicenseEnabled,
     482             :   bool, false
     483             : )
     484             : 
     485             : #if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
     486             : // Whether to allow, on a Linux system that doesn't support the necessary
     487             : // sandboxing features, loading Gecko Media Plugins unsandboxed.  However, EME
     488             : // CDMs will not be loaded without sandboxing even if this pref is changed.
     489             : VARCACHE_PREF(
     490             :   "media.gmp.insecure.allow",
     491             :    MediaGmpInsecureAllow,
     492             :   bool, false
     493             : )
     494             : #endif
     495             : 
     496             : // Specifies whether the PDMFactory can create a test decoder that just outputs
     497             : // blank frames/audio instead of actually decoding. The blank decoder works on
     498             : // all platforms.
     499           1 : VARCACHE_PREF(
     500             :   "media.use-blank-decoder",
     501             :    MediaUseBlankDecoder,
     502             :   RelaxedAtomicBool, false
     503             : )
     504             : 
     505             : #if defined(XP_WIN)
     506             : # define PREF_VALUE true
     507             : #else
     508             : # define PREF_VALUE false
     509             : #endif
     510           1 : VARCACHE_PREF(
     511             :   "media.gpu-process-decoder",
     512             :    MediaGpuProcessDecoder,
     513             :   RelaxedAtomicBool, PREF_VALUE
     514             : )
     515             : #undef PREF_VALUE
     516             : 
     517             : #ifdef ANDROID
     518             : 
     519             : // Enable the MediaCodec PlatformDecoderModule by default.
     520             : VARCACHE_PREF(
     521             :   "media.android-media-codec.enabled",
     522             :    MediaAndroidMediaCodecEnabled,
     523             :   RelaxedAtomicBool, true
     524             : )
     525             : 
     526             : VARCACHE_PREF(
     527             :   "media.android-media-codec.preferred",
     528             :    MediaAndroidMediaCodecPreferred,
     529             :   RelaxedAtomicBool, true
     530             : )
     531             : 
     532             : #endif // ANDROID
     533             : 
     534             : // WebRTC
     535             : #ifdef MOZ_WEBRTC
     536             : #ifdef ANDROID
     537             : 
     538             : VARCACHE_PREF(
     539             :   "media.navigator.hardware.vp8_encode.acceleration_remote_enabled",
     540             :    MediaNavigatorHardwareVp8encodeAccelerationRemoteEnabled,
     541             :   bool, true
     542             : )
     543             : 
     544             : PREF("media.navigator.hardware.vp8_encode.acceleration_enabled", bool, true)
     545             : 
     546             : PREF("media.navigator.hardware.vp8_decode.acceleration_enabled", bool, false)
     547             : 
     548             : #endif // ANDROID
     549             : 
     550             : // Use MediaDataDecoder API for WebRTC. This includes hardware acceleration for
     551             : // decoding.
     552           1 : VARCACHE_PREF(
     553             :   "media.navigator.mediadatadecoder_enabled",
     554             :    MediaNavigatorMediadatadecoderEnabled,
     555             :   bool, false
     556             : )
     557             : #endif // MOZ_WEBRTC
     558             : 
     559             : #ifdef MOZ_OMX
     560             : VARCACHE_PREF(
     561             :   "media.omx.enabled",
     562             :    MediaOmxEnabled,
     563             :   bool, false
     564             : )
     565             : #endif
     566             : 
     567             : #ifdef MOZ_FFMPEG
     568             : 
     569             : # if defined(XP_MACOSX)
     570             : #  define PREF_VALUE false
     571             : # else
     572             : #  define PREF_VALUE true
     573             : # endif
     574           1 : VARCACHE_PREF(
     575             :   "media.ffmpeg.enabled",
     576             :    MediaFfmpegEnabled,
     577             :   RelaxedAtomicBool, PREF_VALUE
     578             : )
     579             : #undef PREF_VALUE
     580             : 
     581           1 : VARCACHE_PREF(
     582             :   "media.libavcodec.allow-obsolete",
     583             :    MediaLibavcodecAllowObsolete,
     584             :   bool, false
     585             : )
     586             : 
     587             : #endif // MOZ_FFMPEG
     588             : 
     589             : #ifdef MOZ_FFVPX
     590           1 : VARCACHE_PREF(
     591             :   "media.ffvpx.enabled",
     592             :    MediaFfvpxEnabled,
     593             :   RelaxedAtomicBool, true
     594             : )
     595             : #endif
     596             : 
     597             : #if defined(MOZ_FFMPEG) || defined(MOZ_FFVPX)
     598           1 : VARCACHE_PREF(
     599             :   "media.ffmpeg.low-latency.enabled",
     600             :    MediaFfmpegLowLatencyEnabled,
     601             :   bool, false
     602             : )
     603             : #endif
     604             : 
     605             : #ifdef MOZ_WMF
     606             : 
     607             : VARCACHE_PREF(
     608             :   "media.wmf.enabled",
     609             :    MediaWmfEnabled,
     610             :   RelaxedAtomicBool, true
     611             : )
     612             : 
     613             : // Whether DD should consider WMF-disabled a WMF failure, useful for testing.
     614             : VARCACHE_PREF(
     615             :   "media.decoder-doctor.wmf-disabled-is-failure",
     616             :    MediaDecoderDoctorWmfDisabledIsFailure,
     617             :   bool, false
     618             : )
     619             : 
     620             : VARCACHE_PREF(
     621             :   "media.wmf.vp9.enabled",
     622             :    MediaWmfVp9Enabled,
     623             :   RelaxedAtomicBool, true
     624             : )
     625             : 
     626             : #endif // MOZ_WMF
     627             : 
     628             : // Whether to check the decoder supports recycling.
     629             : #ifdef ANDROID
     630             : # define PREF_VALUE true
     631             : #else
     632             : # define PREF_VALUE false
     633             : #endif
     634           1 : VARCACHE_PREF(
     635             :   "media.decoder.recycle.enabled",
     636             :    MediaDecoderRecycleEnabled,
     637             :   RelaxedAtomicBool, PREF_VALUE
     638             : )
     639             : #undef PREF_VALUE
     640             : 
     641             : // Should MFR try to skip to the next key frame?
     642           1 : VARCACHE_PREF(
     643             :   "media.decoder.skip-to-next-key-frame.enabled",
     644             :    MediaDecoderSkipToNextKeyFrameEnabled,
     645             :   RelaxedAtomicBool, true
     646             : )
     647             : 
     648           1 : VARCACHE_PREF(
     649             :   "media.gmp.decoder.enabled",
     650             :    MediaGmpDecoderEnabled,
     651             :   RelaxedAtomicBool, false
     652             : )
     653             : 
     654           1 : VARCACHE_PREF(
     655             :   "media.eme.audio.blank",
     656             :    MediaEmeAudioBlank,
     657             :   RelaxedAtomicBool, false
     658             : )
     659           0 : VARCACHE_PREF(
     660             :   "media.eme.video.blank",
     661             :    MediaEmeVideoBlank,
     662             :   RelaxedAtomicBool, false
     663             : )
     664             : 
     665           1 : VARCACHE_PREF(
     666             :   "media.eme.chromium-api.video-shmems",
     667             :    MediaEmeChromiumApiVideoShmems,
     668             :   RelaxedAtomicUint32, 6
     669             : )
     670             : 
     671             : // Whether to suspend decoding of videos in background tabs.
     672           1 : VARCACHE_PREF(
     673             :   "media.suspend-bkgnd-video.enabled",
     674             :    MediaSuspendBkgndVideoEnabled,
     675             :   RelaxedAtomicBool, true
     676             : )
     677             : 
     678             : // Delay, in ms, from time window goes to background to suspending
     679             : // video decoders. Defaults to 10 seconds.
     680           1 : VARCACHE_PREF(
     681             :   "media.suspend-bkgnd-video.delay-ms",
     682             :    MediaSuspendBkgndVideoDelayMs,
     683             :   RelaxedAtomicUint32, 10000
     684             : )
     685             : 
     686           1 : VARCACHE_PREF(
     687             :   "media.dormant-on-pause-timeout-ms",
     688             :    MediaDormantOnPauseTimeoutMs,
     689             :   RelaxedAtomicInt32, 5000
     690             : )
     691             : 
     692           1 : VARCACHE_PREF(
     693             :   "media.webspeech.synth.force_global_queue",
     694             :    MediaWebspeechSynthForceGlobalQueue,
     695             :   bool, false
     696             : )
     697             : 
     698           1 : VARCACHE_PREF(
     699             :   "media.webspeech.test.enable",
     700             :    MediaWebspeechTestEnable,
     701             :   bool, false
     702             : )
     703             : 
     704           0 : VARCACHE_PREF(
     705             :   "media.webspeech.test.fake_fsm_events",
     706             :    MediaWebspeechTextFakeFsmEvents,
     707             :   bool, false
     708             : )
     709             : 
     710           1 : VARCACHE_PREF(
     711             :   "media.webspeech.test.fake_recognition_service",
     712             :    MediaWebspeechTextFakeRecognitionService,
     713             :   bool, false
     714             : )
     715             : 
     716             : #ifdef MOZ_WEBSPEECH
     717           1 : VARCACHE_PREF(
     718             :   "media.webspeech.recognition.enable",
     719             :    MediaWebspeechRecognitionEnable,
     720             :   bool, false
     721             : )
     722             : #endif
     723             : 
     724           1 : VARCACHE_PREF(
     725             :   "media.webspeech.recognition.force_enable",
     726             :    MediaWebspeechRecognitionForceEnable,
     727             :   bool, false
     728             : )
     729             : 
     730             : #if defined(RELEASE_OR_BETA)
     731             : # define PREF_VALUE 3
     732             : #else
     733             :   // Zero tolerance in pre-release builds to detect any decoder regression.
     734             : # define PREF_VALUE 0
     735             : #endif
     736           0 : VARCACHE_PREF(
     737             :   "media.audio-max-decode-error",
     738             :    MediaAudioMaxDecodeError,
     739             :   uint32_t, PREF_VALUE
     740             : )
     741             : #undef PREF_VALUE
     742             : 
     743             : #if defined(RELEASE_OR_BETA)
     744             : # define PREF_VALUE 2
     745             : #else
     746             :   // Zero tolerance in pre-release builds to detect any decoder regression.
     747             : # define PREF_VALUE 0
     748             : #endif
     749           1 : VARCACHE_PREF(
     750             :   "media.video-max-decode-error",
     751             :    MediaVideoMaxDecodeError,
     752             :   uint32_t, PREF_VALUE
     753             : )
     754             : #undef PREF_VALUE
     755             : 
     756             : // Ogg
     757           1 : VARCACHE_PREF(
     758             :   "media.ogg.enabled",
     759             :    MediaOggEnabled,
     760             :   RelaxedAtomicBool, true
     761             : )
     762             : 
     763             : // AV1
     764           1 : VARCACHE_PREF(
     765             :   "media.av1.enabled",
     766             :    MediaAv1Enabled,
     767             :   RelaxedAtomicBool, true
     768             : )
     769             : 
     770             : // Flac
     771             : // Use new MediaFormatReader architecture for plain ogg.
     772           1 : VARCACHE_PREF(
     773             :   "media.ogg.flac.enabled",
     774             :    MediaOggFlacEnabled,
     775             :   RelaxedAtomicBool, true
     776             : )
     777             : 
     778           1 : VARCACHE_PREF(
     779             :   "media.flac.enabled",
     780             :    MediaFlacEnabled,
     781             :   bool, true
     782             : )
     783             : 
     784             : // Hls
     785             : #ifdef ANDROID
     786             : # define PREF_VALUE true
     787             : #else
     788             : # define PREF_VALUE false
     789             : #endif
     790           1 : VARCACHE_PREF(
     791             :   "media.hls.enabled",
     792             :    MediaHlsEnabled,
     793             :   bool, PREF_VALUE
     794             : )
     795             : #undef PREF_VALUE
     796             : 
     797             : #ifdef MOZ_FMP4
     798             : # define PREF_VALUE true
     799             : #else
     800             : # define PREF_VALUE false
     801             : #endif
     802           1 : VARCACHE_PREF(
     803             :   "media.mp4.enabled",
     804             :    mediaMp4Enabled,
     805             :   RelaxedAtomicBool, PREF_VALUE
     806             : )
     807             : #undef PREF_VALUE
     808             : 
     809             : // Error/warning handling, Decoder Doctor.
     810             : //
     811             : // Set to true to force demux/decode warnings to be treated as errors.
     812           1 : VARCACHE_PREF(
     813             :   "media.playback.warnings-as-errors",
     814             :    MediaPlaybackWarningsAsErrors,
     815             :   RelaxedAtomicBool, false
     816             : )
     817             : 
     818             : // Resume video decoding when the cursor is hovering on a background tab to
     819             : // reduce the resume latency and improve the user experience.
     820           1 : VARCACHE_PREF(
     821             :   "media.resume-bkgnd-video-on-tabhover",
     822             :    MediaResumeBkgndVideoOnTabhover,
     823             :   bool, true
     824             : )
     825             : 
     826             : #ifdef ANDROID
     827             : # define PREF_VALUE true
     828             : #else
     829             : # define PREF_VALUE false
     830             : #endif
     831           1 : VARCACHE_PREF(
     832             :   "media.videocontrols.lock-video-orientation",
     833             :    MediaVideocontrolsLockVideoOrientation,
     834             :   bool, PREF_VALUE
     835             : )
     836             : #undef PREF_VALUE
     837             : 
     838             : // Media Seamless Looping
     839           1 : VARCACHE_PREF(
     840             :   "media.seamless-looping",
     841             :    MediaSeamlessLooping,
     842             :   RelaxedAtomicBool, true
     843             : )
     844             : 
     845             : //---------------------------------------------------------------------------
     846             : // Network prefs
     847             : //---------------------------------------------------------------------------
     848             : 
     849             : // Sub-resources HTTP-authentication:
     850             : //   0 - don't allow sub-resources to open HTTP authentication credentials
     851             : //       dialogs
     852             : //   1 - allow sub-resources to open HTTP authentication credentials dialogs,
     853             : //       but don't allow it for cross-origin sub-resources
     854             : //   2 - allow the cross-origin authentication as well.
     855           1 : VARCACHE_PREF(
     856             :   "network.auth.subresource-http-auth-allow",
     857             :    network_auth_subresource_http_auth_allow,
     858             :   uint32_t, 2
     859             : )
     860             : 
     861             : // Sub-resources HTTP-authentication for cross-origin images:
     862             : // - true: It is allowed to present http auth. dialog for cross-origin images.
     863             : // - false: It is not allowed.
     864             : // If network.auth.subresource-http-auth-allow has values 0 or 1 this pref does
     865             : // not have any effect.
     866           1 : VARCACHE_PREF(
     867             :   "network.auth.subresource-img-cross-origin-http-auth-allow",
     868             :    network_auth_subresource_img_cross_origin_http_auth_allow,
     869             :   bool, false
     870             : )
     871             : 
     872             : // Resources that are triggered by some non-web-content:
     873             : // - true: They are allow to present http auth. dialog
     874             : // - false: They are not allow to present http auth. dialog.
     875           0 : VARCACHE_PREF(
     876             :   "network.auth.non-web-content-triggered-resources-http-auth-allow",
     877             :    network_auth_non_web_content_triggered_resources_http_auth_allow,
     878             :   bool, false
     879             : )
     880             : 
     881             : // Enables the predictive service.
     882           1 : VARCACHE_PREF(
     883             :   "network.predictor.enabled",
     884             :    network_predictor_enabled,
     885             :   bool, true
     886             : )
     887             : 
     888           1 : VARCACHE_PREF(
     889             :   "network.predictor.enable-hover-on-ssl",
     890             :    network_predictor_enable_hover_on_ssl,
     891             :   bool, false
     892             : )
     893             : 
     894           1 : VARCACHE_PREF(
     895             :   "network.predictor.enable-prefetch",
     896             :    network_predictor_enable_prefetch,
     897             :   bool, false
     898             : )
     899             : 
     900           1 : VARCACHE_PREF(
     901             :   "network.predictor.page-degradation.day",
     902             :    network_predictor_page_degradation_day,
     903             :   int32_t, 0
     904             : )
     905           1 : VARCACHE_PREF(
     906             :   "network.predictor.page-degradation.week",
     907             :    network_predictor_page_degradation_week,
     908             :   int32_t, 5
     909             : )
     910           1 : VARCACHE_PREF(
     911             :   "network.predictor.page-degradation.month",
     912             :    network_predictor_page_degradation_month,
     913             :   int32_t, 10
     914             : )
     915           1 : VARCACHE_PREF(
     916             :   "network.predictor.page-degradation.year",
     917             :    network_predictor_page_degradation_year,
     918             :   int32_t, 25
     919             : )
     920           1 : VARCACHE_PREF(
     921             :   "network.predictor.page-degradation.max",
     922             :    network_predictor_page_degradation_max,
     923             :   int32_t, 50
     924             : )
     925             : 
     926           1 : VARCACHE_PREF(
     927             :   "network.predictor.subresource-degradation.day",
     928             :    network_predictor_subresource_degradation_day,
     929             :   int32_t, 1
     930             : )
     931           1 : VARCACHE_PREF(
     932             :   "network.predictor.subresource-degradation.week",
     933             :    network_predictor_subresource_degradation_week,
     934             :   int32_t, 10
     935             : )
     936           1 : VARCACHE_PREF(
     937             :   "network.predictor.subresource-degradation.month",
     938             :    network_predictor_subresource_degradation_month,
     939             :   int32_t, 25
     940             : )
     941           1 : VARCACHE_PREF(
     942             :   "network.predictor.subresource-degradation.year",
     943             :    network_predictor_subresource_degradation_year,
     944             :   int32_t, 50
     945             : )
     946           1 : VARCACHE_PREF(
     947             :   "network.predictor.subresource-degradation.max",
     948             :    network_predictor_subresource_degradation_max,
     949             :   int32_t, 100
     950             : )
     951             : 
     952           1 : VARCACHE_PREF(
     953             :   "network.predictor.prefetch-rolling-load-count",
     954             :    network_predictor_prefetch_rolling_load_count,
     955             :   int32_t, 10
     956             : )
     957             : 
     958           1 : VARCACHE_PREF(
     959             :   "network.predictor.prefetch-min-confidence",
     960             :    network_predictor_prefetch_min_confidence,
     961             :   int32_t, 100
     962             : )
     963           1 : VARCACHE_PREF(
     964             :   "network.predictor.preconnect-min-confidence",
     965             :    network_predictor_preconnect_min_confidence,
     966             :   int32_t, 90
     967             : )
     968           1 : VARCACHE_PREF(
     969             :   "network.predictor.preresolve-min-confidence",
     970             :    network_predictor_preresolve_min_confidence,
     971             :   int32_t, 60
     972             : )
     973             : 
     974           1 : VARCACHE_PREF(
     975             :   "network.predictor.prefetch-force-valid-for",
     976             :    network_predictor_prefetch_force_valid_for,
     977             :   int32_t, 10
     978             : )
     979             : 
     980           1 : VARCACHE_PREF(
     981             :   "network.predictor.max-resources-per-entry",
     982             :    network_predictor_max_resources_per_entry,
     983             :   int32_t, 100
     984             : )
     985             : 
     986             : // This is selected in concert with max-resources-per-entry to keep memory
     987             : // usage low-ish. The default of the combo of the two is ~50k.
     988           1 : VARCACHE_PREF(
     989             :   "network.predictor.max-uri-length",
     990             :    network_predictor_max_uri_length,
     991             :   uint32_t, 500
     992             : )
     993             : 
     994           0 : PREF("network.predictor.cleaned-up", bool, false)
     995             : 
     996             : // A testing flag.
     997           1 : VARCACHE_PREF(
     998             :   "network.predictor.doing-tests",
     999             :    network_predictor_doing_tests,
    1000             :   bool, false
    1001             : )
    1002             : 
    1003             : //---------------------------------------------------------------------------
    1004             : // Preferences prefs
    1005             : //---------------------------------------------------------------------------
    1006             : 
    1007             : PREF("preferences.allow.omt-write", bool, true)
    1008             : 
    1009             : //---------------------------------------------------------------------------
    1010             : // View source prefs
    1011             : //---------------------------------------------------------------------------
    1012             : 
    1013             : VARCACHE_PREF(
    1014             :   "view_source.editor.external",
    1015             :    view_source_editor_external,
    1016             :   bool, false
    1017             : )
    1018             : 
    1019             : //---------------------------------------------------------------------------
    1020             : // End of prefs
    1021             : //---------------------------------------------------------------------------
    1022             : 
    1023             : // clang-format on

Generated by: LCOV version 1.13-14-ga5dd952