Bug 1062387 - Part 1. Fix clearing of camera preferences. r=mikeh

This commit is contained in:
Andrew Osmond 2015-02-13 09:18:49 -05:00
Родитель f7df755828
Коммит c59e55e503
1 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -45,6 +45,10 @@ CameraPreferences::UpdatePref(const char* aPref, nsresult& aVal)
nsresult rv = Preferences::GetUint(aPref, &val);
if (NS_SUCCEEDED(rv)) {
aVal = static_cast<nsresult>(val);
} else if(rv == NS_ERROR_UNEXPECTED) {
// Preference does not exist
rv = NS_OK;
aVal = NS_OK;
}
return rv;
}
@ -57,6 +61,10 @@ CameraPreferences::UpdatePref(const char* aPref, uint32_t& aVal)
nsresult rv = Preferences::GetUint(aPref, &val);
if (NS_SUCCEEDED(rv)) {
aVal = val;
} else if(rv == NS_ERROR_UNEXPECTED) {
// Preference does not exist
rv = NS_OK;
aVal = 0;
}
return rv;
}
@ -69,6 +77,10 @@ CameraPreferences::UpdatePref(const char* aPref, nsACString& aVal)
nsresult rv = Preferences::GetCString(aPref, &val);
if (NS_SUCCEEDED(rv)) {
aVal = val;
} else if(rv == NS_ERROR_UNEXPECTED) {
// Preference does not exist
rv = NS_OK;
aVal.Truncate();
}
return rv;
}
@ -81,6 +93,10 @@ CameraPreferences::UpdatePref(const char* aPref, bool& aVal)
nsresult rv = Preferences::GetBool(aPref, &val);
if (NS_SUCCEEDED(rv)) {
aVal = val;
} else if(rv == NS_ERROR_UNEXPECTED) {
// Preference does not exist
rv = NS_OK;
aVal = false;
}
return rv;
}