--- 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