зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1062387 - Part 1. Fix clearing of camera preferences. r=mikeh
This commit is contained in:
Родитель
f7df755828
Коммит
c59e55e503
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче