Bug 1523969 part 17 - Move method definition inline comments to new line in 'modules/'. r=ehsan
authorRyan Hunt <rhunt@eqrion.net>
Mon, 25 Feb 2019 16:10:36 -0600
changeset 519780 e850de3b6ac3befb988c4360690269b5a2d8305b
parent 519779 53d0d3dcfe6efa01fe4f3b0877f06b69f5d4bb97
child 519781 51a98c1a814f3a805e638149f778f3be1eca6583
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1523969
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1523969 part 17 - Move method definition inline comments to new line in 'modules/'. r=ehsan Differential Revision: https://phabricator.services.mozilla.com/D21118
modules/libjar/nsJARURI.cpp
modules/libpref/Preferences.cpp
--- a/modules/libjar/nsJARURI.cpp
+++ b/modules/libjar/nsJARURI.cpp
@@ -446,18 +446,20 @@ nsJARURI::Equals(nsIURI *other, bool *re
 }
 
 NS_IMETHODIMP
 nsJARURI::EqualsExceptRef(nsIURI *other, bool *result) {
   return EqualsInternal(other, eIgnoreRef, result);
 }
 
 // Helper method:
-/* virtual */ nsresult nsJARURI::EqualsInternal(
-    nsIURI *other, nsJARURI::RefHandlingEnum refHandlingMode, bool *result) {
+/* virtual */
+nsresult nsJARURI::EqualsInternal(nsIURI *other,
+                                  nsJARURI::RefHandlingEnum refHandlingMode,
+                                  bool *result) {
   *result = false;
 
   if (!other) return NS_OK;  // not equal
 
   RefPtr<nsJARURI> otherJAR = do_QueryObject(other);
   if (!otherJAR) return NS_OK;  // not equal
 
   bool equal;
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
@@ -2727,18 +2727,18 @@ nsPrefBranch::Observe(nsISupports* aSubj
   // Watch for xpcom shutdown and free our observers to eliminate any cyclic
   // references.
   if (!nsCRT::strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
     FreeObserverList();
   }
   return NS_OK;
 }
 
-/* static */ void nsPrefBranch::NotifyObserver(const char* aNewPref,
-                                               void* aData) {
+/* static */
+void nsPrefBranch::NotifyObserver(const char* aNewPref, void* aData) {
   PrefCallback* pCallback = (PrefCallback*)aData;
 
   nsCOMPtr<nsIObserver> observer = pCallback->GetObserver();
   if (!observer) {
     // The observer has expired.  Let's remove this callback.
     pCallback->GetPrefBranch()->RemoveExpiredCallback(pCallback);
     return;
   }
@@ -3123,18 +3123,19 @@ static void AssertNotAlreadyCached(const
 
 static void AssertNotAlreadyCached(const char* aPrefType,
                                    const nsACString& aPref, void* aPtr) {
   AssertNotAlreadyCached(aPrefType, PromiseFlatCString(aPref).get(), aPtr);
 }
 
 // Although this is a member of Preferences, it measures sPreferences and
 // several other global structures.
-/* static */ void Preferences::AddSizeOfIncludingThis(
-    MallocSizeOf aMallocSizeOf, PrefsSizes& aSizes) {
+/* static */
+void Preferences::AddSizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
+                                         PrefsSizes& aSizes) {
   if (!sPreferences) {
     return;
   }
 
   aSizes.mMisc += aMallocSizeOf(sPreferences.get());
 
   aSizes.mRootBranches +=
       static_cast<nsPrefBranch*>(sPreferences->mRootBranch.get())
@@ -3351,17 +3352,18 @@ static Maybe<bool> TelemetryPrefValue() 
 #  else
   nsAutoCString channelPrefValue;
   Unused << Preferences::GetCString(kChannelPref, channelPrefValue,
                                     PrefValueKind::Default);
   return Some(channelPrefValue.EqualsLiteral("beta"));
 #  endif
 }
 
-/* static */ void Preferences::SetupTelemetryPref() {
+/* static */
+void Preferences::SetupTelemetryPref() {
   MOZ_ASSERT(XRE_IsParentProcess());
 
   Maybe<bool> telemetryPrefValue = TelemetryPrefValue();
   if (telemetryPrefValue.isSome()) {
     Preferences::SetBool(kTelemetryPref, *telemetryPrefValue,
                          PrefValueKind::Default);
   }
 }
@@ -3397,17 +3399,18 @@ static bool TelemetryPrefValue() {
     if (channelPrefValue.EqualsLiteral("beta")) {
       return true;
     }
   }
 
   return false;
 }
 
-/* static */ void Preferences::SetupTelemetryPref() {
+/* static */
+void Preferences::SetupTelemetryPref() {
   MOZ_ASSERT(XRE_IsParentProcess());
 
   Preferences::SetBool(kTelemetryPref, TelemetryPrefValue(),
                        PrefValueKind::Default);
   Preferences::Lock(kTelemetryPref);
 }
 
 static void CheckTelemetryPref() {
@@ -3417,18 +3420,18 @@ static void CheckTelemetryPref() {
   DebugOnly<bool> value;
   MOZ_ASSERT(NS_SUCCEEDED(Preferences::GetBool(kTelemetryPref, &value)) &&
              value == TelemetryPrefValue());
   MOZ_ASSERT(Preferences::IsLocked(kTelemetryPref));
 }
 
 #endif  // MOZ_WIDGET_ANDROID
 
-/* static */ already_AddRefed<Preferences>
-Preferences::GetInstanceForService() {
+/* static */
+already_AddRefed<Preferences> Preferences::GetInstanceForService() {
   if (sPreferences) {
     return do_AddRef(sPreferences);
   }
 
   if (sShutdown) {
     gCacheDataDesc = "shutting down in GetInstanceForService()";
     return nullptr;
   }
@@ -3519,35 +3522,38 @@ Preferences::GetInstanceForService() {
   // memory reporter here; instead, do it off a runnable.
   RefPtr<AddPreferencesMemoryReporterRunnable> runnable =
       new AddPreferencesMemoryReporterRunnable();
   NS_DispatchToMainThread(runnable);
 
   return do_AddRef(sPreferences);
 }
 
-/* static */ bool Preferences::IsServiceAvailable() { return !!sPreferences; }
-
-/* static */ bool Preferences::InitStaticMembers() {
+/* static */
+bool Preferences::IsServiceAvailable() { return !!sPreferences; }
+
+/* static */
+bool Preferences::InitStaticMembers() {
   MOZ_ASSERT(NS_IsMainThread() || mozilla::ServoStyleSet::IsInServoTraversal());
 
   if (MOZ_LIKELY(sPreferences)) {
     return true;
   }
 
   if (!sShutdown) {
     MOZ_ASSERT(NS_IsMainThread());
     nsCOMPtr<nsIPrefService> prefService =
         do_GetService(NS_PREFSERVICE_CONTRACTID);
   }
 
   return sPreferences != nullptr;
 }
 
-/* static */ void Preferences::Shutdown() {
+/* static */
+void Preferences::Shutdown() {
   if (!sShutdown) {
     sShutdown = true;  // Don't create the singleton instance after here.
     sPreferences = nullptr;
   }
 }
 
 Preferences::Preferences()
     : mRootBranch(new nsPrefBranch("", PrefValueKind::User)),
@@ -3582,33 +3588,34 @@ Preferences::~Preferences() {
   gSharedMap = nullptr;
 
   gPrefNameArena.Clear();
 }
 
 NS_IMPL_ISUPPORTS(Preferences, nsIPrefService, nsIObserver, nsIPrefBranch,
                   nsISupportsWeakReference)
 
-/* static */ void Preferences::SerializePreferences(nsCString& aStr) {
+/* static */
+void Preferences::SerializePreferences(nsCString& aStr) {
   MOZ_RELEASE_ASSERT(InitStaticMembers());
 
   aStr.Truncate();
 
   for (auto iter = gHashTable->iter(); !iter.done(); iter.next()) {
     Pref* pref = iter.get().get();
     if (!pref->IsTypeNone() && pref->HasAdvisablySizedValues()) {
       pref->SerializeAndAppend(aStr);
     }
   }
 
   aStr.Append('\0');
 }
 
-/* static */ void Preferences::DeserializePreferences(char* aStr,
-                                                      size_t aPrefsLen) {
+/* static */
+void Preferences::DeserializePreferences(char* aStr, size_t aPrefsLen) {
   MOZ_ASSERT(!XRE_IsParentProcess());
 
   MOZ_ASSERT(!gChangedDomPrefs);
   gChangedDomPrefs = new InfallibleTArray<dom::Pref>();
 
   char* p = aStr;
   while (*p != '\0') {
     dom::Pref pref;
@@ -3621,17 +3628,18 @@ NS_IMPL_ISUPPORTS(Preferences, nsIPrefSe
   MOZ_ASSERT(p == aStr + aPrefsLen - 1);
 
 #ifdef DEBUG
   MOZ_ASSERT(!gContentProcessPrefsAreInited);
   gContentProcessPrefsAreInited = true;
 #endif
 }
 
-/* static */ FileDescriptor Preferences::EnsureSnapshot(size_t* aSize) {
+/* static */
+FileDescriptor Preferences::EnsureSnapshot(size_t* aSize) {
   MOZ_ASSERT(XRE_IsParentProcess());
 
   if (!gSharedMap) {
     SharedPrefMapBuilder builder;
 
     for (auto iter = gHashTable->iter(); !iter.done(); iter.next()) {
       iter.get()->AddToMap(builder);
     }
@@ -3652,25 +3660,26 @@ NS_IMPL_ISUPPORTS(Preferences, nsIPrefSe
 
     gPrefNameArena.Clear();
   }
 
   *aSize = gSharedMap->MapSize();
   return gSharedMap->CloneFileDescriptor();
 }
 
-/* static */ void Preferences::InitSnapshot(const FileDescriptor& aHandle,
-                                            size_t aSize) {
+/* static */
+void Preferences::InitSnapshot(const FileDescriptor& aHandle, size_t aSize) {
   MOZ_ASSERT(!XRE_IsParentProcess());
   MOZ_ASSERT(!gSharedMap);
 
   gSharedMap = new SharedPrefMap(aHandle, aSize);
 }
 
-/* static */ void Preferences::InitializeUserPrefs() {
+/* static */
+void Preferences::InitializeUserPrefs() {
   MOZ_ASSERT(XRE_IsParentProcess());
   MOZ_ASSERT(!sPreferences->mCurrentFile, "Should only initialize prefs once");
 
   // Prefs which are set before we initialize the profile are silently
   // discarded. This is stupid, but there are various tests which depend on
   // this behavior.
   sPreferences->ResetUserPrefs();
 
@@ -3834,17 +3843,18 @@ nsresult Preferences::SavePrefFileAsynch
 }
 
 NS_IMETHODIMP
 Preferences::SavePrefFile(nsIFile* aFile) {
   // This is the method accessible from service API. Make it off main thread.
   return SavePrefFileInternal(aFile, SaveMethod::Asynchronous);
 }
 
-/* static */ void Preferences::SetPreference(const dom::Pref& aDomPref) {
+/* static */
+void Preferences::SetPreference(const dom::Pref& aDomPref) {
   MOZ_ASSERT(!XRE_IsParentProcess());
   NS_ENSURE_TRUE(InitStaticMembers(), (void)0);
 
   const char* prefName = aDomPref.name().get();
 
   Pref* pref;
   auto p = gHashTable->lookupForAdd(prefName);
   if (!p) {
@@ -3888,17 +3898,18 @@ Preferences::SavePrefFile(nsIFile* aFile
     if (pref) {
       NotifyCallbacks(prefName, PrefWrapper(pref));
     } else {
       NotifyCallbacks(prefName);
     }
   }
 }
 
-/* static */ void Preferences::GetPreference(dom::Pref* aDomPref) {
+/* static */
+void Preferences::GetPreference(dom::Pref* aDomPref) {
   MOZ_ASSERT(XRE_IsParentProcess());
 
   Pref* pref = pref_HashTableLookup(aDomPref->name().get());
   if (pref && pref->HasAdvisablySizedValues()) {
     pref->ToDomPref(aDomPref);
   }
 }
 
@@ -4554,111 +4565,114 @@ float MOZ_MAYBE_UNUSED GetPref<float>(co
   NS_ENSURE_SUCCESS(rv, Err("GetObserverService() failed (2)"));
 
   observerService->NotifyObservers(nullptr, NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID,
                                    nullptr);
 
   return Ok();
 }
 
-/* static */ nsresult Preferences::GetBool(const char* aPrefName, bool* aResult,
-                                           PrefValueKind aKind) {
+/* static */
+nsresult Preferences::GetBool(const char* aPrefName, bool* aResult,
+                              PrefValueKind aKind) {
   MOZ_ASSERT(aResult);
   NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
 
   Maybe<PrefWrapper> pref = pref_Lookup(aPrefName);
   return pref.isSome() ? pref->GetBoolValue(aKind, aResult)
                        : NS_ERROR_UNEXPECTED;
 }
 
-/* static */ nsresult Preferences::GetInt(const char* aPrefName,
-                                          int32_t* aResult,
-                                          PrefValueKind aKind) {
+/* static */
+nsresult Preferences::GetInt(const char* aPrefName, int32_t* aResult,
+                             PrefValueKind aKind) {
   MOZ_ASSERT(aResult);
   NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
 
   Maybe<PrefWrapper> pref = pref_Lookup(aPrefName);
   return pref.isSome() ? pref->GetIntValue(aKind, aResult)
                        : NS_ERROR_UNEXPECTED;
 }
 
-/* static */ nsresult Preferences::GetFloat(const char* aPrefName,
-                                            float* aResult,
-                                            PrefValueKind aKind) {
+/* static */
+nsresult Preferences::GetFloat(const char* aPrefName, float* aResult,
+                               PrefValueKind aKind) {
   MOZ_ASSERT(aResult);
 
   nsAutoCString result;
   nsresult rv = Preferences::GetCString(aPrefName, result, aKind);
   if (NS_SUCCEEDED(rv)) {
     // ToFloat() does a locale-independent conversion.
     *aResult = result.ToFloat(&rv);
   }
   return rv;
 }
 
-/* static */ nsresult Preferences::GetCString(const char* aPrefName,
-                                              nsACString& aResult,
-                                              PrefValueKind aKind) {
+/* static */
+nsresult Preferences::GetCString(const char* aPrefName, nsACString& aResult,
+                                 PrefValueKind aKind) {
   NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
 
   aResult.SetIsVoid(true);
 
   Maybe<PrefWrapper> pref = pref_Lookup(aPrefName);
   return pref.isSome() ? pref->GetCStringValue(aKind, aResult)
                        : NS_ERROR_UNEXPECTED;
 }
 
-/* static */ nsresult Preferences::GetString(const char* aPrefName,
-                                             nsAString& aResult,
-                                             PrefValueKind aKind) {
+/* static */
+nsresult Preferences::GetString(const char* aPrefName, nsAString& aResult,
+                                PrefValueKind aKind) {
   nsAutoCString result;
   nsresult rv = Preferences::GetCString(aPrefName, result, aKind);
   if (NS_SUCCEEDED(rv)) {
     CopyUTF8toUTF16(result, aResult);
   }
   return rv;
 }
 
-/* static */ nsresult Preferences::GetLocalizedCString(const char* aPrefName,
-                                                       nsACString& aResult,
-                                                       PrefValueKind aKind) {
+/* static */
+nsresult Preferences::GetLocalizedCString(const char* aPrefName,
+                                          nsACString& aResult,
+                                          PrefValueKind aKind) {
   nsAutoString result;
   nsresult rv = GetLocalizedString(aPrefName, result, aKind);
   if (NS_SUCCEEDED(rv)) {
     CopyUTF16toUTF8(result, aResult);
   }
   return rv;
 }
 
-/* static */ nsresult Preferences::GetLocalizedString(const char* aPrefName,
-                                                      nsAString& aResult,
-                                                      PrefValueKind aKind) {
+/* static */
+nsresult Preferences::GetLocalizedString(const char* aPrefName,
+                                         nsAString& aResult,
+                                         PrefValueKind aKind) {
   NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
   nsCOMPtr<nsIPrefLocalizedString> prefLocalString;
   nsresult rv = GetRootBranch(aKind)->GetComplexValue(
       aPrefName, NS_GET_IID(nsIPrefLocalizedString),
       getter_AddRefs(prefLocalString));
   if (NS_SUCCEEDED(rv)) {
     MOZ_ASSERT(prefLocalString, "Succeeded but the result is NULL");
     prefLocalString->GetData(aResult);
   }
   return rv;
 }
 
-/* static */ nsresult Preferences::GetComplex(const char* aPrefName,
-                                              const nsIID& aType,
-                                              void** aResult,
-                                              PrefValueKind aKind) {
+/* static */
+nsresult Preferences::GetComplex(const char* aPrefName, const nsIID& aType,
+                                 void** aResult, PrefValueKind aKind) {
   NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
   return GetRootBranch(aKind)->GetComplexValue(aPrefName, aType, aResult);
 }
 
-/* static */ nsresult Preferences::SetCString(const char* aPrefName,
-                                              const nsACString& aValue,
-                                              PrefValueKind aKind) {
+/* static */
+nsresult Preferences::SetCString(const char* aPrefName,
+                                 const nsACString& aValue,
+                                 PrefValueKind aKind) {
   ENSURE_PARENT_PROCESS("SetCString", aPrefName);
   NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
 
   if (aValue.Length() > MAX_PREF_LENGTH) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
 
   // It's ok to stash a pointer to the temporary PromiseFlatCString's chars in
@@ -4667,51 +4681,53 @@ float MOZ_MAYBE_UNUSED GetPref<float>(co
   const nsCString& flat = PromiseFlatCString(aValue);
   prefValue.mStringVal = flat.get();
   return pref_SetPref(aPrefName, PrefType::String, aKind, prefValue,
                       /* isSticky */ false,
                       /* isLocked */ false,
                       /* fromInit */ false);
 }
 
-/* static */ nsresult Preferences::SetBool(const char* aPrefName, bool aValue,
-                                           PrefValueKind aKind) {
+/* static */
+nsresult Preferences::SetBool(const char* aPrefName, bool aValue,
+                              PrefValueKind aKind) {
   ENSURE_PARENT_PROCESS("SetBool", aPrefName);
   NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
 
   PrefValue prefValue;
   prefValue.mBoolVal = aValue;
   return pref_SetPref(aPrefName, PrefType::Bool, aKind, prefValue,
                       /* isSticky */ false,
                       /* isLocked */ false,
                       /* fromInit */ false);
 }
 
-/* static */ nsresult Preferences::SetInt(const char* aPrefName, int32_t aValue,
-                                          PrefValueKind aKind) {
+/* static */
+nsresult Preferences::SetInt(const char* aPrefName, int32_t aValue,
+                             PrefValueKind aKind) {
   ENSURE_PARENT_PROCESS("SetInt", aPrefName);
   NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
 
   PrefValue prefValue;
   prefValue.mIntVal = aValue;
   return pref_SetPref(aPrefName, PrefType::Int, aKind, prefValue,
                       /* isSticky */ false,
                       /* isLocked */ false,
                       /* fromInit */ false);
 }
 
-/* static */ nsresult Preferences::SetComplex(const char* aPrefName,
-                                              const nsIID& aType,
-                                              nsISupports* aValue,
-                                              PrefValueKind aKind) {
+/* static */
+nsresult Preferences::SetComplex(const char* aPrefName, const nsIID& aType,
+                                 nsISupports* aValue, PrefValueKind aKind) {
   NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
   return GetRootBranch(aKind)->SetComplexValue(aPrefName, aType, aValue);
 }
 
-/* static */ nsresult Preferences::Lock(const char* aPrefName) {
+/* static */
+nsresult Preferences::Lock(const char* aPrefName) {
   ENSURE_PARENT_PROCESS("Lock", aPrefName);
   NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
 
   Pref* pref;
   MOZ_TRY_VAR(pref,
               pref_LookupForModify(aPrefName, [](const PrefWrapper& aPref) {
                 return !aPref.IsLocked();
               }));
@@ -4719,17 +4735,18 @@ float MOZ_MAYBE_UNUSED GetPref<float>(co
   if (pref) {
     pref->SetIsLocked(true);
     NotifyCallbacks(aPrefName, PrefWrapper(pref));
   }
 
   return NS_OK;
 }
 
-/* static */ nsresult Preferences::Unlock(const char* aPrefName) {
+/* static */
+nsresult Preferences::Unlock(const char* aPrefName) {
   ENSURE_PARENT_PROCESS("Unlock", aPrefName);
   NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
 
   Pref* pref;
   MOZ_TRY_VAR(pref,
               pref_LookupForModify(aPrefName, [](const PrefWrapper& aPref) {
                 return aPref.IsLocked();
               }));
@@ -4737,24 +4754,26 @@ float MOZ_MAYBE_UNUSED GetPref<float>(co
   if (pref) {
     pref->SetIsLocked(false);
     NotifyCallbacks(aPrefName, PrefWrapper(pref));
   }
 
   return NS_OK;
 }
 
-/* static */ bool Preferences::IsLocked(const char* aPrefName) {
+/* static */
+bool Preferences::IsLocked(const char* aPrefName) {
   NS_ENSURE_TRUE(InitStaticMembers(), false);
 
   Maybe<PrefWrapper> pref = pref_Lookup(aPrefName);
   return pref.isSome() && pref->IsLocked();
 }
 
-/* static */ nsresult Preferences::ClearUser(const char* aPrefName) {
+/* static */
+nsresult Preferences::ClearUser(const char* aPrefName) {
   ENSURE_PARENT_PROCESS("ClearUser", aPrefName);
   NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
 
   auto result = pref_LookupForModify(
       aPrefName, [](const PrefWrapper& aPref) { return aPref.HasUserValue(); });
   if (result.isErr()) {
     return NS_OK;
   }
@@ -4774,24 +4793,26 @@ float MOZ_MAYBE_UNUSED GetPref<float>(co
       NotifyCallbacks(aPrefName, PrefWrapper(pref));
     }
 
     Preferences::HandleDirty();
   }
   return NS_OK;
 }
 
-/* static */ bool Preferences::HasUserValue(const char* aPrefName) {
+/* static */
+bool Preferences::HasUserValue(const char* aPrefName) {
   NS_ENSURE_TRUE(InitStaticMembers(), false);
 
   Maybe<PrefWrapper> pref = pref_Lookup(aPrefName);
   return pref.isSome() && pref->HasUserValue();
 }
 
-/* static */ int32_t Preferences::GetType(const char* aPrefName) {
+/* static */
+int32_t Preferences::GetType(const char* aPrefName) {
   NS_ENSURE_TRUE(InitStaticMembers(), nsIPrefBranch::PREF_INVALID);
 
   if (!gHashTable) {
     return PREF_INVALID;
   }
 
   Maybe<PrefWrapper> pref = pref_Lookup(aPrefName);
   if (!pref.isSome()) {
@@ -4808,32 +4829,35 @@ float MOZ_MAYBE_UNUSED GetPref<float>(co
     case PrefType::Bool:
       return PREF_BOOL;
 
     default:
       MOZ_CRASH();
   }
 }
 
-/* static */ nsresult Preferences::AddStrongObserver(nsIObserver* aObserver,
-                                                     const nsACString& aPref) {
+/* static */
+nsresult Preferences::AddStrongObserver(nsIObserver* aObserver,
+                                        const nsACString& aPref) {
   MOZ_ASSERT(aObserver);
   NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
   return sPreferences->mRootBranch->AddObserver(aPref, aObserver, false);
 }
 
-/* static */ nsresult Preferences::AddWeakObserver(nsIObserver* aObserver,
-                                                   const nsACString& aPref) {
+/* static */
+nsresult Preferences::AddWeakObserver(nsIObserver* aObserver,
+                                      const nsACString& aPref) {
   MOZ_ASSERT(aObserver);
   NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
   return sPreferences->mRootBranch->AddObserver(aPref, aObserver, true);
 }
 
-/* static */ nsresult Preferences::RemoveObserver(nsIObserver* aObserver,
-                                                  const nsACString& aPref) {
+/* static */
+nsresult Preferences::RemoveObserver(nsIObserver* aObserver,
+                                     const nsACString& aPref) {
   MOZ_ASSERT(aObserver);
   if (sShutdown) {
     MOZ_ASSERT(!sPreferences);
     return NS_OK;  // Observers have been released automatically.
   }
   NS_ENSURE_TRUE(sPreferences, NS_ERROR_NOT_AVAILABLE);
   return sPreferences->mRootBranch->RemoveObserver(aPref, aObserver);
 }
@@ -4842,64 +4866,69 @@ template <typename T>
 static void AssertNotMallocAllocated(T* aPtr) {
 #if defined(DEBUG) && defined(MOZ_MEMORY)
   jemalloc_ptr_info_t info;
   jemalloc_ptr_info((void*)aPtr, &info);
   MOZ_ASSERT(info.tag == TagUnknown);
 #endif
 }
 
-/* static */ nsresult Preferences::AddStrongObservers(nsIObserver* aObserver,
-                                                      const char** aPrefs) {
+/* static */
+nsresult Preferences::AddStrongObservers(nsIObserver* aObserver,
+                                         const char** aPrefs) {
   MOZ_ASSERT(aObserver);
   for (uint32_t i = 0; aPrefs[i]; i++) {
     AssertNotMallocAllocated(aPrefs[i]);
 
     nsCString pref;
     pref.AssignLiteral(aPrefs[i], strlen(aPrefs[i]));
     nsresult rv = AddStrongObserver(aObserver, pref);
     NS_ENSURE_SUCCESS(rv, rv);
   }
   return NS_OK;
 }
 
-/* static */ nsresult Preferences::AddWeakObservers(nsIObserver* aObserver,
-                                                    const char** aPrefs) {
+/* static */
+nsresult Preferences::AddWeakObservers(nsIObserver* aObserver,
+                                       const char** aPrefs) {
   MOZ_ASSERT(aObserver);
   for (uint32_t i = 0; aPrefs[i]; i++) {
     AssertNotMallocAllocated(aPrefs[i]);
 
     nsCString pref;
     pref.AssignLiteral(aPrefs[i], strlen(aPrefs[i]));
     nsresult rv = AddWeakObserver(aObserver, pref);
     NS_ENSURE_SUCCESS(rv, rv);
   }
   return NS_OK;
 }
 
-/* static */ nsresult Preferences::RemoveObservers(nsIObserver* aObserver,
-                                                   const char** aPrefs) {
+/* static */
+nsresult Preferences::RemoveObservers(nsIObserver* aObserver,
+                                      const char** aPrefs) {
   MOZ_ASSERT(aObserver);
   if (sShutdown) {
     MOZ_ASSERT(!sPreferences);
     return NS_OK;  // Observers have been released automatically.
   }
   NS_ENSURE_TRUE(sPreferences, NS_ERROR_NOT_AVAILABLE);
 
   for (uint32_t i = 0; aPrefs[i]; i++) {
     nsresult rv = RemoveObserver(aObserver, nsDependentCString(aPrefs[i]));
     NS_ENSURE_SUCCESS(rv, rv);
   }
   return NS_OK;
 }
 
 template <typename T>
-/* static */ nsresult Preferences::RegisterCallbackImpl(
-    PrefChangedFunc aCallback, T& aPrefNode, void* aData, MatchKind aMatchKind,
-    bool aIsPriority) {
+/* static */
+nsresult Preferences::RegisterCallbackImpl(PrefChangedFunc aCallback,
+                                           T& aPrefNode, void* aData,
+                                           MatchKind aMatchKind,
+                                           bool aIsPriority) {
   NS_ENSURE_ARG(aCallback);
 
   NS_ENSURE_TRUE(InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
 
   auto node = new CallbackNode(aPrefNode, aCallback, aData, aMatchKind);
 
   if (aIsPriority) {
     // Add to the start of the list.
@@ -4917,61 +4946,65 @@ template <typename T>
       node->SetNext(gFirstCallback);
       gFirstCallback = node;
     }
   }
 
   return NS_OK;
 }
 
-/* static */ nsresult Preferences::RegisterCallback(PrefChangedFunc aCallback,
-                                                    const nsACString& aPrefNode,
-                                                    void* aData,
-                                                    MatchKind aMatchKind,
-                                                    bool aIsPriority) {
+/* static */
+nsresult Preferences::RegisterCallback(PrefChangedFunc aCallback,
+                                       const nsACString& aPrefNode, void* aData,
+                                       MatchKind aMatchKind, bool aIsPriority) {
   return RegisterCallbackImpl(aCallback, aPrefNode, aData, aMatchKind,
                               aIsPriority);
 }
 
-/* static */ nsresult Preferences::RegisterCallbacks(PrefChangedFunc aCallback,
-                                                     const char** aPrefs,
-                                                     void* aData,
-                                                     MatchKind aMatchKind) {
+/* static */
+nsresult Preferences::RegisterCallbacks(PrefChangedFunc aCallback,
+                                        const char** aPrefs, void* aData,
+                                        MatchKind aMatchKind) {
   return RegisterCallbackImpl(aCallback, aPrefs, aData, aMatchKind);
 }
 
-/* static */ nsresult Preferences::RegisterCallbackAndCall(
-    PrefChangedFunc aCallback, const nsACString& aPref, void* aClosure,
-    MatchKind aMatchKind) {
+/* static */
+nsresult Preferences::RegisterCallbackAndCall(PrefChangedFunc aCallback,
+                                              const nsACString& aPref,
+                                              void* aClosure,
+                                              MatchKind aMatchKind) {
   MOZ_ASSERT(aCallback);
   nsresult rv = RegisterCallback(aCallback, aPref, aClosure, aMatchKind);
   if (NS_SUCCEEDED(rv)) {
     (*aCallback)(PromiseFlatCString(aPref).get(), aClosure);
   }
   return rv;
 }
 
-/* static */ nsresult Preferences::RegisterCallbacksAndCall(
-    PrefChangedFunc aCallback, const char** aPrefs, void* aClosure) {
+/* static */
+nsresult Preferences::RegisterCallbacksAndCall(PrefChangedFunc aCallback,
+                                               const char** aPrefs,
+                                               void* aClosure) {
   MOZ_ASSERT(aCallback);
 
   nsresult rv =
       RegisterCallbacks(aCallback, aPrefs, aClosure, MatchKind::ExactMatch);
   if (NS_SUCCEEDED(rv)) {
     for (const char** ptr = aPrefs; *ptr; ptr++) {
       (*aCallback)(*ptr, aClosure);
     }
   }
   return rv;
 }
 
 template <typename T>
-/* static */ nsresult Preferences::UnregisterCallbackImpl(
-    PrefChangedFunc aCallback, T& aPrefNode, void* aData,
-    MatchKind aMatchKind) {
+/* static */
+nsresult Preferences::UnregisterCallbackImpl(PrefChangedFunc aCallback,
+                                             T& aPrefNode, void* aData,
+                                             MatchKind aMatchKind) {
   MOZ_ASSERT(aCallback);
   if (sShutdown) {
     MOZ_ASSERT(!sPreferences);
     return NS_OK;  // Observers have been released automatically.
   }
   NS_ENSURE_TRUE(sPreferences, NS_ERROR_NOT_AVAILABLE);
 
   nsresult rv = NS_ERROR_FAILURE;
@@ -4995,46 +5028,47 @@ template <typename T>
     } else {
       prev_node = node;
       node = node->Next();
     }
   }
   return rv;
 }
 
-/* static */ nsresult Preferences::UnregisterCallback(
-    PrefChangedFunc aCallback, const nsACString& aPrefNode, void* aData,
-    MatchKind aMatchKind) {
+/* static */
+nsresult Preferences::UnregisterCallback(PrefChangedFunc aCallback,
+                                         const nsACString& aPrefNode,
+                                         void* aData, MatchKind aMatchKind) {
   return UnregisterCallbackImpl<const nsACString&>(aCallback, aPrefNode, aData,
                                                    aMatchKind);
 }
 
-/* static */ nsresult Preferences::UnregisterCallbacks(
-    PrefChangedFunc aCallback, const char** aPrefs, void* aData,
-    MatchKind aMatchKind) {
+/* static */
+nsresult Preferences::UnregisterCallbacks(PrefChangedFunc aCallback,
+                                          const char** aPrefs, void* aData,
+                                          MatchKind aMatchKind) {
   return UnregisterCallbackImpl(aCallback, aPrefs, aData, aMatchKind);
 }
 
 static void CacheDataAppendElement(CacheData* aData) {
   if (!gCacheData) {
     MOZ_CRASH_UNSAFE_PRINTF("!gCacheData: %s", gCacheDataDesc);
   }
   gCacheData->AppendElement(aData);
 }
 
 static void BoolVarChanged(const char* aPref, void* aClosure) {
   CacheData* cache = static_cast<CacheData*>(aClosure);
   *static_cast<bool*>(cache->mCacheLocation) =
       Preferences::GetBool(aPref, cache->mDefaultValueBool);
 }
 
-/* static */ nsresult Preferences::AddBoolVarCache(bool* aCache,
-                                                   const nsACString& aPref,
-                                                   bool aDefault,
-                                                   bool aSkipAssignment) {
+/* static */
+nsresult Preferences::AddBoolVarCache(bool* aCache, const nsACString& aPref,
+                                      bool aDefault, bool aSkipAssignment) {
   AssertNotAlreadyCached("bool", aPref, aCache);
   if (!aSkipAssignment) {
     *aCache = GetBool(PromiseFlatCString(aPref).get(), aDefault);
   }
   CacheData* data = new CacheData();
   data->mCacheLocation = aCache;
   data->mDefaultValueBool = aDefault;
   CacheDataAppendElement(data);
@@ -5047,19 +5081,21 @@ static void BoolVarChanged(const char* a
 template <MemoryOrdering Order>
 static void AtomicBoolVarChanged(const char* aPref, void* aClosure) {
   CacheData* cache = static_cast<CacheData*>(aClosure);
   *static_cast<Atomic<bool, Order>*>(cache->mCacheLocation) =
       Preferences::GetBool(aPref, cache->mDefaultValueBool);
 }
 
 template <MemoryOrdering Order>
-/* static */ nsresult Preferences::AddAtomicBoolVarCache(
-    Atomic<bool, Order>* aCache, const nsACString& aPref, bool aDefault,
-    bool aSkipAssignment) {
+/* static */
+nsresult Preferences::AddAtomicBoolVarCache(Atomic<bool, Order>* aCache,
+                                            const nsACString& aPref,
+                                            bool aDefault,
+                                            bool aSkipAssignment) {
   AssertNotAlreadyCached("bool", aPref, aCache);
   if (!aSkipAssignment) {
     *aCache = GetBool(PromiseFlatCString(aPref).get(), aDefault);
   }
   CacheData* data = new CacheData();
   data->mCacheLocation = aCache;
   data->mDefaultValueBool = aDefault;
   CacheDataAppendElement(data);
@@ -5070,20 +5106,19 @@ template <MemoryOrdering Order>
 }
 
 static void IntVarChanged(const char* aPref, void* aClosure) {
   CacheData* cache = static_cast<CacheData*>(aClosure);
   *static_cast<int32_t*>(cache->mCacheLocation) =
       Preferences::GetInt(aPref, cache->mDefaultValueInt);
 }
 
-/* static */ nsresult Preferences::AddIntVarCache(int32_t* aCache,
-                                                  const nsACString& aPref,
-                                                  int32_t aDefault,
-                                                  bool aSkipAssignment) {
+/* static */
+nsresult Preferences::AddIntVarCache(int32_t* aCache, const nsACString& aPref,
+                                     int32_t aDefault, bool aSkipAssignment) {
   AssertNotAlreadyCached("int", aPref, aCache);
   if (!aSkipAssignment) {
     *aCache = GetInt(PromiseFlatCString(aPref).get(), aDefault);
   }
   CacheData* data = new CacheData();
   data->mCacheLocation = aCache;
   data->mDefaultValueInt = aDefault;
   CacheDataAppendElement(data);
@@ -5095,19 +5130,21 @@ static void IntVarChanged(const char* aP
 template <MemoryOrdering Order>
 static void AtomicIntVarChanged(const char* aPref, void* aClosure) {
   CacheData* cache = static_cast<CacheData*>(aClosure);
   *static_cast<Atomic<int32_t, Order>*>(cache->mCacheLocation) =
       Preferences::GetInt(aPref, cache->mDefaultValueUint);
 }
 
 template <MemoryOrdering Order>
-/* static */ nsresult Preferences::AddAtomicIntVarCache(
-    Atomic<int32_t, Order>* aCache, const nsACString& aPref, int32_t aDefault,
-    bool aSkipAssignment) {
+/* static */
+nsresult Preferences::AddAtomicIntVarCache(Atomic<int32_t, Order>* aCache,
+                                           const nsACString& aPref,
+                                           int32_t aDefault,
+                                           bool aSkipAssignment) {
   AssertNotAlreadyCached("int", aPref, aCache);
   if (!aSkipAssignment) {
     *aCache = GetInt(PromiseFlatCString(aPref).get(), aDefault);
   }
   CacheData* data = new CacheData();
   data->mCacheLocation = aCache;
   data->mDefaultValueUint = aDefault;
   CacheDataAppendElement(data);
@@ -5118,20 +5155,19 @@ template <MemoryOrdering Order>
 }
 
 static void UintVarChanged(const char* aPref, void* aClosure) {
   CacheData* cache = static_cast<CacheData*>(aClosure);
   *static_cast<uint32_t*>(cache->mCacheLocation) =
       Preferences::GetUint(aPref, cache->mDefaultValueUint);
 }
 
-/* static */ nsresult Preferences::AddUintVarCache(uint32_t* aCache,
-                                                   const nsACString& aPref,
-                                                   uint32_t aDefault,
-                                                   bool aSkipAssignment) {
+/* static */
+nsresult Preferences::AddUintVarCache(uint32_t* aCache, const nsACString& aPref,
+                                      uint32_t aDefault, bool aSkipAssignment) {
   AssertNotAlreadyCached("uint", aPref, aCache);
   if (!aSkipAssignment) {
     *aCache = GetUint(PromiseFlatCString(aPref).get(), aDefault);
   }
   CacheData* data = new CacheData();
   data->mCacheLocation = aCache;
   data->mDefaultValueUint = aDefault;
   CacheDataAppendElement(data);
@@ -5144,19 +5180,21 @@ static void UintVarChanged(const char* a
 template <MemoryOrdering Order>
 static void AtomicUintVarChanged(const char* aPref, void* aClosure) {
   CacheData* cache = static_cast<CacheData*>(aClosure);
   *static_cast<Atomic<uint32_t, Order>*>(cache->mCacheLocation) =
       Preferences::GetUint(aPref, cache->mDefaultValueUint);
 }
 
 template <MemoryOrdering Order>
-/* static */ nsresult Preferences::AddAtomicUintVarCache(
-    Atomic<uint32_t, Order>* aCache, const nsACString& aPref, uint32_t aDefault,
-    bool aSkipAssignment) {
+/* static */
+nsresult Preferences::AddAtomicUintVarCache(Atomic<uint32_t, Order>* aCache,
+                                            const nsACString& aPref,
+                                            uint32_t aDefault,
+                                            bool aSkipAssignment) {
   AssertNotAlreadyCached("uint", aPref, aCache);
   if (!aSkipAssignment) {
     *aCache = GetUint(PromiseFlatCString(aPref).get(), aDefault);
   }
   CacheData* data = new CacheData();
   data->mCacheLocation = aCache;
   data->mDefaultValueUint = aDefault;
   CacheDataAppendElement(data);
@@ -5195,20 +5233,19 @@ template nsresult Preferences::AddAtomic
     bool);
 
 static void FloatVarChanged(const char* aPref, void* aClosure) {
   CacheData* cache = static_cast<CacheData*>(aClosure);
   *static_cast<float*>(cache->mCacheLocation) =
       Preferences::GetFloat(aPref, cache->mDefaultValueFloat);
 }
 
-/* static */ nsresult Preferences::AddFloatVarCache(float* aCache,
-                                                    const nsACString& aPref,
-                                                    float aDefault,
-                                                    bool aSkipAssignment) {
+/* static */
+nsresult Preferences::AddFloatVarCache(float* aCache, const nsACString& aPref,
+                                       float aDefault, bool aSkipAssignment) {
   AssertNotAlreadyCached("float", aPref, aCache);
   if (!aSkipAssignment) {
     *aCache = GetFloat(PromiseFlatCString(aPref).get(), aDefault);
   }
   CacheData* data = new CacheData();
   data->mCacheLocation = aCache;
   data->mDefaultValueFloat = aDefault;
   CacheDataAppendElement(data);
@@ -5365,17 +5402,18 @@ static void InitVarCachePref(const nsACS
     SetPref_float(PromiseFlatCString(aName).get(), aDefaultValue);
   }
   *aCache = aDefaultValue;
   if (aIsStartup) {
     Preferences::AddFloatVarCache(aCache, aName, aDefaultValue, true);
   }
 }
 
-/* static */ void StaticPrefs::InitAll(bool aIsStartup) {
+/* static */
+void StaticPrefs::InitAll(bool aIsStartup) {
   // For prefs like these:
   //
   //   PREF("foo.bar.baz", bool, true)
   //   VARCACHE_PREF("my.varcache", my_varcache, int32_t, 99)
   //
   // we generate registration calls:
   //
   //   if (isParent)