Bug 1415799 - Rename pref_HashPref() as pref_SetPref(). r=glandium.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 09 Nov 2017 18:00:42 +1100
changeset 444415 72bc69654fcd69b48ab8de35e9a23b83157ce31b
parent 444414 14ad11ba54d7daea9fbe68fe7e1bf9e821d6989c
child 444416 ab43c3e25edde54fd007820afb33d0836394efa5
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1415799
milestone58.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 1415799 - Rename pref_HashPref() as pref_SetPref(). r=glandium. Because it sets the pref. MozReview-Commit-ID: IlEVRWKU94X
modules/libpref/Preferences.cpp
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
@@ -352,20 +352,20 @@ pref_DoCallback(const char* aChangedPref
 enum
 {
   kPrefSetDefault = 1,
   kPrefForceSet = 2,
   kPrefStickyDefault = 4,
 };
 
 static nsresult
-pref_HashPref(const char* aKey,
-              PrefValue aValue,
-              PrefType aType,
-              uint32_t aFlags);
+pref_SetPref(const char* aKey,
+             PrefValue aValue,
+             PrefType aType,
+             uint32_t aFlags);
 
 #define PREF_HASHTABLE_INITIAL_LENGTH 1024
 
 // Assign to aResult a quoted, escaped copy of aOriginal.
 static void
 StrEscape(const char* aOriginal, nsCString& aResult)
 {
   if (aOriginal == nullptr) {
@@ -436,44 +436,44 @@ PREF_SetCStringPref(const char* aPrefNam
                     const nsACString& aValue,
                     bool aSetDefault)
 {
   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
-  // pref because pref_HashPref() duplicates those chars.
+  // pref because pref_SetPref() duplicates those chars.
   PrefValue pref;
   const nsCString& flat = PromiseFlatCString(aValue);
   pref.mStringVal = flat.get();
 
-  return pref_HashPref(
+  return pref_SetPref(
     aPrefName, pref, PrefType::String, aSetDefault ? kPrefSetDefault : 0);
 }
 
 // Like PREF_SetCStringPref(), but for integers.
 static nsresult
 PREF_SetIntPref(const char* aPrefName, int32_t aValue, bool aSetDefault)
 {
   PrefValue pref;
   pref.mIntVal = aValue;
 
-  return pref_HashPref(
+  return pref_SetPref(
     aPrefName, pref, PrefType::Int, aSetDefault ? kPrefSetDefault : 0);
 }
 
 // Like PREF_SetCStringPref(), but for booleans.
 static nsresult
 PREF_SetBoolPref(const char* aPrefName, bool aValue, bool aSetDefault)
 {
   PrefValue pref;
   pref.mBoolVal = aValue;
 
-  return pref_HashPref(
+  return pref_SetPref(
     aPrefName, pref, PrefType::Bool, aSetDefault ? kPrefSetDefault : 0);
 }
 
 enum WhichValue
 {
   DEFAULT_VALUE,
   USER_VALUE
 };
@@ -919,20 +919,20 @@ pref_HashTableLookup(const char* aKey)
       "accessing non-init pref %s before the rest of the prefs are sent", aKey);
   }
 #endif
 
   return static_cast<PrefHashEntry*>(gHashTable->Search(aKey));
 }
 
 static nsresult
-pref_HashPref(const char* aKey,
-              PrefValue aValue,
-              PrefType aType,
-              uint32_t aFlags)
+pref_SetPref(const char* aKey,
+             PrefValue aValue,
+             PrefType aType,
+             uint32_t aFlags)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!gHashTable) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   auto pref = static_cast<PrefHashEntry*>(gHashTable->Add(aKey, fallible));
@@ -1191,17 +1191,17 @@ PREF_ReaderCallback(void* aClosure,
   if (aIsDefault) {
     flags |= kPrefSetDefault;
     if (aIsStickyDefault) {
       flags |= kPrefStickyDefault;
     }
   } else {
     flags |= kPrefForceSet;
   }
-  pref_HashPref(aPref, aValue, aType, flags);
+  pref_SetPref(aPref, aValue, aType, flags);
 }
 
 //===========================================================================
 // Prefs parsing
 //===========================================================================
 
 // Callback function used to notify consumer of preference name value pairs.
 // The pref name and value must be copied by the implementor of the callback