/work/obj-fuzz/dist/include/mozilla/Preferences.h
Line | Count | Source (jump to first uncovered line) |
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_Preferences_h |
8 | | #define mozilla_Preferences_h |
9 | | |
10 | | #ifndef MOZILLA_INTERNAL_API |
11 | | #error "This header is only usable from within libxul (MOZILLA_INTERNAL_API)." |
12 | | #endif |
13 | | |
14 | | #include "mozilla/Atomics.h" |
15 | | #include "mozilla/MemoryReporting.h" |
16 | | #include "mozilla/Result.h" |
17 | | #include "mozilla/StaticPtr.h" |
18 | | #include "nsCOMPtr.h" |
19 | | #include "nsIObserver.h" |
20 | | #include "nsIPrefBranch.h" |
21 | | #include "nsIPrefService.h" |
22 | | #include "nsPrintfCString.h" |
23 | | #include "nsString.h" |
24 | | #include "nsTArray.h" |
25 | | #include "nsWeakReference.h" |
26 | | |
27 | | class nsIFile; |
28 | | |
29 | | // The callback function will get passed the pref name which triggered the call |
30 | | // and the void* data which was passed to the registered callback function. |
31 | | typedef void (*PrefChangedFunc)(const char* aPref, void* aData); |
32 | | |
33 | | class nsPrefBranch; |
34 | | |
35 | | namespace mozilla { |
36 | | |
37 | | // A typesafe version of PrefChangeFunc, with its data argument type deduced |
38 | | // from the type of the argument passed to RegisterCallback. |
39 | | // |
40 | | // Note: We specify this as a dependent type TypedPrefChangeFunc<T>::SelfType so |
41 | | // that it does not participate in argument type deduction. This allows us to |
42 | | // use its implicit conversion constructor, and also allows our Register and |
43 | | // Unregister methods to accept non-capturing lambdas (which will not match |
44 | | // void(*)(const char*, T*) when used in type deduction) as callback functions. |
45 | | template<typename T> |
46 | | struct TypedPrefChangeFunc |
47 | | { |
48 | | using Type = TypedPrefChangeFunc<T>; |
49 | | using CallbackType = void (*)(const char*, T*); |
50 | | |
51 | | MOZ_IMPLICIT TypedPrefChangeFunc(CallbackType aCallback) |
52 | | : mCallback(aCallback) |
53 | 124 | { |
54 | 124 | } mozilla::TypedPrefChangeFunc<void>::TypedPrefChangeFunc(void (*)(char const*, void*)) Line | Count | Source | 53 | 81 | { | 54 | 81 | } |
Unexecuted instantiation: Unified_cpp_netwerk_base1.cpp:mozilla::TypedPrefChangeFunc<mozilla::net::(anonymous namespace)::CachedPrefs>::TypedPrefChangeFunc(void (*)(char const*, mozilla::net::(anonymous namespace)::CachedPrefs*)) mozilla::TypedPrefChangeFunc<mozilla::net::nsIOService>::TypedPrefChangeFunc(void (*)(char const*, mozilla::net::nsIOService*)) Line | Count | Source | 53 | 3 | { | 54 | 3 | } |
mozilla::TypedPrefChangeFunc<mozilla::net::nsSocketTransportService>::TypedPrefChangeFunc(void (*)(char const*, mozilla::net::nsSocketTransportService*)) Line | Count | Source | 53 | 3 | { | 54 | 3 | } |
mozilla::TypedPrefChangeFunc<nsHostResolver>::TypedPrefChangeFunc(void (*)(char const*, nsHostResolver*)) Line | Count | Source | 53 | 6 | { | 54 | 6 | } |
mozilla::TypedPrefChangeFunc<nsIDNService>::TypedPrefChangeFunc(void (*)(char const*, nsIDNService*)) Line | Count | Source | 53 | 3 | { | 54 | 3 | } |
Unexecuted instantiation: mozilla::TypedPrefChangeFunc<nsCacheProfilePrefObserver>::TypedPrefChangeFunc(void (*)(char const*, nsCacheProfilePrefObserver*)) mozilla::TypedPrefChangeFunc<mozilla::net::nsHttpHandler>::TypedPrefChangeFunc(void (*)(char const*, mozilla::net::nsHttpHandler*)) Line | Count | Source | 53 | 1 | { | 54 | 1 | } |
mozilla::TypedPrefChangeFunc<WatchdogManager>::TypedPrefChangeFunc(void (*)(char const*, WatchdogManager*)) Line | Count | Source | 53 | 3 | { | 54 | 3 | } |
mozilla::TypedPrefChangeFunc<XPCJSContext>::TypedPrefChangeFunc(void (*)(char const*, XPCJSContext*)) Line | Count | Source | 53 | 6 | { | 54 | 6 | } |
mozilla::TypedPrefChangeFunc<nsScriptSecurityManager>::TypedPrefChangeFunc(void (*)(char const*, nsScriptSecurityManager*)) Line | Count | Source | 53 | 3 | { | 54 | 3 | } |
Unexecuted instantiation: mozilla::TypedPrefChangeFunc<gfxPrefs::Pref>::TypedPrefChangeFunc(void (*)(char const*, gfxPrefs::Pref*)) Unexecuted instantiation: Unified_cpp_dom_base7.cpp:mozilla::TypedPrefChangeFunc<(anonymous namespace)::PrefStore>::TypedPrefChangeFunc(void (*)(char const*, (anonymous namespace)::PrefStore*)) mozilla::TypedPrefChangeFunc<nsFocusManager>::TypedPrefChangeFunc(void (*)(char const*, nsFocusManager*)) Line | Count | Source | 53 | 3 | { | 54 | 3 | } |
mozilla::TypedPrefChangeFunc<nsNameSpaceManager>::TypedPrefChangeFunc(void (*)(char const*, nsNameSpaceManager*)) Line | Count | Source | 53 | 3 | { | 54 | 3 | } |
Unexecuted instantiation: mozilla::TypedPrefChangeFunc<mozilla::plugins::PluginModuleParent>::TypedPrefChangeFunc(void (*)(char const*, mozilla::plugins::PluginModuleParent*)) Unexecuted instantiation: mozilla::TypedPrefChangeFunc<mozilla::plugins::PluginModuleChromeParent>::TypedPrefChangeFunc(void (*)(char const*, mozilla::plugins::PluginModuleChromeParent*)) Unexecuted instantiation: mozilla::TypedPrefChangeFunc<mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void> >::TypedPrefChangeFunc(void (*)(char const*, mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void>*)) Unexecuted instantiation: mozilla::TypedPrefChangeFunc<mozilla::dom::XULDocument>::TypedPrefChangeFunc(void (*)(char const*, mozilla::dom::XULDocument*)) mozilla::TypedPrefChangeFunc<ComputedStyleMap>::TypedPrefChangeFunc(void (*)(char const*, ComputedStyleMap*)) Line | Count | Source | 53 | 3 | { | 54 | 3 | } |
Unexecuted instantiation: mozilla::TypedPrefChangeFunc<nsPresContext>::TypedPrefChangeFunc(void (*)(char const*, nsPresContext*)) mozilla::TypedPrefChangeFunc<nsSHistoryObserver>::TypedPrefChangeFunc(void (*)(char const*, nsSHistoryObserver*)) Line | Count | Source | 53 | 3 | { | 54 | 3 | } |
Unexecuted instantiation: mozilla::TypedPrefChangeFunc<CertBlocklist>::TypedPrefChangeFunc(void (*)(char const*, CertBlocklist*)) Unexecuted instantiation: mozilla::TypedPrefChangeFunc<mozilla::DataStorage>::TypedPrefChangeFunc(void (*)(char const*, mozilla::DataStorage*)) Unexecuted instantiation: mozilla::TypedPrefChangeFunc<nsNavHistoryResult>::TypedPrefChangeFunc(void (*)(char const*, nsNavHistoryResult*)) mozilla::TypedPrefChangeFunc<mozilla::nsRFPService>::TypedPrefChangeFunc(void (*)(char const*, mozilla::nsRFPService*)) Line | Count | Source | 53 | 3 | { | 54 | 3 | } |
|
55 | | |
56 | | template<typename F> |
57 | | MOZ_IMPLICIT TypedPrefChangeFunc(F&& aLambda) |
58 | | : mCallback(aLambda) |
59 | | { |
60 | | } |
61 | | |
62 | | operator PrefChangedFunc() const |
63 | 124 | { |
64 | 124 | return reinterpret_cast<PrefChangedFunc>(mCallback); |
65 | 124 | } mozilla::TypedPrefChangeFunc<void>::operator void (*)(char const*, void*)() const Line | Count | Source | 63 | 81 | { | 64 | 81 | return reinterpret_cast<PrefChangedFunc>(mCallback); | 65 | 81 | } |
Unexecuted instantiation: Unified_cpp_netwerk_base1.cpp:mozilla::TypedPrefChangeFunc<mozilla::net::(anonymous namespace)::CachedPrefs>::operator void (*)(char const*, void*)() const mozilla::TypedPrefChangeFunc<mozilla::net::nsIOService>::operator void (*)(char const*, void*)() const Line | Count | Source | 63 | 3 | { | 64 | 3 | return reinterpret_cast<PrefChangedFunc>(mCallback); | 65 | 3 | } |
mozilla::TypedPrefChangeFunc<mozilla::net::nsSocketTransportService>::operator void (*)(char const*, void*)() const Line | Count | Source | 63 | 3 | { | 64 | 3 | return reinterpret_cast<PrefChangedFunc>(mCallback); | 65 | 3 | } |
mozilla::TypedPrefChangeFunc<nsHostResolver>::operator void (*)(char const*, void*)() const Line | Count | Source | 63 | 6 | { | 64 | 6 | return reinterpret_cast<PrefChangedFunc>(mCallback); | 65 | 6 | } |
mozilla::TypedPrefChangeFunc<nsIDNService>::operator void (*)(char const*, void*)() const Line | Count | Source | 63 | 3 | { | 64 | 3 | return reinterpret_cast<PrefChangedFunc>(mCallback); | 65 | 3 | } |
Unexecuted instantiation: mozilla::TypedPrefChangeFunc<nsCacheProfilePrefObserver>::operator void (*)(char const*, void*)() const mozilla::TypedPrefChangeFunc<mozilla::net::nsHttpHandler>::operator void (*)(char const*, void*)() const Line | Count | Source | 63 | 1 | { | 64 | 1 | return reinterpret_cast<PrefChangedFunc>(mCallback); | 65 | 1 | } |
mozilla::TypedPrefChangeFunc<WatchdogManager>::operator void (*)(char const*, void*)() const Line | Count | Source | 63 | 3 | { | 64 | 3 | return reinterpret_cast<PrefChangedFunc>(mCallback); | 65 | 3 | } |
mozilla::TypedPrefChangeFunc<XPCJSContext>::operator void (*)(char const*, void*)() const Line | Count | Source | 63 | 6 | { | 64 | 6 | return reinterpret_cast<PrefChangedFunc>(mCallback); | 65 | 6 | } |
mozilla::TypedPrefChangeFunc<nsScriptSecurityManager>::operator void (*)(char const*, void*)() const Line | Count | Source | 63 | 3 | { | 64 | 3 | return reinterpret_cast<PrefChangedFunc>(mCallback); | 65 | 3 | } |
Unexecuted instantiation: mozilla::TypedPrefChangeFunc<gfxPrefs::Pref>::operator void (*)(char const*, void*)() const Unexecuted instantiation: Unified_cpp_dom_base7.cpp:mozilla::TypedPrefChangeFunc<(anonymous namespace)::PrefStore>::operator void (*)(char const*, void*)() const mozilla::TypedPrefChangeFunc<nsFocusManager>::operator void (*)(char const*, void*)() const Line | Count | Source | 63 | 3 | { | 64 | 3 | return reinterpret_cast<PrefChangedFunc>(mCallback); | 65 | 3 | } |
mozilla::TypedPrefChangeFunc<nsNameSpaceManager>::operator void (*)(char const*, void*)() const Line | Count | Source | 63 | 3 | { | 64 | 3 | return reinterpret_cast<PrefChangedFunc>(mCallback); | 65 | 3 | } |
Unexecuted instantiation: mozilla::TypedPrefChangeFunc<mozilla::plugins::PluginModuleParent>::operator void (*)(char const*, void*)() const Unexecuted instantiation: mozilla::TypedPrefChangeFunc<mozilla::plugins::PluginModuleChromeParent>::operator void (*)(char const*, void*)() const Unexecuted instantiation: mozilla::TypedPrefChangeFunc<mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void> >::operator void (*)(char const*, void*)() const Unexecuted instantiation: mozilla::TypedPrefChangeFunc<mozilla::dom::XULDocument>::operator void (*)(char const*, void*)() const mozilla::TypedPrefChangeFunc<ComputedStyleMap>::operator void (*)(char const*, void*)() const Line | Count | Source | 63 | 3 | { | 64 | 3 | return reinterpret_cast<PrefChangedFunc>(mCallback); | 65 | 3 | } |
Unexecuted instantiation: mozilla::TypedPrefChangeFunc<nsPresContext>::operator void (*)(char const*, void*)() const mozilla::TypedPrefChangeFunc<nsSHistoryObserver>::operator void (*)(char const*, void*)() const Line | Count | Source | 63 | 3 | { | 64 | 3 | return reinterpret_cast<PrefChangedFunc>(mCallback); | 65 | 3 | } |
Unexecuted instantiation: mozilla::TypedPrefChangeFunc<CertBlocklist>::operator void (*)(char const*, void*)() const Unexecuted instantiation: mozilla::TypedPrefChangeFunc<mozilla::DataStorage>::operator void (*)(char const*, void*)() const Unexecuted instantiation: mozilla::TypedPrefChangeFunc<nsNavHistoryResult>::operator void (*)(char const*, void*)() const mozilla::TypedPrefChangeFunc<mozilla::nsRFPService>::operator void (*)(char const*, void*)() const Line | Count | Source | 63 | 3 | { | 64 | 3 | return reinterpret_cast<PrefChangedFunc>(mCallback); | 65 | 3 | } |
|
66 | | |
67 | | CallbackType mCallback; |
68 | | }; |
69 | | |
70 | | // Similar to PrefChangedFunc, but for use with instance methods. |
71 | | // |
72 | | // Any instance method with this signature may be passed to the |
73 | | // PREF_CHANGE_METHOD macro, which will wrap it into a typesafe preference |
74 | | // callback function, which accepts a preference name as its first argument, and |
75 | | // an instance of the appropriate class as the second. |
76 | | // |
77 | | // When called, the wrapper will forward the call to the wrapped method on the |
78 | | // given instance, with the notified preference as its only argument. |
79 | | typedef void(PrefChangedMethod)(const char* aPref); |
80 | | |
81 | | namespace detail { |
82 | | // Helper to extract the instance type from any instance method. For an instance |
83 | | // method `Method = U T::*`, InstanceType<Method>::Type returns T. |
84 | | template<typename T> |
85 | | struct InstanceType; |
86 | | |
87 | | template<typename T, typename U> |
88 | | struct InstanceType<U T::*> |
89 | | { |
90 | | using Type = T; |
91 | | }; |
92 | | |
93 | | // A wrapper for a PrefChangeMethod instance method which forwards calls to the |
94 | | // wrapped method on the given instance. |
95 | | template<typename T, PrefChangedMethod T::*Method> |
96 | | void |
97 | | PrefChangeMethod(const char* aPref, T* aInst) |
98 | 0 | { |
99 | 0 | ((*aInst).*Method)(aPref); |
100 | 0 | } Unexecuted instantiation: void mozilla::detail::PrefChangeMethod<mozilla::net::nsIOService, &mozilla::net::nsIOService::PrefsChanged>(char const*, mozilla::net::nsIOService*) Unexecuted instantiation: void mozilla::detail::PrefChangeMethod<nsCacheProfilePrefObserver, &nsCacheProfilePrefObserver::PrefChanged>(char const*, nsCacheProfilePrefObserver*) Unexecuted instantiation: void mozilla::detail::PrefChangeMethod<mozilla::net::nsHttpHandler, &mozilla::net::nsHttpHandler::PrefsChanged>(char const*, mozilla::net::nsHttpHandler*) Unexecuted instantiation: void mozilla::detail::PrefChangeMethod<nsScriptSecurityManager, &nsScriptSecurityManager::ScriptSecurityPrefChanged>(char const*, nsScriptSecurityManager*) Unexecuted instantiation: Unified_cpp_dom_base7.cpp:void mozilla::detail::PrefChangeMethod<(anonymous namespace)::PrefStore, &(anonymous namespace)::PrefStore::UpdateStringPrefs>(char const*, (anonymous namespace)::PrefStore*) Unexecuted instantiation: void mozilla::detail::PrefChangeMethod<nsFocusManager, &nsFocusManager::PrefChanged>(char const*, nsFocusManager*) Unexecuted instantiation: void mozilla::detail::PrefChangeMethod<nsNameSpaceManager, &nsNameSpaceManager::PrefChanged>(char const*, nsNameSpaceManager*) Unexecuted instantiation: void mozilla::detail::PrefChangeMethod<nsPresContext, &nsPresContext::PreferenceChanged>(char const*, nsPresContext*) Unexecuted instantiation: void mozilla::detail::PrefChangeMethod<nsSHistoryObserver, &nsSHistoryObserver::PrefChanged>(char const*, nsSHistoryObserver*) Unexecuted instantiation: void mozilla::detail::PrefChangeMethod<mozilla::DataStorage, &mozilla::DataStorage::PrefChanged>(char const*, mozilla::DataStorage*) Unexecuted instantiation: void mozilla::detail::PrefChangeMethod<mozilla::nsRFPService, &mozilla::nsRFPService::PrefChanged>(char const*, mozilla::nsRFPService*) |
101 | | } // namespace detail |
102 | | |
103 | | // Creates a wrapper around an instance method, with the signature of |
104 | | // PrefChangedMethod, from an arbitrary class, so that it can be used as a |
105 | | // preference callback. The closure data passed to RegisterCallback must be an |
106 | | // instance of this class. |
107 | | // |
108 | | // Note: This is implemented as a macro rather than a pure template function |
109 | | // because, prior to C++17, value template arguments must have their types |
110 | | // fully-specified. Once all of our supported compilers have C++17 support, we |
111 | | // can give PrefChangeMethod a single <auto Method> argument, and use |
112 | | // PrefChangeMethod<&meth> directly. |
113 | | #define PREF_CHANGE_METHOD(meth) \ |
114 | 19 | (&::mozilla::detail::PrefChangeMethod< \ |
115 | 19 | ::mozilla::detail::InstanceType<decltype(&meth)>::Type, \ |
116 | 19 | &meth>) |
117 | | |
118 | | class PreferenceServiceReporter; |
119 | | |
120 | | namespace dom { |
121 | | class Pref; |
122 | | class PrefValue; |
123 | | } // namespace dom |
124 | | |
125 | | namespace ipc { |
126 | | class FileDescriptor; |
127 | | } // namespace ipc |
128 | | |
129 | | struct PrefsSizes; |
130 | | |
131 | | // Xlib.h defines Bool as a macro constant. Don't try to define this enum if |
132 | | // it's already been included. |
133 | | #ifndef Bool |
134 | | |
135 | | // Keep this in sync with PrefType in parser/src/lib.rs. |
136 | | enum class PrefType : uint8_t |
137 | | { |
138 | | None = 0, // only used when neither the default nor user value is set |
139 | | String = 1, |
140 | | Int = 2, |
141 | | Bool = 3, |
142 | | }; |
143 | | |
144 | | #endif |
145 | | |
146 | | #ifdef XP_UNIX |
147 | | // We need to send two shared memory descriptors to every child process: |
148 | | // |
149 | | // 1) A read-only/write-protected snapshot of the initial state of the |
150 | | // preference database. This memory is shared between all processes, and |
151 | | // therefore cannot be modified once it has been created. |
152 | | // |
153 | | // 2) A set of changes on top of the snapshot, containing the current values of |
154 | | // all preferences which have changed since it was created. |
155 | | // |
156 | | // Since the second set will be different for every process, and the first set |
157 | | // cannot be modified, it is unfortunately not possible to combine them into a |
158 | | // single file descriptor. |
159 | | // |
160 | | // XXX: bug 1440207 is about improving how fixed fds such as this are used. |
161 | | static const int kPrefsFileDescriptor = 8; |
162 | | static const int kPrefMapFileDescriptor = 9; |
163 | | #endif |
164 | | |
165 | | // Keep this in sync with PrefType in parser/src/lib.rs. |
166 | | enum class PrefValueKind : uint8_t |
167 | | { |
168 | | Default, |
169 | | User |
170 | | }; |
171 | | |
172 | | class Preferences final |
173 | | : public nsIPrefService |
174 | | , public nsIObserver |
175 | | , public nsIPrefBranch |
176 | | , public nsSupportsWeakReference |
177 | | { |
178 | | friend class ::nsPrefBranch; |
179 | | |
180 | | public: |
181 | | NS_DECL_THREADSAFE_ISUPPORTS |
182 | | NS_DECL_NSIPREFSERVICE |
183 | | NS_FORWARD_NSIPREFBRANCH(mRootBranch->) |
184 | | NS_DECL_NSIOBSERVER |
185 | | |
186 | | Preferences(); |
187 | | |
188 | | // Returns true if the Preferences service is available, false otherwise. |
189 | | static bool IsServiceAvailable(); |
190 | | |
191 | | // Initialize user prefs from prefs.js/user.js |
192 | | static void InitializeUserPrefs(); |
193 | | |
194 | | // Returns the singleton instance which is addreffed. |
195 | | static already_AddRefed<Preferences> GetInstanceForService(); |
196 | | |
197 | | // Finallizes global members. |
198 | | static void Shutdown(); |
199 | | |
200 | | // Returns shared pref service instance NOTE: not addreffed. |
201 | | static nsIPrefService* GetService() |
202 | 0 | { |
203 | 0 | NS_ENSURE_TRUE(InitStaticMembers(), nullptr); |
204 | 0 | return sPreferences; |
205 | 0 | } |
206 | | |
207 | | // Returns shared pref branch instance. NOTE: not addreffed. |
208 | | static nsIPrefBranch* GetRootBranch(PrefValueKind aKind = PrefValueKind::User) |
209 | 6 | { |
210 | 6 | NS_ENSURE_TRUE(InitStaticMembers(), nullptr); |
211 | 6 | return (aKind == PrefValueKind::Default) ? sPreferences->mDefaultRootBranch |
212 | 6 | : sPreferences->mRootBranch; |
213 | 6 | } |
214 | | |
215 | | // Gets the type of the pref. |
216 | | static int32_t GetType(const char* aPrefName); |
217 | | |
218 | | // Fallible value getters. When `aKind` is `User` they will get the user |
219 | | // value if possible, and fall back to the default value otherwise. |
220 | | static nsresult GetBool(const char* aPrefName, |
221 | | bool* aResult, |
222 | | PrefValueKind aKind = PrefValueKind::User); |
223 | | static nsresult GetInt(const char* aPrefName, |
224 | | int32_t* aResult, |
225 | | PrefValueKind aKind = PrefValueKind::User); |
226 | | static nsresult GetUint(const char* aPrefName, |
227 | | uint32_t* aResult, |
228 | | PrefValueKind aKind = PrefValueKind::User) |
229 | 93 | { |
230 | 93 | return GetInt(aPrefName, reinterpret_cast<int32_t*>(aResult), aKind); |
231 | 93 | } |
232 | | static nsresult GetFloat(const char* aPrefName, |
233 | | float* aResult, |
234 | | PrefValueKind aKind = PrefValueKind::User); |
235 | | static nsresult GetCString(const char* aPrefName, |
236 | | nsACString& aResult, |
237 | | PrefValueKind aKind = PrefValueKind::User); |
238 | | static nsresult GetString(const char* aPrefName, |
239 | | nsAString& aResult, |
240 | | PrefValueKind aKind = PrefValueKind::User); |
241 | | static nsresult GetLocalizedCString( |
242 | | const char* aPrefName, |
243 | | nsACString& aResult, |
244 | | PrefValueKind aKind = PrefValueKind::User); |
245 | | static nsresult GetLocalizedString(const char* aPrefName, |
246 | | nsAString& aResult, |
247 | | PrefValueKind aKind = PrefValueKind::User); |
248 | | static nsresult GetComplex(const char* aPrefName, |
249 | | const nsIID& aType, |
250 | | void** aResult, |
251 | | PrefValueKind aKind = PrefValueKind::User); |
252 | | |
253 | | // Infallible getters of user or default values, with fallback results on |
254 | | // failure. When `aKind` is `User` they will get the user value if possible, |
255 | | // and fall back to the default value otherwise. |
256 | | static bool GetBool(const char* aPrefName, |
257 | | bool aFallback = false, |
258 | | PrefValueKind aKind = PrefValueKind::User) |
259 | 1.93M | { |
260 | 1.93M | bool result = aFallback; |
261 | 1.93M | GetBool(aPrefName, &result, aKind); |
262 | 1.93M | return result; |
263 | 1.93M | } |
264 | | static int32_t GetInt(const char* aPrefName, |
265 | | int32_t aFallback = 0, |
266 | | PrefValueKind aKind = PrefValueKind::User) |
267 | 114 | { |
268 | 114 | int32_t result = aFallback; |
269 | 114 | GetInt(aPrefName, &result, aKind); |
270 | 114 | return result; |
271 | 114 | } |
272 | | static uint32_t GetUint(const char* aPrefName, |
273 | | uint32_t aFallback = 0, |
274 | | PrefValueKind aKind = PrefValueKind::User) |
275 | 72 | { |
276 | 72 | uint32_t result = aFallback; |
277 | 72 | GetUint(aPrefName, &result, aKind); |
278 | 72 | return result; |
279 | 72 | } |
280 | | static float GetFloat(const char* aPrefName, |
281 | | float aFallback = 0.0f, |
282 | | PrefValueKind aKind = PrefValueKind::User) |
283 | 0 | { |
284 | 0 | float result = aFallback; |
285 | 0 | GetFloat(aPrefName, &result, aKind); |
286 | 0 | return result; |
287 | 0 | } |
288 | | |
289 | | // Value setters. These fail if run outside the parent process. |
290 | | |
291 | | static nsresult SetBool(const char* aPrefName, |
292 | | bool aValue, |
293 | | PrefValueKind aKind = PrefValueKind::User); |
294 | | static nsresult SetInt(const char* aPrefName, |
295 | | int32_t aValue, |
296 | | PrefValueKind aKind = PrefValueKind::User); |
297 | | static nsresult SetCString(const char* aPrefName, |
298 | | const nsACString& aValue, |
299 | | PrefValueKind aKind = PrefValueKind::User); |
300 | | |
301 | | static nsresult SetUint(const char* aPrefName, |
302 | | uint32_t aValue, |
303 | | PrefValueKind aKind = PrefValueKind::User) |
304 | 0 | { |
305 | 0 | return SetInt(aPrefName, static_cast<int32_t>(aValue), aKind); |
306 | 0 | } |
307 | | |
308 | | static nsresult SetFloat(const char* aPrefName, |
309 | | float aValue, |
310 | | PrefValueKind aKind = PrefValueKind::User) |
311 | 0 | { |
312 | 0 | return SetCString(aPrefName, nsPrintfCString("%f", aValue), aKind); |
313 | 0 | } |
314 | | |
315 | | static nsresult SetCString(const char* aPrefName, |
316 | | const char* aValue, |
317 | | PrefValueKind aKind = PrefValueKind::User) |
318 | 0 | { |
319 | 0 | return Preferences::SetCString( |
320 | 0 | aPrefName, nsDependentCString(aValue), aKind); |
321 | 0 | } |
322 | | |
323 | | static nsresult SetString(const char* aPrefName, |
324 | | const char16ptr_t aValue, |
325 | | PrefValueKind aKind = PrefValueKind::User) |
326 | 0 | { |
327 | 0 | return Preferences::SetCString( |
328 | 0 | aPrefName, NS_ConvertUTF16toUTF8(aValue), aKind); |
329 | 0 | } |
330 | | |
331 | | static nsresult SetString(const char* aPrefName, |
332 | | const nsAString& aValue, |
333 | | PrefValueKind aKind = PrefValueKind::User) |
334 | 0 | { |
335 | 0 | return Preferences::SetCString( |
336 | 0 | aPrefName, NS_ConvertUTF16toUTF8(aValue), aKind); |
337 | 0 | } |
338 | | |
339 | | static nsresult SetComplex(const char* aPrefName, |
340 | | const nsIID& aType, |
341 | | nsISupports* aValue, |
342 | | PrefValueKind aKind = PrefValueKind::User); |
343 | | |
344 | | static nsresult Lock(const char* aPrefName); |
345 | | static nsresult Unlock(const char* aPrefName); |
346 | | static bool IsLocked(const char* aPrefName); |
347 | | |
348 | | // Clears user set pref. Fails if run outside the parent process. |
349 | | static nsresult ClearUser(const char* aPrefName); |
350 | | |
351 | | // Whether the pref has a user value or not. |
352 | | static bool HasUserValue(const char* aPref); |
353 | | |
354 | | // Adds/Removes the observer for the root pref branch. See nsIPrefBranch.idl |
355 | | // for details. |
356 | | static nsresult AddStrongObserver(nsIObserver* aObserver, |
357 | | const nsACString& aPref); |
358 | | static nsresult AddWeakObserver(nsIObserver* aObserver, |
359 | | const nsACString& aPref); |
360 | | static nsresult RemoveObserver(nsIObserver* aObserver, |
361 | | const nsACString& aPref); |
362 | | |
363 | | template<int N> |
364 | | static nsresult AddStrongObserver(nsIObserver* aObserver, |
365 | | const char (&aPref)[N]) |
366 | 18 | { |
367 | 18 | return AddStrongObserver(aObserver, nsLiteralCString(aPref)); |
368 | 18 | } nsresult mozilla::Preferences::AddStrongObserver<9>(nsIObserver*, char const (&) [9]) Line | Count | Source | 366 | 3 | { | 367 | 3 | return AddStrongObserver(aObserver, nsLiteralCString(aPref)); | 368 | 3 | } |
nsresult mozilla::Preferences::AddStrongObserver<33>(nsIObserver*, char const (&) [33]) Line | Count | Source | 366 | 3 | { | 367 | 3 | return AddStrongObserver(aObserver, nsLiteralCString(aPref)); | 368 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::AddStrongObserver<22>(nsIObserver*, char const (&) [22]) Unexecuted instantiation: nsresult mozilla::Preferences::AddStrongObserver<15>(nsIObserver*, char const (&) [15]) Unexecuted instantiation: nsresult mozilla::Preferences::AddStrongObserver<1>(nsIObserver*, char const (&) [1]) Unexecuted instantiation: nsresult mozilla::Preferences::AddStrongObserver<21>(nsIObserver*, char const (&) [21]) nsresult mozilla::Preferences::AddStrongObserver<43>(nsIObserver*, char const (&) [43]) Line | Count | Source | 366 | 3 | { | 367 | 3 | return AddStrongObserver(aObserver, nsLiteralCString(aPref)); | 368 | 3 | } |
nsresult mozilla::Preferences::AddStrongObserver<35>(nsIObserver*, char const (&) [35]) Line | Count | Source | 366 | 3 | { | 367 | 3 | return AddStrongObserver(aObserver, nsLiteralCString(aPref)); | 368 | 3 | } |
nsresult mozilla::Preferences::AddStrongObserver<42>(nsIObserver*, char const (&) [42]) Line | Count | Source | 366 | 3 | { | 367 | 3 | return AddStrongObserver(aObserver, nsLiteralCString(aPref)); | 368 | 3 | } |
nsresult mozilla::Preferences::AddStrongObserver<59>(nsIObserver*, char const (&) [59]) Line | Count | Source | 366 | 3 | { | 367 | 3 | return AddStrongObserver(aObserver, nsLiteralCString(aPref)); | 368 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::AddStrongObserver<36>(nsIObserver*, char const (&) [36]) Unexecuted instantiation: nsresult mozilla::Preferences::AddStrongObserver<10>(nsIObserver*, char const (&) [10]) Unexecuted instantiation: nsresult mozilla::Preferences::AddStrongObserver<48>(nsIObserver*, char const (&) [48]) Unexecuted instantiation: nsresult mozilla::Preferences::AddStrongObserver<37>(nsIObserver*, char const (&) [37]) Unexecuted instantiation: nsresult mozilla::Preferences::AddStrongObserver<44>(nsIObserver*, char const (&) [44]) Unexecuted instantiation: nsresult mozilla::Preferences::AddStrongObserver<61>(nsIObserver*, char const (&) [61]) Unexecuted instantiation: nsresult mozilla::Preferences::AddStrongObserver<30>(nsIObserver*, char const (&) [30]) Unexecuted instantiation: nsresult mozilla::Preferences::AddStrongObserver<39>(nsIObserver*, char const (&) [39]) |
369 | | template<int N> |
370 | | static nsresult AddWeakObserver(nsIObserver* aObserver, |
371 | | const char (&aPref)[N]) |
372 | 0 | { |
373 | 0 | return AddWeakObserver(aObserver, nsLiteralCString(aPref)); |
374 | 0 | } Unexecuted instantiation: nsresult mozilla::Preferences::AddWeakObserver<22>(nsIObserver*, char const (&) [22]) Unexecuted instantiation: nsresult mozilla::Preferences::AddWeakObserver<16>(nsIObserver*, char const (&) [16]) Unexecuted instantiation: nsresult mozilla::Preferences::AddWeakObserver<34>(nsIObserver*, char const (&) [34]) Unexecuted instantiation: nsresult mozilla::Preferences::AddWeakObserver<33>(nsIObserver*, char const (&) [33]) Unexecuted instantiation: nsresult mozilla::Preferences::AddWeakObserver<32>(nsIObserver*, char const (&) [32]) Unexecuted instantiation: nsresult mozilla::Preferences::AddWeakObserver<18>(nsIObserver*, char const (&) [18]) |
375 | | template<int N> |
376 | | static nsresult RemoveObserver(nsIObserver* aObserver, const char (&aPref)[N]) |
377 | 0 | { |
378 | 0 | return RemoveObserver(aObserver, nsLiteralCString(aPref)); |
379 | 0 | } Unexecuted instantiation: nsresult mozilla::Preferences::RemoveObserver<22>(nsIObserver*, char const (&) [22]) Unexecuted instantiation: nsresult mozilla::Preferences::RemoveObserver<16>(nsIObserver*, char const (&) [16]) Unexecuted instantiation: nsresult mozilla::Preferences::RemoveObserver<34>(nsIObserver*, char const (&) [34]) Unexecuted instantiation: nsresult mozilla::Preferences::RemoveObserver<33>(nsIObserver*, char const (&) [33]) Unexecuted instantiation: nsresult mozilla::Preferences::RemoveObserver<32>(nsIObserver*, char const (&) [32]) Unexecuted instantiation: nsresult mozilla::Preferences::RemoveObserver<1>(nsIObserver*, char const (&) [1]) Unexecuted instantiation: nsresult mozilla::Preferences::RemoveObserver<21>(nsIObserver*, char const (&) [21]) Unexecuted instantiation: nsresult mozilla::Preferences::RemoveObserver<36>(nsIObserver*, char const (&) [36]) Unexecuted instantiation: nsresult mozilla::Preferences::RemoveObserver<10>(nsIObserver*, char const (&) [10]) Unexecuted instantiation: nsresult mozilla::Preferences::RemoveObserver<48>(nsIObserver*, char const (&) [48]) Unexecuted instantiation: nsresult mozilla::Preferences::RemoveObserver<37>(nsIObserver*, char const (&) [37]) |
380 | | |
381 | | // Adds/Removes two or more observers for the root pref branch. Pass to |
382 | | // aPrefs an array of const char* whose last item is nullptr. |
383 | | // Note: All preference strings *must* be statically-allocated string |
384 | | // literals. |
385 | | static nsresult AddStrongObservers(nsIObserver* aObserver, |
386 | | const char** aPrefs); |
387 | | static nsresult AddWeakObservers(nsIObserver* aObserver, const char** aPrefs); |
388 | | static nsresult RemoveObservers(nsIObserver* aObserver, const char** aPrefs); |
389 | | |
390 | | // Registers/Unregisters the callback function for the aPref. |
391 | | template<typename T = void> |
392 | | static nsresult RegisterCallback( |
393 | | typename TypedPrefChangeFunc<T>::Type aCallback, |
394 | | const nsACString& aPref, |
395 | | T* aClosure = nullptr) |
396 | 0 | { |
397 | 0 | return RegisterCallback(aCallback, aPref, aClosure, ExactMatch); |
398 | 0 | } |
399 | | |
400 | | template<typename T = void> |
401 | | static nsresult UnregisterCallback( |
402 | | typename TypedPrefChangeFunc<T>::Type aCallback, |
403 | | const nsACString& aPref, |
404 | | T* aClosure = nullptr) |
405 | 0 | { |
406 | 0 | return UnregisterCallback(aCallback, aPref, aClosure, ExactMatch); |
407 | 0 | } |
408 | | |
409 | | // Like RegisterCallback, but also calls the callback immediately for |
410 | | // initialization. |
411 | | template<typename T = void> |
412 | | static nsresult RegisterCallbackAndCall( |
413 | | typename TypedPrefChangeFunc<T>::Type aCallback, |
414 | | const nsACString& aPref, |
415 | | T* aClosure = nullptr) |
416 | | { |
417 | | return RegisterCallbackAndCall(aCallback, aPref, aClosure, ExactMatch); |
418 | | } |
419 | | |
420 | | // Like RegisterCallback, but registers a callback for a prefix of multiple |
421 | | // pref names, not a single pref name. |
422 | | template<typename T = void> |
423 | | static nsresult RegisterPrefixCallback( |
424 | | typename TypedPrefChangeFunc<T>::Type aCallback, |
425 | | const nsACString& aPref, |
426 | | T* aClosure = nullptr) |
427 | | { |
428 | | return RegisterCallback(aCallback, aPref, aClosure, PrefixMatch); |
429 | | } |
430 | | |
431 | | // Like RegisterPrefixCallback, but also calls the callback immediately for |
432 | | // initialization. |
433 | | template<typename T = void> |
434 | | static nsresult RegisterPrefixCallbackAndCall( |
435 | | typename TypedPrefChangeFunc<T>::Type aCallback, |
436 | | const nsACString& aPref, |
437 | | T* aClosure = nullptr) |
438 | | { |
439 | | return RegisterCallbackAndCall(aCallback, aPref, aClosure, PrefixMatch); |
440 | | } |
441 | | |
442 | | // Unregister a callback registered with RegisterPrefixCallback or |
443 | | // RegisterPrefixCallbackAndCall. |
444 | | template<typename T = void> |
445 | | static nsresult UnregisterPrefixCallback( |
446 | | typename TypedPrefChangeFunc<T>::Type aCallback, |
447 | | const nsACString& aPref, |
448 | | T* aClosure = nullptr) |
449 | | { |
450 | | return UnregisterCallback(aCallback, aPref, aClosure, PrefixMatch); |
451 | | } |
452 | | |
453 | | // Variants of the above which register a single callback to handle multiple |
454 | | // preferences. |
455 | | // |
456 | | // The array of preference names must be null terminated. It may be |
457 | | // dynamically allocated, but the caller is responsible for keeping it alive |
458 | | // until the callback is unregistered. |
459 | | // |
460 | | // Also note that the exact same aPrefs pointer must be passed to the |
461 | | // Unregister call as was passed to the Register call. |
462 | | template<typename T = void> |
463 | | static nsresult RegisterCallbacks( |
464 | | typename TypedPrefChangeFunc<T>::Type aCallback, |
465 | | const char** aPrefs, |
466 | | T* aClosure = nullptr) |
467 | 24 | { |
468 | 24 | return RegisterCallbacks(aCallback, aPrefs, aClosure, ExactMatch); |
469 | 24 | } nsresult mozilla::Preferences::RegisterCallbacks<mozilla::net::nsSocketTransportService>(mozilla::TypedPrefChangeFunc<mozilla::net::nsSocketTransportService>::Type, char const**, mozilla::net::nsSocketTransportService*) Line | Count | Source | 467 | 3 | { | 468 | 3 | return RegisterCallbacks(aCallback, aPrefs, aClosure, ExactMatch); | 469 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallbacks<nsCacheProfilePrefObserver>(mozilla::TypedPrefChangeFunc<nsCacheProfilePrefObserver>::Type, char const**, nsCacheProfilePrefObserver*) nsresult mozilla::Preferences::RegisterCallbacks<WatchdogManager>(mozilla::TypedPrefChangeFunc<WatchdogManager>::Type, char const**, WatchdogManager*) Line | Count | Source | 467 | 3 | { | 468 | 3 | return RegisterCallbacks(aCallback, aPrefs, aClosure, ExactMatch); | 469 | 3 | } |
Unexecuted instantiation: Unified_cpp_dom_base7.cpp:nsresult mozilla::Preferences::RegisterCallbacks<(anonymous namespace)::PrefStore>(mozilla::TypedPrefChangeFunc<(anonymous namespace)::PrefStore>::Type, char const**, (anonymous namespace)::PrefStore*) nsresult mozilla::Preferences::RegisterCallbacks<nsFocusManager>(mozilla::TypedPrefChangeFunc<nsFocusManager>::Type, char const**, nsFocusManager*) Line | Count | Source | 467 | 3 | { | 468 | 3 | return RegisterCallbacks(aCallback, aPrefs, aClosure, ExactMatch); | 469 | 3 | } |
nsresult mozilla::Preferences::RegisterCallbacks<nsNameSpaceManager>(mozilla::TypedPrefChangeFunc<nsNameSpaceManager>::Type, char const**, nsNameSpaceManager*) Line | Count | Source | 467 | 3 | { | 468 | 3 | return RegisterCallbacks(aCallback, aPrefs, aClosure, ExactMatch); | 469 | 3 | } |
nsresult mozilla::Preferences::RegisterCallbacks<void>(mozilla::TypedPrefChangeFunc<void>::Type, char const**, void*) Line | Count | Source | 467 | 3 | { | 468 | 3 | return RegisterCallbacks(aCallback, aPrefs, aClosure, ExactMatch); | 469 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallbacks<mozilla::plugins::PluginModuleParent>(mozilla::TypedPrefChangeFunc<mozilla::plugins::PluginModuleParent>::Type, char const**, mozilla::plugins::PluginModuleParent*) nsresult mozilla::Preferences::RegisterCallbacks<ComputedStyleMap>(mozilla::TypedPrefChangeFunc<ComputedStyleMap>::Type, char const**, ComputedStyleMap*) Line | Count | Source | 467 | 3 | { | 468 | 3 | return RegisterCallbacks(aCallback, aPrefs, aClosure, ExactMatch); | 469 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallbacks<nsPresContext>(mozilla::TypedPrefChangeFunc<nsPresContext>::Type, char const**, nsPresContext*) nsresult mozilla::Preferences::RegisterCallbacks<nsSHistoryObserver>(mozilla::TypedPrefChangeFunc<nsSHistoryObserver>::Type, char const**, nsSHistoryObserver*) Line | Count | Source | 467 | 3 | { | 468 | 3 | return RegisterCallbacks(aCallback, aPrefs, aClosure, ExactMatch); | 469 | 3 | } |
nsresult mozilla::Preferences::RegisterCallbacks<mozilla::nsRFPService>(mozilla::TypedPrefChangeFunc<mozilla::nsRFPService>::Type, char const**, mozilla::nsRFPService*) Line | Count | Source | 467 | 3 | { | 468 | 3 | return RegisterCallbacks(aCallback, aPrefs, aClosure, ExactMatch); | 469 | 3 | } |
|
470 | | static nsresult RegisterCallbacksAndCall(PrefChangedFunc aCallback, |
471 | | const char** aPrefs, |
472 | | void* aClosure = nullptr); |
473 | | template<typename T = void> |
474 | | static nsresult UnregisterCallbacks( |
475 | | typename TypedPrefChangeFunc<T>::Type aCallback, |
476 | | const char** aPrefs, |
477 | | T* aClosure = nullptr) |
478 | 0 | { |
479 | 0 | return UnregisterCallbacks(aCallback, aPrefs, aClosure, ExactMatch); |
480 | 0 | } Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallbacks<mozilla::net::nsSocketTransportService>(mozilla::TypedPrefChangeFunc<mozilla::net::nsSocketTransportService>::Type, char const**, mozilla::net::nsSocketTransportService*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallbacks<nsCacheProfilePrefObserver>(mozilla::TypedPrefChangeFunc<nsCacheProfilePrefObserver>::Type, char const**, nsCacheProfilePrefObserver*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallbacks<WatchdogManager>(mozilla::TypedPrefChangeFunc<WatchdogManager>::Type, char const**, WatchdogManager*) Unexecuted instantiation: Unified_cpp_dom_base7.cpp:nsresult mozilla::Preferences::UnregisterCallbacks<(anonymous namespace)::PrefStore>(mozilla::TypedPrefChangeFunc<(anonymous namespace)::PrefStore>::Type, char const**, (anonymous namespace)::PrefStore*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallbacks<nsFocusManager>(mozilla::TypedPrefChangeFunc<nsFocusManager>::Type, char const**, nsFocusManager*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallbacks<void>(mozilla::TypedPrefChangeFunc<void>::Type, char const**, void*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallbacks<mozilla::plugins::PluginModuleParent>(mozilla::TypedPrefChangeFunc<mozilla::plugins::PluginModuleParent>::Type, char const**, mozilla::plugins::PluginModuleParent*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallbacks<ComputedStyleMap>(mozilla::TypedPrefChangeFunc<ComputedStyleMap>::Type, char const**, ComputedStyleMap*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallbacks<nsPresContext>(mozilla::TypedPrefChangeFunc<nsPresContext>::Type, char const**, nsPresContext*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallbacks<nsSHistoryObserver>(mozilla::TypedPrefChangeFunc<nsSHistoryObserver>::Type, char const**, nsSHistoryObserver*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallbacks<mozilla::nsRFPService>(mozilla::TypedPrefChangeFunc<mozilla::nsRFPService>::Type, char const**, mozilla::nsRFPService*) |
481 | | template<typename T = void> |
482 | | static nsresult RegisterPrefixCallbacks( |
483 | | typename TypedPrefChangeFunc<T>::Type aCallback, |
484 | | const char** aPrefs, |
485 | | T* aClosure = nullptr) |
486 | 10 | { |
487 | 10 | return RegisterCallbacks(aCallback, aPrefs, aClosure, PrefixMatch); |
488 | 10 | } nsresult mozilla::Preferences::RegisterPrefixCallbacks<mozilla::net::nsIOService>(mozilla::TypedPrefChangeFunc<mozilla::net::nsIOService>::Type, char const**, mozilla::net::nsIOService*) Line | Count | Source | 486 | 3 | { | 487 | 3 | return RegisterCallbacks(aCallback, aPrefs, aClosure, PrefixMatch); | 488 | 3 | } |
nsresult mozilla::Preferences::RegisterPrefixCallbacks<nsIDNService>(mozilla::TypedPrefChangeFunc<nsIDNService>::Type, char const**, nsIDNService*) Line | Count | Source | 486 | 3 | { | 487 | 3 | return RegisterCallbacks(aCallback, aPrefs, aClosure, PrefixMatch); | 488 | 3 | } |
nsresult mozilla::Preferences::RegisterPrefixCallbacks<mozilla::net::nsHttpHandler>(mozilla::TypedPrefChangeFunc<mozilla::net::nsHttpHandler>::Type, char const**, mozilla::net::nsHttpHandler*) Line | Count | Source | 486 | 1 | { | 487 | 1 | return RegisterCallbacks(aCallback, aPrefs, aClosure, PrefixMatch); | 488 | 1 | } |
nsresult mozilla::Preferences::RegisterPrefixCallbacks<nsScriptSecurityManager>(mozilla::TypedPrefChangeFunc<nsScriptSecurityManager>::Type, char const**, nsScriptSecurityManager*) Line | Count | Source | 486 | 3 | { | 487 | 3 | return RegisterCallbacks(aCallback, aPrefs, aClosure, PrefixMatch); | 488 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::RegisterPrefixCallbacks<void>(mozilla::TypedPrefChangeFunc<void>::Type, char const**, void*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterPrefixCallbacks<nsPresContext>(mozilla::TypedPrefChangeFunc<nsPresContext>::Type, char const**, nsPresContext*) |
489 | | template<typename T = void> |
490 | | static nsresult UnregisterPrefixCallbacks( |
491 | | typename TypedPrefChangeFunc<T>::Type aCallback, |
492 | | const char** aPrefs, |
493 | | T* aClosure = nullptr) |
494 | 0 | { |
495 | 0 | return UnregisterCallbacks(aCallback, aPrefs, aClosure, PrefixMatch); |
496 | 0 | } Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterPrefixCallbacks<nsIDNService>(mozilla::TypedPrefChangeFunc<nsIDNService>::Type, char const**, nsIDNService*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterPrefixCallbacks<nsScriptSecurityManager>(mozilla::TypedPrefChangeFunc<nsScriptSecurityManager>::Type, char const**, nsScriptSecurityManager*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterPrefixCallbacks<void>(mozilla::TypedPrefChangeFunc<void>::Type, char const**, void*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterPrefixCallbacks<nsPresContext>(mozilla::TypedPrefChangeFunc<nsPresContext>::Type, char const**, nsPresContext*) |
497 | | |
498 | | template<int N, typename T = void> |
499 | | static nsresult RegisterCallback( |
500 | | typename TypedPrefChangeFunc<T>::Type aCallback, |
501 | | const char (&aPref)[N], |
502 | | T* aClosure = nullptr) |
503 | 15 | { |
504 | 15 | return RegisterCallback( |
505 | 15 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); |
506 | 15 | } nsresult mozilla::Preferences::RegisterCallback<38, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [38], void*) Line | Count | Source | 503 | 3 | { | 504 | 3 | return RegisterCallback( | 505 | 3 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 506 | 3 | } |
nsresult mozilla::Preferences::RegisterCallback<16, XPCJSContext>(mozilla::TypedPrefChangeFunc<XPCJSContext>::Type, char const (&) [16], XPCJSContext*) Line | Count | Source | 503 | 3 | { | 504 | 3 | return RegisterCallback( | 505 | 3 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 506 | 3 | } |
nsresult mozilla::Preferences::RegisterCallback<22, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [22], void*) Line | Count | Source | 503 | 3 | { | 504 | 3 | return RegisterCallback( | 505 | 3 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 506 | 3 | } |
nsresult mozilla::Preferences::RegisterCallback<31, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [31], void*) Line | Count | Source | 503 | 3 | { | 504 | 3 | return RegisterCallback( | 505 | 3 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 506 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallback<25, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [25], void*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallback<35, mozilla::plugins::PluginModuleParent>(mozilla::TypedPrefChangeFunc<mozilla::plugins::PluginModuleParent>::Type, char const (&) [35], mozilla::plugins::PluginModuleParent*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallback<19, mozilla::plugins::PluginModuleChromeParent>(mozilla::TypedPrefChangeFunc<mozilla::plugins::PluginModuleChromeParent>::Type, char const (&) [19], mozilla::plugins::PluginModuleChromeParent*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallback<36, mozilla::plugins::PluginModuleChromeParent>(mozilla::TypedPrefChangeFunc<mozilla::plugins::PluginModuleChromeParent>::Type, char const (&) [36], mozilla::plugins::PluginModuleChromeParent*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallback<30, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [30], void*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallback<37, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [37], void*) nsresult mozilla::Preferences::RegisterCallback<39, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [39], void*) Line | Count | Source | 503 | 3 | { | 504 | 3 | return RegisterCallback( | 505 | 3 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 506 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallback<17, mozilla::dom::XULDocument>(mozilla::TypedPrefChangeFunc<mozilla::dom::XULDocument>::Type, char const (&) [17], mozilla::dom::XULDocument*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallback<33, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [33], void*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallback<23, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [23], void*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallback<28, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [28], void*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallback<29, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [29], void*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallback<32, mozilla::DataStorage>(mozilla::TypedPrefChangeFunc<mozilla::DataStorage>::Type, char const (&) [32], mozilla::DataStorage*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallback<38, nsNavHistoryResult>(mozilla::TypedPrefChangeFunc<nsNavHistoryResult>::Type, char const (&) [38], nsNavHistoryResult*) |
507 | | |
508 | | template<int N, typename T = void> |
509 | | static nsresult UnregisterCallback( |
510 | | typename TypedPrefChangeFunc<T>::Type aCallback, |
511 | | const char (&aPref)[N], |
512 | | T* aClosure = nullptr) |
513 | 0 | { |
514 | 0 | return UnregisterCallback( |
515 | 0 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); |
516 | 0 | } Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<38, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [38], void*) Unexecuted instantiation: Unified_cpp_netwerk_base1.cpp:nsresult mozilla::Preferences::UnregisterCallback<28, mozilla::net::(anonymous namespace)::CachedPrefs>(mozilla::TypedPrefChangeFunc<mozilla::net::(anonymous namespace)::CachedPrefs>::Type, char const (&) [28], mozilla::net::(anonymous namespace)::CachedPrefs*) Unexecuted instantiation: Unified_cpp_netwerk_base1.cpp:nsresult mozilla::Preferences::UnregisterCallback<38, mozilla::net::(anonymous namespace)::CachedPrefs>(mozilla::TypedPrefChangeFunc<mozilla::net::(anonymous namespace)::CachedPrefs>::Type, char const (&) [38], mozilla::net::(anonymous namespace)::CachedPrefs*) Unexecuted instantiation: Unified_cpp_netwerk_base1.cpp:nsresult mozilla::Preferences::UnregisterCallback<50, mozilla::net::(anonymous namespace)::CachedPrefs>(mozilla::TypedPrefChangeFunc<mozilla::net::(anonymous namespace)::CachedPrefs>::Type, char const (&) [50], mozilla::net::(anonymous namespace)::CachedPrefs*) Unexecuted instantiation: Unified_cpp_netwerk_base1.cpp:nsresult mozilla::Preferences::UnregisterCallback<47, mozilla::net::(anonymous namespace)::CachedPrefs>(mozilla::TypedPrefChangeFunc<mozilla::net::(anonymous namespace)::CachedPrefs>::Type, char const (&) [47], mozilla::net::(anonymous namespace)::CachedPrefs*) Unexecuted instantiation: Unified_cpp_netwerk_base1.cpp:nsresult mozilla::Preferences::UnregisterCallback<59, mozilla::net::(anonymous namespace)::CachedPrefs>(mozilla::TypedPrefChangeFunc<mozilla::net::(anonymous namespace)::CachedPrefs>::Type, char const (&) [59], mozilla::net::(anonymous namespace)::CachedPrefs*) Unexecuted instantiation: Unified_cpp_netwerk_base1.cpp:nsresult mozilla::Preferences::UnregisterCallback<37, mozilla::net::(anonymous namespace)::CachedPrefs>(mozilla::TypedPrefChangeFunc<mozilla::net::(anonymous namespace)::CachedPrefs>::Type, char const (&) [37], mozilla::net::(anonymous namespace)::CachedPrefs*) Unexecuted instantiation: Unified_cpp_netwerk_base1.cpp:nsresult mozilla::Preferences::UnregisterCallback<49, mozilla::net::(anonymous namespace)::CachedPrefs>(mozilla::TypedPrefChangeFunc<mozilla::net::(anonymous namespace)::CachedPrefs>::Type, char const (&) [49], mozilla::net::(anonymous namespace)::CachedPrefs*) Unexecuted instantiation: Unified_cpp_netwerk_base1.cpp:nsresult mozilla::Preferences::UnregisterCallback<40, mozilla::net::(anonymous namespace)::CachedPrefs>(mozilla::TypedPrefChangeFunc<mozilla::net::(anonymous namespace)::CachedPrefs>::Type, char const (&) [40], mozilla::net::(anonymous namespace)::CachedPrefs*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<20, nsHostResolver>(mozilla::TypedPrefChangeFunc<nsHostResolver>::Type, char const (&) [20], nsHostResolver*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<16, XPCJSContext>(mozilla::TypedPrefChangeFunc<XPCJSContext>::Type, char const (&) [16], XPCJSContext*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<20, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [20], void*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<22, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [22], void*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<25, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [25], void*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<35, mozilla::plugins::PluginModuleParent>(mozilla::TypedPrefChangeFunc<mozilla::plugins::PluginModuleParent>::Type, char const (&) [35], mozilla::plugins::PluginModuleParent*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<19, mozilla::plugins::PluginModuleChromeParent>(mozilla::TypedPrefChangeFunc<mozilla::plugins::PluginModuleChromeParent>::Type, char const (&) [19], mozilla::plugins::PluginModuleChromeParent*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<36, mozilla::plugins::PluginModuleChromeParent>(mozilla::TypedPrefChangeFunc<mozilla::plugins::PluginModuleChromeParent>::Type, char const (&) [36], mozilla::plugins::PluginModuleChromeParent*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<22, mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void> >(mozilla::TypedPrefChangeFunc<mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void> >::Type, char const (&) [22], mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void>*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<27, mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void> >(mozilla::TypedPrefChangeFunc<mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void> >::Type, char const (&) [27], mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void>*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<23, mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void> >(mozilla::TypedPrefChangeFunc<mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void> >::Type, char const (&) [23], mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void>*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<36, mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void> >(mozilla::TypedPrefChangeFunc<mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void> >::Type, char const (&) [36], mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void>*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<30, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [30], void*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<37, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [37], void*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<28, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [28], void*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<35, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [35], void*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<26, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [26], void*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<17, mozilla::dom::XULDocument>(mozilla::TypedPrefChangeFunc<mozilla::dom::XULDocument>::Type, char const (&) [17], mozilla::dom::XULDocument*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<45, CertBlocklist>(mozilla::TypedPrefChangeFunc<CertBlocklist>::Type, char const (&) [45], CertBlocklist*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<34, CertBlocklist>(mozilla::TypedPrefChangeFunc<CertBlocklist>::Type, char const (&) [34], CertBlocklist*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<32, mozilla::DataStorage>(mozilla::TypedPrefChangeFunc<mozilla::DataStorage>::Type, char const (&) [32], mozilla::DataStorage*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterCallback<38, nsNavHistoryResult>(mozilla::TypedPrefChangeFunc<nsNavHistoryResult>::Type, char const (&) [38], nsNavHistoryResult*) |
517 | | |
518 | | template<int N, typename T = void> |
519 | | static nsresult RegisterCallbackAndCall( |
520 | | typename TypedPrefChangeFunc<T>::Type aCallback, |
521 | | const char (&aPref)[N], |
522 | | T* aClosure = nullptr) |
523 | 72 | { |
524 | 72 | return RegisterCallbackAndCall( |
525 | 72 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); |
526 | 72 | } Unexecuted instantiation: Unified_cpp_netwerk_base1.cpp:nsresult mozilla::Preferences::RegisterCallbackAndCall<28, mozilla::net::(anonymous namespace)::CachedPrefs>(mozilla::TypedPrefChangeFunc<mozilla::net::(anonymous namespace)::CachedPrefs>::Type, char const (&) [28], mozilla::net::(anonymous namespace)::CachedPrefs*) Unexecuted instantiation: Unified_cpp_netwerk_base1.cpp:nsresult mozilla::Preferences::RegisterCallbackAndCall<38, mozilla::net::(anonymous namespace)::CachedPrefs>(mozilla::TypedPrefChangeFunc<mozilla::net::(anonymous namespace)::CachedPrefs>::Type, char const (&) [38], mozilla::net::(anonymous namespace)::CachedPrefs*) Unexecuted instantiation: Unified_cpp_netwerk_base1.cpp:nsresult mozilla::Preferences::RegisterCallbackAndCall<50, mozilla::net::(anonymous namespace)::CachedPrefs>(mozilla::TypedPrefChangeFunc<mozilla::net::(anonymous namespace)::CachedPrefs>::Type, char const (&) [50], mozilla::net::(anonymous namespace)::CachedPrefs*) Unexecuted instantiation: Unified_cpp_netwerk_base1.cpp:nsresult mozilla::Preferences::RegisterCallbackAndCall<47, mozilla::net::(anonymous namespace)::CachedPrefs>(mozilla::TypedPrefChangeFunc<mozilla::net::(anonymous namespace)::CachedPrefs>::Type, char const (&) [47], mozilla::net::(anonymous namespace)::CachedPrefs*) Unexecuted instantiation: Unified_cpp_netwerk_base1.cpp:nsresult mozilla::Preferences::RegisterCallbackAndCall<59, mozilla::net::(anonymous namespace)::CachedPrefs>(mozilla::TypedPrefChangeFunc<mozilla::net::(anonymous namespace)::CachedPrefs>::Type, char const (&) [59], mozilla::net::(anonymous namespace)::CachedPrefs*) Unexecuted instantiation: Unified_cpp_netwerk_base1.cpp:nsresult mozilla::Preferences::RegisterCallbackAndCall<37, mozilla::net::(anonymous namespace)::CachedPrefs>(mozilla::TypedPrefChangeFunc<mozilla::net::(anonymous namespace)::CachedPrefs>::Type, char const (&) [37], mozilla::net::(anonymous namespace)::CachedPrefs*) Unexecuted instantiation: Unified_cpp_netwerk_base1.cpp:nsresult mozilla::Preferences::RegisterCallbackAndCall<49, mozilla::net::(anonymous namespace)::CachedPrefs>(mozilla::TypedPrefChangeFunc<mozilla::net::(anonymous namespace)::CachedPrefs>::Type, char const (&) [49], mozilla::net::(anonymous namespace)::CachedPrefs*) Unexecuted instantiation: Unified_cpp_netwerk_base1.cpp:nsresult mozilla::Preferences::RegisterCallbackAndCall<40, mozilla::net::(anonymous namespace)::CachedPrefs>(mozilla::TypedPrefChangeFunc<mozilla::net::(anonymous namespace)::CachedPrefs>::Type, char const (&) [40], mozilla::net::(anonymous namespace)::CachedPrefs*) nsresult mozilla::Preferences::RegisterCallbackAndCall<20, nsHostResolver>(mozilla::TypedPrefChangeFunc<nsHostResolver>::Type, char const (&) [20], nsHostResolver*) Line | Count | Source | 523 | 3 | { | 524 | 3 | return RegisterCallbackAndCall( | 525 | 3 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 526 | 3 | } |
nsresult mozilla::Preferences::RegisterCallbackAndCall<32, nsHostResolver>(mozilla::TypedPrefChangeFunc<nsHostResolver>::Type, char const (&) [32], nsHostResolver*) Line | Count | Source | 523 | 3 | { | 524 | 3 | return RegisterCallbackAndCall( | 525 | 3 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 526 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallbackAndCall<17, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [17], void*) nsresult mozilla::Preferences::RegisterCallbackAndCall<37, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [37], void*) Line | Count | Source | 523 | 3 | { | 524 | 3 | return RegisterCallbackAndCall( | 525 | 3 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 526 | 3 | } |
nsresult mozilla::Preferences::RegisterCallbackAndCall<39, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [39], void*) Line | Count | Source | 523 | 3 | { | 524 | 3 | return RegisterCallbackAndCall( | 525 | 3 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 526 | 3 | } |
nsresult mozilla::Preferences::RegisterCallbackAndCall<27, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [27], void*) Line | Count | Source | 523 | 3 | { | 524 | 3 | return RegisterCallbackAndCall( | 525 | 3 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 526 | 3 | } |
nsresult mozilla::Preferences::RegisterCallbackAndCall<38, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [38], void*) Line | Count | Source | 523 | 6 | { | 524 | 6 | return RegisterCallbackAndCall( | 525 | 6 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 526 | 6 | } |
nsresult mozilla::Preferences::RegisterCallbackAndCall<35, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [35], void*) Line | Count | Source | 523 | 3 | { | 524 | 3 | return RegisterCallbackAndCall( | 525 | 3 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 526 | 3 | } |
nsresult mozilla::Preferences::RegisterCallbackAndCall<47, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [47], void*) Line | Count | Source | 523 | 3 | { | 524 | 3 | return RegisterCallbackAndCall( | 525 | 3 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 526 | 3 | } |
nsresult mozilla::Preferences::RegisterCallbackAndCall<55, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [55], void*) Line | Count | Source | 523 | 6 | { | 524 | 6 | return RegisterCallbackAndCall( | 525 | 6 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 526 | 6 | } |
nsresult mozilla::Preferences::RegisterCallbackAndCall<45, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [45], void*) Line | Count | Source | 523 | 3 | { | 524 | 3 | return RegisterCallbackAndCall( | 525 | 3 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 526 | 3 | } |
nsresult mozilla::Preferences::RegisterCallbackAndCall<46, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [46], void*) Line | Count | Source | 523 | 3 | { | 524 | 3 | return RegisterCallbackAndCall( | 525 | 3 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 526 | 3 | } |
nsresult mozilla::Preferences::RegisterCallbackAndCall<52, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [52], void*) Line | Count | Source | 523 | 3 | { | 524 | 3 | return RegisterCallbackAndCall( | 525 | 3 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 526 | 3 | } |
nsresult mozilla::Preferences::RegisterCallbackAndCall<57, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [57], void*) Line | Count | Source | 523 | 6 | { | 524 | 6 | return RegisterCallbackAndCall( | 525 | 6 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 526 | 6 | } |
nsresult mozilla::Preferences::RegisterCallbackAndCall<54, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [54], void*) Line | Count | Source | 523 | 6 | { | 524 | 6 | return RegisterCallbackAndCall( | 525 | 6 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 526 | 6 | } |
nsresult mozilla::Preferences::RegisterCallbackAndCall<50, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [50], void*) Line | Count | Source | 523 | 3 | { | 524 | 3 | return RegisterCallbackAndCall( | 525 | 3 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 526 | 3 | } |
nsresult mozilla::Preferences::RegisterCallbackAndCall<70, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [70], void*) Line | Count | Source | 523 | 3 | { | 524 | 3 | return RegisterCallbackAndCall( | 525 | 3 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 526 | 3 | } |
nsresult mozilla::Preferences::RegisterCallbackAndCall<32, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [32], void*) Line | Count | Source | 523 | 3 | { | 524 | 3 | return RegisterCallbackAndCall( | 525 | 3 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 526 | 3 | } |
nsresult mozilla::Preferences::RegisterCallbackAndCall<48, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [48], void*) Line | Count | Source | 523 | 6 | { | 524 | 6 | return RegisterCallbackAndCall( | 525 | 6 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 526 | 6 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallbackAndCall<25, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [25], void*) nsresult mozilla::Preferences::RegisterCallbackAndCall<20, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [20], void*) Line | Count | Source | 523 | 3 | { | 524 | 3 | return RegisterCallbackAndCall( | 525 | 3 | aCallback, nsLiteralCString(aPref), aClosure, ExactMatch); | 526 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallbackAndCall<22, mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void> >(mozilla::TypedPrefChangeFunc<mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void> >::Type, char const (&) [22], mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void>*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallbackAndCall<27, mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void> >(mozilla::TypedPrefChangeFunc<mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void> >::Type, char const (&) [27], mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void>*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallbackAndCall<23, mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void> >(mozilla::TypedPrefChangeFunc<mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void> >::Type, char const (&) [23], mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void>*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallbackAndCall<36, mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void> >(mozilla::TypedPrefChangeFunc<mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void> >::Type, char const (&) [36], mozilla::Atomic<bool, (mozilla::MemoryOrdering)2, (mozilla::recordreplay::Behavior)1, void>*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallbackAndCall<30, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [30], void*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallbackAndCall<28, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [28], void*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallbackAndCall<22, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [22], void*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallbackAndCall<26, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [26], void*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallbackAndCall<29, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [29], void*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallbackAndCall<45, CertBlocklist>(mozilla::TypedPrefChangeFunc<CertBlocklist>::Type, char const (&) [45], CertBlocklist*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterCallbackAndCall<34, CertBlocklist>(mozilla::TypedPrefChangeFunc<CertBlocklist>::Type, char const (&) [34], CertBlocklist*) |
527 | | |
528 | | template<int N, typename T = void> |
529 | | static nsresult RegisterPrefixCallback( |
530 | | typename TypedPrefChangeFunc<T>::Type aCallback, |
531 | | const char (&aPref)[N], |
532 | | T* aClosure = nullptr) |
533 | 3 | { |
534 | 3 | return RegisterCallback( |
535 | 3 | aCallback, nsLiteralCString(aPref), aClosure, PrefixMatch); |
536 | 3 | } nsresult mozilla::Preferences::RegisterPrefixCallback<20, XPCJSContext>(mozilla::TypedPrefChangeFunc<XPCJSContext>::Type, char const (&) [20], XPCJSContext*) Line | Count | Source | 533 | 3 | { | 534 | 3 | return RegisterCallback( | 535 | 3 | aCallback, nsLiteralCString(aPref), aClosure, PrefixMatch); | 536 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::RegisterPrefixCallback<12, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [12], void*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterPrefixCallback<24, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [24], void*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterPrefixCallback<20, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [20], void*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterPrefixCallback<4, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [4], void*) |
537 | | |
538 | | template<int N, typename T = void> |
539 | | static nsresult RegisterPrefixCallbackAndCall( |
540 | | typename TypedPrefChangeFunc<T>::Type aCallback, |
541 | | const char (&aPref)[N], |
542 | | T* aClosure = nullptr) |
543 | 0 | { |
544 | 0 | return RegisterCallbackAndCall( |
545 | 0 | aCallback, nsLiteralCString(aPref), aClosure, PrefixMatch); |
546 | 0 | } Unexecuted instantiation: nsresult mozilla::Preferences::RegisterPrefixCallbackAndCall<20, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [20], void*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterPrefixCallbackAndCall<25, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [25], void*) Unexecuted instantiation: nsresult mozilla::Preferences::RegisterPrefixCallbackAndCall<21, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [21], void*) |
547 | | |
548 | | template<int N, typename T = void> |
549 | | static nsresult UnregisterPrefixCallback( |
550 | | typename TypedPrefChangeFunc<T>::Type aCallback, |
551 | | const char (&aPref)[N], |
552 | | T* aClosure = nullptr) |
553 | 0 | { |
554 | 0 | return UnregisterCallback( |
555 | 0 | aCallback, nsLiteralCString(aPref), aClosure, PrefixMatch); |
556 | 0 | } Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterPrefixCallback<20, XPCJSContext>(mozilla::TypedPrefChangeFunc<XPCJSContext>::Type, char const (&) [20], XPCJSContext*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterPrefixCallback<12, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [12], void*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterPrefixCallback<20, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [20], void*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterPrefixCallback<21, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [21], void*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterPrefixCallback<24, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [24], void*) Unexecuted instantiation: nsresult mozilla::Preferences::UnregisterPrefixCallback<25, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [25], void*) |
557 | | |
558 | | // Adds the aVariable to cache table. |aVariable| must be a pointer for a |
559 | | // static variable. The value will be modified when the pref value is changed |
560 | | // but note that even if you modified it, the value isn't assigned to the |
561 | | // pref. |
562 | | static nsresult AddBoolVarCache(bool* aVariable, |
563 | | const nsACString& aPref, |
564 | | bool aDefault = false, |
565 | | bool aSkipAssignment = false); |
566 | | template<MemoryOrdering Order> |
567 | | static nsresult AddAtomicBoolVarCache(Atomic<bool, Order>* aVariable, |
568 | | const nsACString& aPref, |
569 | | bool aDefault = false, |
570 | | bool aSkipAssignment = false); |
571 | | static nsresult AddIntVarCache(int32_t* aVariable, |
572 | | const nsACString& aPref, |
573 | | int32_t aDefault = 0, |
574 | | bool aSkipAssignment = false); |
575 | | template<MemoryOrdering Order> |
576 | | static nsresult AddAtomicIntVarCache(Atomic<int32_t, Order>* aVariable, |
577 | | const nsACString& aPref, |
578 | | int32_t aDefault = 0, |
579 | | bool aSkipAssignment = false); |
580 | | static nsresult AddUintVarCache(uint32_t* aVariable, |
581 | | const nsACString& aPref, |
582 | | uint32_t aDefault = 0, |
583 | | bool aSkipAssignment = false); |
584 | | template<MemoryOrdering Order> |
585 | | static nsresult AddAtomicUintVarCache(Atomic<uint32_t, Order>* aVariable, |
586 | | const nsACString& aPref, |
587 | | uint32_t aDefault = 0, |
588 | | bool aSkipAssignment = false); |
589 | | static nsresult AddFloatVarCache(float* aVariable, |
590 | | const nsACString& aPref, |
591 | | float aDefault = 0.0f, |
592 | | bool aSkipAssignment = false); |
593 | | |
594 | | template<int N> |
595 | | static nsresult AddBoolVarCache(bool* aVariable, |
596 | | const char (&aPref)[N], |
597 | | bool aDefault = false, |
598 | | bool aSkipAssignment = false) |
599 | 189 | { |
600 | 189 | return AddBoolVarCache( |
601 | 189 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); |
602 | 189 | } Unexecuted instantiation: nsresult mozilla::Preferences::AddBoolVarCache<75>(bool*, char const (&) [75], bool, bool) nsresult mozilla::Preferences::AddBoolVarCache<26>(bool*, char const (&) [26], bool, bool) Line | Count | Source | 599 | 12 | { | 600 | 12 | return AddBoolVarCache( | 601 | 12 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 12 | } |
nsresult mozilla::Preferences::AddBoolVarCache<30>(bool*, char const (&) [30], bool, bool) Line | Count | Source | 599 | 9 | { | 600 | 9 | return AddBoolVarCache( | 601 | 9 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 9 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::AddBoolVarCache<45>(bool*, char const (&) [45], bool, bool) nsresult mozilla::Preferences::AddBoolVarCache<50>(bool*, char const (&) [50], bool, bool) Line | Count | Source | 599 | 6 | { | 600 | 6 | return AddBoolVarCache( | 601 | 6 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 6 | } |
nsresult mozilla::Preferences::AddBoolVarCache<36>(bool*, char const (&) [36], bool, bool) Line | Count | Source | 599 | 12 | { | 600 | 12 | return AddBoolVarCache( | 601 | 12 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 12 | } |
nsresult mozilla::Preferences::AddBoolVarCache<39>(bool*, char const (&) [39], bool, bool) Line | Count | Source | 599 | 9 | { | 600 | 9 | return AddBoolVarCache( | 601 | 9 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 9 | } |
nsresult mozilla::Preferences::AddBoolVarCache<54>(bool*, char const (&) [54], bool, bool) Line | Count | Source | 599 | 3 | { | 600 | 3 | return AddBoolVarCache( | 601 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 3 | } |
nsresult mozilla::Preferences::AddBoolVarCache<32>(bool*, char const (&) [32], bool, bool) Line | Count | Source | 599 | 9 | { | 600 | 9 | return AddBoolVarCache( | 601 | 9 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 9 | } |
nsresult mozilla::Preferences::AddBoolVarCache<37>(bool*, char const (&) [37], bool, bool) Line | Count | Source | 599 | 6 | { | 600 | 6 | return AddBoolVarCache( | 601 | 6 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 6 | } |
nsresult mozilla::Preferences::AddBoolVarCache<35>(bool*, char const (&) [35], bool, bool) Line | Count | Source | 599 | 6 | { | 600 | 6 | return AddBoolVarCache( | 601 | 6 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 6 | } |
nsresult mozilla::Preferences::AddBoolVarCache<33>(bool*, char const (&) [33], bool, bool) Line | Count | Source | 599 | 9 | { | 600 | 9 | return AddBoolVarCache( | 601 | 9 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 9 | } |
nsresult mozilla::Preferences::AddBoolVarCache<28>(bool*, char const (&) [28], bool, bool) Line | Count | Source | 599 | 9 | { | 600 | 9 | return AddBoolVarCache( | 601 | 9 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 9 | } |
nsresult mozilla::Preferences::AddBoolVarCache<38>(bool*, char const (&) [38], bool, bool) Line | Count | Source | 599 | 3 | { | 600 | 3 | return AddBoolVarCache( | 601 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 3 | } |
nsresult mozilla::Preferences::AddBoolVarCache<21>(bool*, char const (&) [21], bool, bool) Line | Count | Source | 599 | 6 | { | 600 | 6 | return AddBoolVarCache( | 601 | 6 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 6 | } |
nsresult mozilla::Preferences::AddBoolVarCache<29>(bool*, char const (&) [29], bool, bool) Line | Count | Source | 599 | 9 | { | 600 | 9 | return AddBoolVarCache( | 601 | 9 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 9 | } |
nsresult mozilla::Preferences::AddBoolVarCache<23>(bool*, char const (&) [23], bool, bool) Line | Count | Source | 599 | 12 | { | 600 | 12 | return AddBoolVarCache( | 601 | 12 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 12 | } |
nsresult mozilla::Preferences::AddBoolVarCache<41>(bool*, char const (&) [41], bool, bool) Line | Count | Source | 599 | 9 | { | 600 | 9 | return AddBoolVarCache( | 601 | 9 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 9 | } |
nsresult mozilla::Preferences::AddBoolVarCache<24>(bool*, char const (&) [24], bool, bool) Line | Count | Source | 599 | 9 | { | 600 | 9 | return AddBoolVarCache( | 601 | 9 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 9 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::AddBoolVarCache<34>(bool*, char const (&) [34], bool, bool) nsresult mozilla::Preferences::AddBoolVarCache<27>(bool*, char const (&) [27], bool, bool) Line | Count | Source | 599 | 9 | { | 600 | 9 | return AddBoolVarCache( | 601 | 9 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 9 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::AddBoolVarCache<51>(bool*, char const (&) [51], bool, bool) nsresult mozilla::Preferences::AddBoolVarCache<44>(bool*, char const (&) [44], bool, bool) Line | Count | Source | 599 | 6 | { | 600 | 6 | return AddBoolVarCache( | 601 | 6 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 6 | } |
nsresult mozilla::Preferences::AddBoolVarCache<19>(bool*, char const (&) [19], bool, bool) Line | Count | Source | 599 | 3 | { | 600 | 3 | return AddBoolVarCache( | 601 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 3 | } |
nsresult mozilla::Preferences::AddBoolVarCache<47>(bool*, char const (&) [47], bool, bool) Line | Count | Source | 599 | 3 | { | 600 | 3 | return AddBoolVarCache( | 601 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 3 | } |
nsresult mozilla::Preferences::AddBoolVarCache<22>(bool*, char const (&) [22], bool, bool) Line | Count | Source | 599 | 6 | { | 600 | 6 | return AddBoolVarCache( | 601 | 6 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 6 | } |
nsresult mozilla::Preferences::AddBoolVarCache<49>(bool*, char const (&) [49], bool, bool) Line | Count | Source | 599 | 3 | { | 600 | 3 | return AddBoolVarCache( | 601 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 3 | } |
nsresult mozilla::Preferences::AddBoolVarCache<31>(bool*, char const (&) [31], bool, bool) Line | Count | Source | 599 | 3 | { | 600 | 3 | return AddBoolVarCache( | 601 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 3 | } |
nsresult mozilla::Preferences::AddBoolVarCache<46>(bool*, char const (&) [46], bool, bool) Line | Count | Source | 599 | 3 | { | 600 | 3 | return AddBoolVarCache( | 601 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 3 | } |
nsresult mozilla::Preferences::AddBoolVarCache<18>(bool*, char const (&) [18], bool, bool) Line | Count | Source | 599 | 3 | { | 600 | 3 | return AddBoolVarCache( | 601 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 3 | } |
nsresult mozilla::Preferences::AddBoolVarCache<65>(bool*, char const (&) [65], bool, bool) Line | Count | Source | 599 | 3 | { | 600 | 3 | return AddBoolVarCache( | 601 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::AddBoolVarCache<42>(bool*, char const (&) [42], bool, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddBoolVarCache<25>(bool*, char const (&) [25], bool, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddBoolVarCache<43>(bool*, char const (&) [43], bool, bool) nsresult mozilla::Preferences::AddBoolVarCache<20>(bool*, char const (&) [20], bool, bool) Line | Count | Source | 599 | 3 | { | 600 | 3 | return AddBoolVarCache( | 601 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 3 | } |
nsresult mozilla::Preferences::AddBoolVarCache<40>(bool*, char const (&) [40], bool, bool) Line | Count | Source | 599 | 3 | { | 600 | 3 | return AddBoolVarCache( | 601 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::AddBoolVarCache<15>(bool*, char const (&) [15], bool, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddBoolVarCache<12>(bool*, char const (&) [12], bool, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddBoolVarCache<48>(bool*, char const (&) [48], bool, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddBoolVarCache<52>(bool*, char const (&) [52], bool, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddBoolVarCache<16>(bool*, char const (&) [16], bool, bool) nsresult mozilla::Preferences::AddBoolVarCache<66>(bool*, char const (&) [66], bool, bool) Line | Count | Source | 599 | 3 | { | 600 | 3 | return AddBoolVarCache( | 601 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 602 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::AddBoolVarCache<17>(bool*, char const (&) [17], bool, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddBoolVarCache<84>(bool*, char const (&) [84], bool, bool) |
603 | | template<MemoryOrdering Order, int N> |
604 | | static nsresult AddAtomicBoolVarCache(Atomic<bool, Order>* aVariable, |
605 | | const char (&aPref)[N], |
606 | | bool aDefault = false, |
607 | | bool aSkipAssignment = false) |
608 | 6 | { |
609 | 6 | return AddAtomicBoolVarCache<Order>( |
610 | 6 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); |
611 | 6 | } nsresult mozilla::Preferences::AddAtomicBoolVarCache<(mozilla::MemoryOrdering)0, 29>(mozilla::Atomic<bool, (mozilla::MemoryOrdering)0, (mozilla::recordreplay::Behavior)1, void>*, char const (&) [29], bool, bool) Line | Count | Source | 608 | 3 | { | 609 | 3 | return AddAtomicBoolVarCache<Order>( | 610 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 611 | 3 | } |
nsresult mozilla::Preferences::AddAtomicBoolVarCache<(mozilla::MemoryOrdering)0, 57>(mozilla::Atomic<bool, (mozilla::MemoryOrdering)0, (mozilla::recordreplay::Behavior)1, void>*, char const (&) [57], bool, bool) Line | Count | Source | 608 | 3 | { | 609 | 3 | return AddAtomicBoolVarCache<Order>( | 610 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 611 | 3 | } |
|
612 | | template<int N> |
613 | | static nsresult AddIntVarCache(int32_t* aVariable, |
614 | | const char (&aPref)[N], |
615 | | int32_t aDefault = 0, |
616 | | bool aSkipAssignment = false) |
617 | 48 | { |
618 | 48 | return AddIntVarCache( |
619 | 48 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); |
620 | 48 | } nsresult mozilla::Preferences::AddIntVarCache<32>(int*, char const (&) [32], int, bool) Line | Count | Source | 617 | 9 | { | 618 | 9 | return AddIntVarCache( | 619 | 9 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 620 | 9 | } |
nsresult mozilla::Preferences::AddIntVarCache<30>(int*, char const (&) [30], int, bool) Line | Count | Source | 617 | 12 | { | 618 | 12 | return AddIntVarCache( | 619 | 12 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 620 | 12 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::AddIntVarCache<34>(int*, char const (&) [34], int, bool) nsresult mozilla::Preferences::AddIntVarCache<36>(int*, char const (&) [36], int, bool) Line | Count | Source | 617 | 3 | { | 618 | 3 | return AddIntVarCache( | 619 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 620 | 3 | } |
nsresult mozilla::Preferences::AddIntVarCache<29>(int*, char const (&) [29], int, bool) Line | Count | Source | 617 | 6 | { | 618 | 6 | return AddIntVarCache( | 619 | 6 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 620 | 6 | } |
nsresult mozilla::Preferences::AddIntVarCache<42>(int*, char const (&) [42], int, bool) Line | Count | Source | 617 | 3 | { | 618 | 3 | return AddIntVarCache( | 619 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 620 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::AddIntVarCache<22>(int*, char const (&) [22], int, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddIntVarCache<33>(int*, char const (&) [33], int, bool) nsresult mozilla::Preferences::AddIntVarCache<31>(int*, char const (&) [31], int, bool) Line | Count | Source | 617 | 3 | { | 618 | 3 | return AddIntVarCache( | 619 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 620 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::AddIntVarCache<48>(int*, char const (&) [48], int, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddIntVarCache<45>(int*, char const (&) [45], int, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddIntVarCache<40>(int*, char const (&) [40], int, bool) nsresult mozilla::Preferences::AddIntVarCache<28>(int*, char const (&) [28], int, bool) Line | Count | Source | 617 | 3 | { | 618 | 3 | return AddIntVarCache( | 619 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 620 | 3 | } |
nsresult mozilla::Preferences::AddIntVarCache<24>(int*, char const (&) [24], int, bool) Line | Count | Source | 617 | 3 | { | 618 | 3 | return AddIntVarCache( | 619 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 620 | 3 | } |
nsresult mozilla::Preferences::AddIntVarCache<39>(int*, char const (&) [39], int, bool) Line | Count | Source | 617 | 3 | { | 618 | 3 | return AddIntVarCache( | 619 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 620 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::AddIntVarCache<25>(int*, char const (&) [25], int, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddIntVarCache<12>(int*, char const (&) [12], int, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddIntVarCache<26>(int*, char const (&) [26], int, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddIntVarCache<20>(int*, char const (&) [20], int, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddIntVarCache<21>(int*, char const (&) [21], int, bool) nsresult mozilla::Preferences::AddIntVarCache<37>(int*, char const (&) [37], int, bool) Line | Count | Source | 617 | 3 | { | 618 | 3 | return AddIntVarCache( | 619 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 620 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::AddIntVarCache<35>(int*, char const (&) [35], int, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddIntVarCache<58>(int*, char const (&) [58], int, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddIntVarCache<56>(int*, char const (&) [56], int, bool) |
621 | | template<MemoryOrdering Order, int N> |
622 | | static nsresult AddAtomicIntVarCache(Atomic<int32_t, Order>* aVariable, |
623 | | const char (&aPref)[N], |
624 | | int32_t aDefault = 0, |
625 | | bool aSkipAssignment = false) |
626 | | { |
627 | | return AddAtomicIntVarCache<Order>( |
628 | | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); |
629 | | } |
630 | | template<int N> |
631 | | static nsresult AddUintVarCache(uint32_t* aVariable, |
632 | | const char (&aPref)[N], |
633 | | uint32_t aDefault = 0, |
634 | | bool aSkipAssignment = false) |
635 | 54 | { |
636 | 54 | return AddUintVarCache( |
637 | 54 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); |
638 | 54 | } Unexecuted instantiation: nsresult mozilla::Preferences::AddUintVarCache<35>(unsigned int*, char const (&) [35], unsigned int, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddUintVarCache<42>(unsigned int*, char const (&) [42], unsigned int, bool) nsresult mozilla::Preferences::AddUintVarCache<41>(unsigned int*, char const (&) [41], unsigned int, bool) Line | Count | Source | 635 | 3 | { | 636 | 3 | return AddUintVarCache( | 637 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 638 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::AddUintVarCache<39>(unsigned int*, char const (&) [39], unsigned int, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddUintVarCache<43>(unsigned int*, char const (&) [43], unsigned int, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddUintVarCache<52>(unsigned int*, char const (&) [52], unsigned int, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddUintVarCache<32>(unsigned int*, char const (&) [32], unsigned int, bool) nsresult mozilla::Preferences::AddUintVarCache<26>(unsigned int*, char const (&) [26], unsigned int, bool) Line | Count | Source | 635 | 3 | { | 636 | 3 | return AddUintVarCache( | 637 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 638 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::AddUintVarCache<24>(unsigned int*, char const (&) [24], unsigned int, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddUintVarCache<47>(unsigned int*, char const (&) [47], unsigned int, bool) nsresult mozilla::Preferences::AddUintVarCache<49>(unsigned int*, char const (&) [49], unsigned int, bool) Line | Count | Source | 635 | 3 | { | 636 | 3 | return AddUintVarCache( | 637 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 638 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::AddUintVarCache<44>(unsigned int*, char const (&) [44], unsigned int, bool) nsresult mozilla::Preferences::AddUintVarCache<45>(unsigned int*, char const (&) [45], unsigned int, bool) Line | Count | Source | 635 | 3 | { | 636 | 3 | return AddUintVarCache( | 637 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 638 | 3 | } |
nsresult mozilla::Preferences::AddUintVarCache<30>(unsigned int*, char const (&) [30], unsigned int, bool) Line | Count | Source | 635 | 9 | { | 636 | 9 | return AddUintVarCache( | 637 | 9 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 638 | 9 | } |
nsresult mozilla::Preferences::AddUintVarCache<46>(unsigned int*, char const (&) [46], unsigned int, bool) Line | Count | Source | 635 | 3 | { | 636 | 3 | return AddUintVarCache( | 637 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 638 | 3 | } |
nsresult mozilla::Preferences::AddUintVarCache<28>(unsigned int*, char const (&) [28], unsigned int, bool) Line | Count | Source | 635 | 3 | { | 636 | 3 | return AddUintVarCache( | 637 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 638 | 3 | } |
nsresult mozilla::Preferences::AddUintVarCache<34>(unsigned int*, char const (&) [34], unsigned int, bool) Line | Count | Source | 635 | 6 | { | 636 | 6 | return AddUintVarCache( | 637 | 6 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 638 | 6 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::AddUintVarCache<31>(unsigned int*, char const (&) [31], unsigned int, bool) nsresult mozilla::Preferences::AddUintVarCache<66>(unsigned int*, char const (&) [66], unsigned int, bool) Line | Count | Source | 635 | 3 | { | 636 | 3 | return AddUintVarCache( | 637 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 638 | 3 | } |
nsresult mozilla::Preferences::AddUintVarCache<55>(unsigned int*, char const (&) [55], unsigned int, bool) Line | Count | Source | 635 | 3 | { | 636 | 3 | return AddUintVarCache( | 637 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 638 | 3 | } |
nsresult mozilla::Preferences::AddUintVarCache<29>(unsigned int*, char const (&) [29], unsigned int, bool) Line | Count | Source | 635 | 6 | { | 636 | 6 | return AddUintVarCache( | 637 | 6 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 638 | 6 | } |
nsresult mozilla::Preferences::AddUintVarCache<16>(unsigned int*, char const (&) [16], unsigned int, bool) Line | Count | Source | 635 | 6 | { | 636 | 6 | return AddUintVarCache( | 637 | 6 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 638 | 6 | } |
nsresult mozilla::Preferences::AddUintVarCache<50>(unsigned int*, char const (&) [50], unsigned int, bool) Line | Count | Source | 635 | 3 | { | 636 | 3 | return AddUintVarCache( | 637 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 638 | 3 | } |
Unexecuted instantiation: nsresult mozilla::Preferences::AddUintVarCache<27>(unsigned int*, char const (&) [27], unsigned int, bool) |
639 | | template<MemoryOrdering Order, int N> |
640 | | static nsresult AddAtomicUintVarCache(Atomic<uint32_t, Order>* aVariable, |
641 | | const char (&aPref)[N], |
642 | | uint32_t aDefault = 0, |
643 | | bool aSkipAssignment = false) |
644 | 3 | { |
645 | 3 | return AddAtomicUintVarCache<Order>( |
646 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); |
647 | 3 | } Unexecuted instantiation: nsresult mozilla::Preferences::AddAtomicUintVarCache<(mozilla::MemoryOrdering)0, 28>(mozilla::Atomic<unsigned int, (mozilla::MemoryOrdering)0, (mozilla::recordreplay::Behavior)1, void>*, char const (&) [28], unsigned int, bool) Unexecuted instantiation: nsresult mozilla::Preferences::AddAtomicUintVarCache<(mozilla::MemoryOrdering)0, 34>(mozilla::Atomic<unsigned int, (mozilla::MemoryOrdering)0, (mozilla::recordreplay::Behavior)1, void>*, char const (&) [34], unsigned int, bool) nsresult mozilla::Preferences::AddAtomicUintVarCache<(mozilla::MemoryOrdering)0, 63>(mozilla::Atomic<unsigned int, (mozilla::MemoryOrdering)0, (mozilla::recordreplay::Behavior)1, void>*, char const (&) [63], unsigned int, bool) Line | Count | Source | 644 | 3 | { | 645 | 3 | return AddAtomicUintVarCache<Order>( | 646 | 3 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); | 647 | 3 | } |
|
648 | | template<int N> |
649 | | static nsresult AddFloatVarCache(float* aVariable, |
650 | | const char (&aPref)[N], |
651 | | float aDefault = 0.0f, |
652 | | bool aSkipAssignment = false) |
653 | 0 | { |
654 | 0 | return AddFloatVarCache( |
655 | 0 | aVariable, nsLiteralCString(aPref), aDefault, aSkipAssignment); |
656 | 0 | } |
657 | | |
658 | | // When a content process is created these methods are used to pass changed |
659 | | // prefs in bulk from the parent process, via shared memory. |
660 | | static void SerializePreferences(nsCString& aStr); |
661 | | static void DeserializePreferences(char* aStr, size_t aPrefsLen); |
662 | | |
663 | | static mozilla::ipc::FileDescriptor EnsureSnapshot(size_t* aSize); |
664 | | static void InitSnapshot(const mozilla::ipc::FileDescriptor&, size_t aSize); |
665 | | |
666 | | // When a single pref is changed in the parent process, these methods are |
667 | | // used to pass the update to content processes. |
668 | | static void GetPreference(dom::Pref* aPref); |
669 | | static void SetPreference(const dom::Pref& aPref); |
670 | | |
671 | | #ifdef DEBUG |
672 | | static bool ArePrefsInitedInContentProcess(); |
673 | | #endif |
674 | | |
675 | | static void AddSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf, |
676 | | PrefsSizes& aSizes); |
677 | | |
678 | | static void HandleDirty(); |
679 | | |
680 | | // Explicitly choosing synchronous or asynchronous (if allowed) preferences |
681 | | // file write. Only for the default file. The guarantee for the "blocking" |
682 | | // is that when it returns, the file on disk reflect the current state of |
683 | | // preferences. |
684 | | nsresult SavePrefFileBlocking(); |
685 | | nsresult SavePrefFileAsynchronous(); |
686 | | |
687 | | private: |
688 | | virtual ~Preferences(); |
689 | | |
690 | | nsresult NotifyServiceObservers(const char* aSubject); |
691 | | |
692 | | // Loads the prefs.js file from the profile, or creates a new one. Returns |
693 | | // the prefs file if successful, or nullptr on failure. |
694 | | already_AddRefed<nsIFile> ReadSavedPrefs(); |
695 | | |
696 | | // Loads the user.js file from the profile if present. |
697 | | void ReadUserOverridePrefs(); |
698 | | |
699 | | nsresult MakeBackupPrefFile(nsIFile* aFile); |
700 | | |
701 | | // Default pref file save can be blocking or not. |
702 | | enum class SaveMethod |
703 | | { |
704 | | Blocking, |
705 | | Asynchronous |
706 | | }; |
707 | | |
708 | | // Off main thread is only respected for the default aFile value (nullptr). |
709 | | nsresult SavePrefFileInternal(nsIFile* aFile, SaveMethod aSaveMethod); |
710 | | nsresult WritePrefFile(nsIFile* aFile, SaveMethod aSaveMethod); |
711 | | |
712 | | // If this is false, only blocking writes, on main thread are allowed. |
713 | | bool AllowOffMainThreadSave(); |
714 | | |
715 | | // Helpers for implementing |
716 | | // Register(Prefix)Callback/Unregister(Prefix)Callback. |
717 | | public: |
718 | | // Public so the ValueObserver classes can use it. |
719 | | enum MatchKind |
720 | | { |
721 | | PrefixMatch, |
722 | | ExactMatch, |
723 | | }; |
724 | | |
725 | | private: |
726 | | static void SetupTelemetryPref(); |
727 | | static mozilla::Result<mozilla::Ok, const char*> InitInitialObjects( |
728 | | bool aIsStartup); |
729 | | |
730 | | static nsresult RegisterCallback(PrefChangedFunc aCallback, |
731 | | const nsACString& aPref, |
732 | | void* aClosure, |
733 | | MatchKind aMatchKind, |
734 | | bool aIsPriority = false); |
735 | | static nsresult UnregisterCallback(PrefChangedFunc aCallback, |
736 | | const nsACString& aPref, |
737 | | void* aClosure, |
738 | | MatchKind aMatchKind); |
739 | | static nsresult RegisterCallbackAndCall(PrefChangedFunc aCallback, |
740 | | const nsACString& aPref, |
741 | | void* aClosure, |
742 | | MatchKind aMatchKind); |
743 | | |
744 | | static nsresult RegisterCallbacks(PrefChangedFunc aCallback, |
745 | | const char** aPrefs, |
746 | | void* aClosure, |
747 | | MatchKind aMatchKind); |
748 | | static nsresult UnregisterCallbacks(PrefChangedFunc aCallback, |
749 | | const char** aPrefs, |
750 | | void* aClosure, |
751 | | MatchKind aMatchKind); |
752 | | |
753 | | template<typename T> |
754 | | static nsresult RegisterCallbackImpl(PrefChangedFunc aCallback, |
755 | | T& aPref, |
756 | | void* aClosure, |
757 | | MatchKind aMatchKind, |
758 | | bool aIsPriority = false); |
759 | | template<typename T> |
760 | | static nsresult UnregisterCallbackImpl(PrefChangedFunc aCallback, |
761 | | T& aPref, |
762 | | void* aClosure, |
763 | | MatchKind aMatchKind); |
764 | | |
765 | | static nsresult RegisterCallback(PrefChangedFunc aCallback, |
766 | | const char* aPref, |
767 | | void* aClosure, |
768 | | MatchKind aMatchKind, |
769 | | bool aIsPriority = false) |
770 | 0 | { |
771 | 0 | return RegisterCallback( |
772 | 0 | aCallback, nsDependentCString(aPref), aClosure, aMatchKind, aIsPriority); |
773 | 0 | } |
774 | | static nsresult UnregisterCallback(PrefChangedFunc aCallback, |
775 | | const char* aPref, |
776 | | void* aClosure, |
777 | | MatchKind aMatchKind) |
778 | 0 | { |
779 | 0 | return UnregisterCallback( |
780 | 0 | aCallback, nsDependentCString(aPref), aClosure, aMatchKind); |
781 | 0 | } |
782 | | static nsresult RegisterCallbackAndCall(PrefChangedFunc aCallback, |
783 | | const char* aPref, |
784 | | void* aClosure, |
785 | | MatchKind aMatchKind) |
786 | 0 | { |
787 | 0 | return RegisterCallbackAndCall( |
788 | 0 | aCallback, nsDependentCString(aPref), aClosure, aMatchKind); |
789 | 0 | } |
790 | | |
791 | | private: |
792 | | nsCOMPtr<nsIFile> mCurrentFile; |
793 | | bool mDirty = false; |
794 | | bool mProfileShutdown = false; |
795 | | // We wait a bit after prefs are dirty before writing them. In this period, |
796 | | // mDirty and mSavePending will both be true. |
797 | | bool mSavePending = false; |
798 | | |
799 | | nsCOMPtr<nsIPrefBranch> mRootBranch; |
800 | | nsCOMPtr<nsIPrefBranch> mDefaultRootBranch; |
801 | | |
802 | | static StaticRefPtr<Preferences> sPreferences; |
803 | | static bool sShutdown; |
804 | | |
805 | | // Init static members. Returns true on success. |
806 | | static bool InitStaticMembers(); |
807 | | }; |
808 | | |
809 | | } // namespace mozilla |
810 | | |
811 | | #endif // mozilla_Preferences_h |