Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/StaticPrefs.h
Line
Count
Source
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
#ifndef mozilla_StaticPrefs_h
8
#define mozilla_StaticPrefs_h
9
10
#include "mozilla/Assertions.h"
11
#include "mozilla/Atomics.h"
12
#include "mozilla/TypeTraits.h"
13
#include "MainThreadUtils.h"
14
15
namespace mozilla {
16
17
// These typedefs are for use within StaticPrefList.h.
18
19
typedef const char* String;
20
21
typedef Atomic<bool, Relaxed> RelaxedAtomicBool;
22
typedef Atomic<bool, ReleaseAcquire> ReleaseAcquireAtomicBool;
23
typedef Atomic<bool, SequentiallyConsistent> SequentiallyConsistentAtomicBool;
24
25
typedef Atomic<int32_t, Relaxed> RelaxedAtomicInt32;
26
typedef Atomic<int32_t, ReleaseAcquire> ReleaseAcquireAtomicInt32;
27
typedef Atomic<int32_t, SequentiallyConsistent>
28
  SequentiallyConsistentAtomicInt32;
29
30
typedef Atomic<uint32_t, Relaxed> RelaxedAtomicUint32;
31
typedef Atomic<uint32_t, ReleaseAcquire> ReleaseAcquireAtomicUint32;
32
typedef Atomic<uint32_t, SequentiallyConsistent>
33
  SequentiallyConsistentAtomicUint32;
34
35
template<typename T>
36
struct StripAtomicImpl
37
{
38
  typedef T Type;
39
};
40
41
template<typename T, MemoryOrdering Order>
42
struct StripAtomicImpl<Atomic<T, Order>>
43
{
44
  typedef T Type;
45
};
46
47
template<typename T>
48
using StripAtomic = typename StripAtomicImpl<T>::Type;
49
50
template<typename T>
51
struct IsAtomic : FalseType
52
{
53
};
54
55
template<typename T, MemoryOrdering Order>
56
struct IsAtomic<Atomic<T, Order>> : TrueType
57
{
58
};
59
60
class StaticPrefs
61
{
62
// For a VarCache pref like this:
63
//
64
//   VARCACHE_PREF("my.varcache", my_varcache, int32_t, 99)
65
//
66
// we generate a static variable declaration and a getter definition:
67
//
68
//   private:
69
//     static int32_t sVarCache_my_varcache;
70
//   public:
71
//     static int32_t my_varcache() { return sVarCache_my_varcache; }
72
//
73
#define PREF(str, cpp_type, default_value)
74
#define VARCACHE_PREF(str, id, cpp_type, default_value)                        \
75
private:                                                                       \
76
  static cpp_type sVarCache_##id;                                              \
77
                                                                               \
78
public:                                                                        \
79
  static StripAtomic<cpp_type> id()                                            \
80
12.8k
  {                                                                            \
81
12.8k
    MOZ_ASSERT(IsAtomic<cpp_type>::value || NS_IsMainThread(),                 \
82
12.8k
               "Non-atomic static pref '" str                                  \
83
12.8k
               "' being accessed on background thread");                       \
84
12.8k
    return sVarCache_##id;                                                     \
85
12.8k
  }
mozilla::StaticPrefs::dom_performance_enable_scheduler_timing()
Line
Count
Source
80
19
  {                                                                            \
81
19
    MOZ_ASSERT(IsAtomic<cpp_type>::value || NS_IsMainThread(),                 \
82
19
               "Non-atomic static pref '" str                                  \
83
19
               "' being accessed on background thread");                       \
84
19
    return sVarCache_##id;                                                     \
85
19
  }
Unexecuted instantiation: mozilla::StaticPrefs::accessibility_monoaudio_enable()
Unexecuted instantiation: mozilla::StaticPrefs::clipboard_autocopy()
Unexecuted instantiation: mozilla::StaticPrefs::dom_animations_api_compositing_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_animations_api_getAnimations_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_animations_api_implicit_keyframes_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_animations_api_timelines_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_webcomponents_shadowdom_report_usage()
Unexecuted instantiation: mozilla::StaticPrefs::dom_mutation_events_cssom_disabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_payments_request_user_interaction_required()
Unexecuted instantiation: mozilla::StaticPrefs::dom_payments_response_timeout()
Unexecuted instantiation: mozilla::StaticPrefs::canvas_imagebitmap_extensions_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_caches_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_caches_testing_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_performance_enable_user_timing_logging()
Unexecuted instantiation: mozilla::StaticPrefs::dom_webnotifications_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_webnotifications_serviceworker_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_webnotifications_requireinteraction_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_serviceWorkers_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_serviceWorkers_testing_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_storageManager_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_promise_rejection_events_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_push_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_streams_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_webkitBlink_dirPicker_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_netinfo_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_fetchObserver_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_enable_performance_observer()
Unexecuted instantiation: mozilla::StaticPrefs::dom_indexedDB_storageOption_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::dom_script_loader_binast_encoding_enabled()
mozilla::StaticPrefs::browser_dom_window_dump_enabled()
Line
Count
Source
80
3
  {                                                                            \
81
3
    MOZ_ASSERT(IsAtomic<cpp_type>::value || NS_IsMainThread(),                 \
82
3
               "Non-atomic static pref '" str                                  \
83
3
               "' being accessed on background thread");                       \
84
3
    return sVarCache_##id;                                                     \
85
3
  }
Unexecuted instantiation: mozilla::StaticPrefs::dom_worker_canceling_timeoutMilliseconds()
Unexecuted instantiation: mozilla::StaticPrefs::dom_xhr_standard_content_type_normalization()
Unexecuted instantiation: mozilla::StaticPrefs::dom_clearSiteData_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::full_screen_api_unprefix_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::gfx_font_rendering_opentype_svg_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::gfx_offscreencanvas_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::html5_offmainthread()
Unexecuted instantiation: mozilla::StaticPrefs::html5_flushtimer_initialdelay()
Unexecuted instantiation: mozilla::StaticPrefs::html5_flushtimer_subsequentdelay()
Unexecuted instantiation: mozilla::StaticPrefs::layout_accessiblecaret_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::layout_accessiblecaret_enabled_on_touch()
Unexecuted instantiation: mozilla::StaticPrefs::layout_accessiblecaret_always_tilt()
Unexecuted instantiation: mozilla::StaticPrefs::layout_accessiblecaret_caret_shown_when_long_tapping_on_empty_content()
Unexecuted instantiation: mozilla::StaticPrefs::layout_accessiblecaret_script_change_update_mode()
Unexecuted instantiation: mozilla::StaticPrefs::layout_accessiblecaret_allow_dragging_across_other_caret()
Unexecuted instantiation: mozilla::StaticPrefs::layout_accessiblecaret_hapticfeedback()
Unexecuted instantiation: mozilla::StaticPrefs::layout_accessiblecaret_extend_selection_for_phone_number()
Unexecuted instantiation: mozilla::StaticPrefs::layout_accessiblecaret_hide_carets_for_mouse_input()
Unexecuted instantiation: mozilla::StaticPrefs::layout_accessiblecaret_width()
Unexecuted instantiation: mozilla::StaticPrefs::layout_accessiblecaret_height()
Unexecuted instantiation: mozilla::StaticPrefs::layout_accessiblecaret_margin_left()
Unexecuted instantiation: mozilla::StaticPrefs::layout_accessiblecaret_use_long_tap_injector()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_parsing_parallel()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_use_counters_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_report_errors()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_font_display_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_prefixes_webkit()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_prefixes_device_pixel_ratio_webkit()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_prefixes_gradients()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_offset_logical_properties_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_control_characters_visible()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_frames_timing_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_visited_links_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_webkit_appearance_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_moz_document_content_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_moz_document_url_prefix_hack_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_xul_display_values_content_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_xul_box_display_values_content_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_xul_tree_pseudos_content_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_grid_template_subgrid_value_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_font_variations_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_emulate_moz_box_with_flex()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_overflow_moz_scrollbars_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_overflow_break_intrinsic_size()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_unknown_webkit_pseudo_element()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_clip_path_path_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::layout_css_column_span_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::javascript_options_gc_on_memory_pressure()
Unexecuted instantiation: mozilla::StaticPrefs::javascript_options_compact_on_user_inactive()
Unexecuted instantiation: mozilla::StaticPrefs::javascript_options_compact_on_user_inactive_delay()
mozilla::StaticPrefs::javascript_options_mem_log()
Line
Count
Source
80
118
  {                                                                            \
81
118
    MOZ_ASSERT(IsAtomic<cpp_type>::value || NS_IsMainThread(),                 \
82
118
               "Non-atomic static pref '" str                                  \
83
118
               "' being accessed on background thread");                       \
84
118
    return sVarCache_##id;                                                     \
85
118
  }
mozilla::StaticPrefs::javascript_options_mem_notify()
Line
Count
Source
80
18
  {                                                                            \
81
18
    MOZ_ASSERT(IsAtomic<cpp_type>::value || NS_IsMainThread(),                 \
82
18
               "Non-atomic static pref '" str                                  \
83
18
               "' being accessed on background thread");                       \
84
18
    return sVarCache_##id;                                                     \
85
18
  }
Unexecuted instantiation: mozilla::StaticPrefs::MediaCacheSize()
Unexecuted instantiation: mozilla::StaticPrefs::MediaMemoryCacheMaxSize()
Unexecuted instantiation: mozilla::StaticPrefs::MediaMemoryCachesCombinedLimitKb()
Unexecuted instantiation: mozilla::StaticPrefs::MediaMemoryCachesCombinedLimitPcSysmem()
Unexecuted instantiation: mozilla::StaticPrefs::MediaCacheResumeThreshold()
Unexecuted instantiation: mozilla::StaticPrefs::MediaCacheReadaheadLimit()
Unexecuted instantiation: mozilla::StaticPrefs::MediaResamplingEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaForcestereoEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaRuinAvSyncEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaEmeEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaClearkeyPersistentLicenseEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaGmpInsecureAllow()
Unexecuted instantiation: mozilla::StaticPrefs::MediaUseBlankDecoder()
Unexecuted instantiation: mozilla::StaticPrefs::MediaGpuProcessDecoder()
Unexecuted instantiation: mozilla::StaticPrefs::MediaNavigatorMediadatadecoderEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaFfmpegEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaLibavcodecAllowObsolete()
Unexecuted instantiation: mozilla::StaticPrefs::MediaFfvpxEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaFfmpegLowLatencyEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaDecoderRecycleEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaDecoderSkipToNextKeyFrameEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaGmpDecoderEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaEmeAudioBlank()
Unexecuted instantiation: mozilla::StaticPrefs::MediaEmeVideoBlank()
Unexecuted instantiation: mozilla::StaticPrefs::MediaEmeChromiumApiVideoShmems()
Unexecuted instantiation: mozilla::StaticPrefs::MediaSuspendBkgndVideoEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaSuspendBkgndVideoDelayMs()
Unexecuted instantiation: mozilla::StaticPrefs::MediaDormantOnPauseTimeoutMs()
Unexecuted instantiation: mozilla::StaticPrefs::MediaWebspeechSynthForceGlobalQueue()
Unexecuted instantiation: mozilla::StaticPrefs::MediaWebspeechTestEnable()
Unexecuted instantiation: mozilla::StaticPrefs::MediaWebspeechTextFakeFsmEvents()
Unexecuted instantiation: mozilla::StaticPrefs::MediaWebspeechTextFakeRecognitionService()
Unexecuted instantiation: mozilla::StaticPrefs::MediaWebspeechRecognitionEnable()
Unexecuted instantiation: mozilla::StaticPrefs::MediaWebspeechRecognitionForceEnable()
Unexecuted instantiation: mozilla::StaticPrefs::MediaEncoderWebMEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaAudioMaxDecodeError()
Unexecuted instantiation: mozilla::StaticPrefs::MediaVideoMaxDecodeError()
Unexecuted instantiation: mozilla::StaticPrefs::MediaOpusEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaWaveEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaOggEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaWebMEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaAv1Enabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaFlacEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaHlsEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaMp4Enabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaPlaybackWarningsAsErrors()
Unexecuted instantiation: mozilla::StaticPrefs::MediaResumeBkgndVideoOnTabhover()
Unexecuted instantiation: mozilla::StaticPrefs::MediaVideocontrolsLockVideoOrientation()
Unexecuted instantiation: mozilla::StaticPrefs::MediaSeamlessLooping()
Unexecuted instantiation: mozilla::StaticPrefs::MediaBlockEventEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaCapabilitiesEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaCapabilitiesScreenEnabled()
Unexecuted instantiation: mozilla::StaticPrefs::MediaBenchmarkVp9Fps()
Unexecuted instantiation: mozilla::StaticPrefs::MediaBenchmarkVp9Threshold()
Unexecuted instantiation: mozilla::StaticPrefs::MediaBenchmarkVp9Versioncheck()
Unexecuted instantiation: mozilla::StaticPrefs::MediaBenchmarkFrames()
Unexecuted instantiation: mozilla::StaticPrefs::MediaBenchmarkTimeout()
Unexecuted instantiation: mozilla::StaticPrefs::network_auth_subresource_http_auth_allow()
Unexecuted instantiation: mozilla::StaticPrefs::network_auth_subresource_img_cross_origin_http_auth_allow()
Unexecuted instantiation: mozilla::StaticPrefs::network_auth_non_web_content_triggered_resources_http_auth_allow()
Unexecuted instantiation: mozilla::StaticPrefs::network_cookie_cookieBehavior()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_enable_hover_on_ssl()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_enable_prefetch()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_page_degradation_day()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_page_degradation_week()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_page_degradation_month()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_page_degradation_year()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_page_degradation_max()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_subresource_degradation_day()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_subresource_degradation_week()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_subresource_degradation_month()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_subresource_degradation_year()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_subresource_degradation_max()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_prefetch_rolling_load_count()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_prefetch_min_confidence()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_preconnect_min_confidence()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_preresolve_min_confidence()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_prefetch_force_valid_for()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_max_resources_per_entry()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_max_uri_length()
Unexecuted instantiation: mozilla::StaticPrefs::network_predictor_doing_tests()
Unexecuted instantiation: mozilla::StaticPrefs::browser_contentblocking_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::browser_contentblocking_ui_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::browser_contentblocking_allowlist_storage_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::browser_contentblocking_allowlist_annotations_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::browser_fastblock_enabled()
Unexecuted instantiation: mozilla::StaticPrefs::privacy_restrict3rdpartystorage_expiration()
Unexecuted instantiation: mozilla::StaticPrefs::privacy_userInteraction_expiration()
Unexecuted instantiation: mozilla::StaticPrefs::privacy_userInteraction_document_interval()
Unexecuted instantiation: mozilla::StaticPrefs::privacy_resistFingerprinting()
Unexecuted instantiation: mozilla::StaticPrefs::privacy_resistFingerprinting_autoDeclineNoUserInputCanvasPrompts()
Unexecuted instantiation: mozilla::StaticPrefs::security_csp_enable()
mozilla::StaticPrefs::security_csp_experimentalEnabled()
Line
Count
Source
80
12.3k
  {                                                                            \
81
12.3k
    MOZ_ASSERT(IsAtomic<cpp_type>::value || NS_IsMainThread(),                 \
82
12.3k
               "Non-atomic static pref '" str                                  \
83
12.3k
               "' being accessed on background thread");                       \
84
12.3k
    return sVarCache_##id;                                                     \
85
12.3k
  }
mozilla::StaticPrefs::security_csp_enableStrictDynamic()
Line
Count
Source
80
279
  {                                                                            \
81
279
    MOZ_ASSERT(IsAtomic<cpp_type>::value || NS_IsMainThread(),                 \
82
279
               "Non-atomic static pref '" str                                  \
83
279
               "' being accessed on background thread");                       \
84
279
    return sVarCache_##id;                                                     \
85
279
  }
Unexecuted instantiation: mozilla::StaticPrefs::security_csp_reporting_script_sample_max_length()
Unexecuted instantiation: mozilla::StaticPrefs::view_source_editor_external()
Unexecuted instantiation: mozilla::StaticPrefs::devtools_enabled()
86
#include "mozilla/StaticPrefList.h"
87
#undef PREF
88
#undef VARCACHE_PREF
89
90
public:
91
  static void InitAll(bool aIsStartup);
92
};
93
94
} // namespace mozilla
95
96
#endif // mozilla_StaticPrefs_h