"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "modules/libpref/nsPrefBranch.cpp" between
UXP-2019.03.27.tar.gz and UXP-2019.06.08.tar.gz

About: Basilisk is a full-featured, optimized browser derived from the code behind the pre-Servo Firefox browser (29–56 era). UXP = Unified XUL Platform. Source code.

nsPrefBranch.cpp  (UXP-2019.03.27):nsPrefBranch.cpp  (UXP-2019.06.08)
skipping to change at line 142 skipping to change at line 142
*_retval = PREF_BOOL; *_retval = PREF_BOOL;
break; break;
case PrefType::Invalid: case PrefType::Invalid:
default: default:
*_retval = PREF_INVALID; *_retval = PREF_INVALID;
break; break;
} }
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP nsPrefBranch::GetBoolPrefWithDefault(const char *aPrefName,
bool aDefaultValue,
uint8_t _argc, bool *_retval)
{
nsresult rv = GetBoolPref(aPrefName, _retval);
if (NS_FAILED(rv) && _argc == 1) {
*_retval = aDefaultValue;
return NS_OK;
}
return rv;
}
NS_IMETHODIMP nsPrefBranch::GetBoolPref(const char *aPrefName, bool *_retval) NS_IMETHODIMP nsPrefBranch::GetBoolPref(const char *aPrefName, bool *_retval)
{ {
NS_ENSURE_ARG(aPrefName); NS_ENSURE_ARG(aPrefName);
const char *pref = getPrefName(aPrefName); const char *pref = getPrefName(aPrefName);
return PREF_GetBoolPref(pref, _retval, mIsDefault); return PREF_GetBoolPref(pref, _retval, mIsDefault);
} }
NS_IMETHODIMP nsPrefBranch::SetBoolPref(const char *aPrefName, bool aValue) NS_IMETHODIMP nsPrefBranch::SetBoolPref(const char *aPrefName, bool aValue)
{ {
ENSURE_MAIN_PROCESS("Cannot SetBoolPref from content process:", aPrefName); ENSURE_MAIN_PROCESS("Cannot SetBoolPref from content process:", aPrefName);
NS_ENSURE_ARG(aPrefName); NS_ENSURE_ARG(aPrefName);
const char *pref = getPrefName(aPrefName); const char *pref = getPrefName(aPrefName);
return PREF_SetBoolPref(pref, aValue, mIsDefault); return PREF_SetBoolPref(pref, aValue, mIsDefault);
} }
NS_IMETHODIMP nsPrefBranch::GetFloatPrefWithDefault(const char *aPrefName,
float aDefaultValue,
uint8_t _argc, float *_retva
l)
{
nsresult rv = GetFloatPref(aPrefName, _retval);
if (NS_FAILED(rv) && _argc == 1) {
*_retval = aDefaultValue;
return NS_OK;
}
return rv;
}
NS_IMETHODIMP nsPrefBranch::GetFloatPref(const char *aPrefName, float *_retval) NS_IMETHODIMP nsPrefBranch::GetFloatPref(const char *aPrefName, float *_retval)
{ {
NS_ENSURE_ARG(aPrefName); NS_ENSURE_ARG(aPrefName);
const char *pref = getPrefName(aPrefName); const char *pref = getPrefName(aPrefName);
nsAutoCString stringVal; nsAutoCString stringVal;
nsresult rv = GetCharPref(pref, getter_Copies(stringVal)); nsresult rv = GetCharPref(pref, getter_Copies(stringVal));
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
*_retval = stringVal.ToFloat(&rv); *_retval = stringVal.ToFloat(&rv);
} }
return rv; return rv;
} }
NS_IMETHODIMP nsPrefBranch::GetCharPrefWithDefault(const char *aPrefName,
const char *aDefaultValue,
uint8_t _argc, char **_retval
)
{
nsresult rv = GetCharPref(aPrefName, _retval);
if (NS_FAILED(rv) && _argc == 1) {
NS_ENSURE_ARG(aDefaultValue);
*_retval = NS_strdup(aDefaultValue);
return NS_OK;
}
return rv;
}
NS_IMETHODIMP nsPrefBranch::GetCharPref(const char *aPrefName, char **_retval) NS_IMETHODIMP nsPrefBranch::GetCharPref(const char *aPrefName, char **_retval)
{ {
NS_ENSURE_ARG(aPrefName); NS_ENSURE_ARG(aPrefName);
const char *pref = getPrefName(aPrefName); const char *pref = getPrefName(aPrefName);
return PREF_CopyCharPref(pref, _retval, mIsDefault); return PREF_CopyCharPref(pref, _retval, mIsDefault);
} }
NS_IMETHODIMP nsPrefBranch::SetCharPref(const char *aPrefName, const char *aValu e) NS_IMETHODIMP nsPrefBranch::SetCharPref(const char *aPrefName, const char *aValu e)
{ {
nsresult rv = CheckSanityOfStringLength(aPrefName, aValue); nsresult rv = CheckSanityOfStringLength(aPrefName, aValue);
skipping to change at line 196 skipping to change at line 239
nsresult nsPrefBranch::SetCharPrefInternal(const char *aPrefName, const char *aV alue) nsresult nsPrefBranch::SetCharPrefInternal(const char *aPrefName, const char *aV alue)
{ {
ENSURE_MAIN_PROCESS("Cannot SetCharPref from content process:", aPrefName); ENSURE_MAIN_PROCESS("Cannot SetCharPref from content process:", aPrefName);
NS_ENSURE_ARG(aPrefName); NS_ENSURE_ARG(aPrefName);
NS_ENSURE_ARG(aValue); NS_ENSURE_ARG(aValue);
const char *pref = getPrefName(aPrefName); const char *pref = getPrefName(aPrefName);
return PREF_SetCharPref(pref, aValue, mIsDefault); return PREF_SetCharPref(pref, aValue, mIsDefault);
} }
NS_IMETHODIMP nsPrefBranch::GetIntPrefWithDefault(const char *aPrefName,
int32_t aDefaultValue,
uint8_t _argc, int32_t *_retva
l)
{
nsresult rv = GetIntPref(aPrefName, _retval);
if (NS_FAILED(rv) && _argc == 1) {
*_retval = aDefaultValue;
return NS_OK;
}
return rv;
}
NS_IMETHODIMP nsPrefBranch::GetIntPref(const char *aPrefName, int32_t *_retval) NS_IMETHODIMP nsPrefBranch::GetIntPref(const char *aPrefName, int32_t *_retval)
{ {
NS_ENSURE_ARG(aPrefName); NS_ENSURE_ARG(aPrefName);
const char *pref = getPrefName(aPrefName); const char *pref = getPrefName(aPrefName);
return PREF_GetIntPref(pref, _retval, mIsDefault); return PREF_GetIntPref(pref, _retval, mIsDefault);
} }
NS_IMETHODIMP nsPrefBranch::SetIntPref(const char *aPrefName, int32_t aValue) NS_IMETHODIMP nsPrefBranch::SetIntPref(const char *aPrefName, int32_t aValue)
{ {
ENSURE_MAIN_PROCESS("Cannot SetIntPref from content process:", aPrefName); ENSURE_MAIN_PROCESS("Cannot SetIntPref from content process:", aPrefName);
 End of changes. 4 change blocks. 
0 lines changed or deleted 60 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)