Bug 1372988 part B - setting prefs after profile shutdown triggers assertions instead of just warnings, r?milan
MozReview-Commit-ID: 9qA2htqB58b
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
@@ -98,18 +98,18 @@ Preferences::DirtyCallback()
// TODO: this should really assert because you can't set prefs in a
// content process. But so much code currently does this that we just
// ignore it for now.
return;
}
if (gHashTable && sPreferences && !sPreferences->mDirty) {
sPreferences->mDirty = true;
- NS_WARNING_ASSERTION(!sPreferences->mProfileShutdown,
- "Setting user pref after profile shutdown.");
+ MOZ_ASSERT(!sPreferences->mProfileShutdown,
+ "Setting user pref after profile shutdown.");
if (sPreferences->AllowOffMainThreadSave()) {
static const int MAX_PREF_DELAY_MS = 2000;
NS_IdleDispatchToCurrentThread(
mozilla::NewRunnableMethod("Preferences::SavePrefFileAsynchronous",
sPreferences,
&Preferences::SavePrefFileAsynchronous),
MAX_PREF_DELAY_MS);
@@ -1172,17 +1172,17 @@ Preferences::SavePrefFileInternal(nsIFil
// we only check this flag when the caller wants to write to the default
if (!mDirty) {
return NS_OK;
}
// check for profile shutdown after mDirty because the runnables from
// DirtyCallback can still be pending
if (mProfileShutdown) {
- NS_WARNING("Cannot save pref file after profile shutdown.");
+ MOZ_ASSERT_UNREACHABLE("Cannot save pref file after profile shutdown.");
return NS_ERROR_ILLEGAL_DURING_SHUTDOWN;
}
// It's possible that we never got a prefs file.
nsresult rv = NS_OK;
if (mCurrentFile) {
rv = WritePrefFile(mCurrentFile, aSaveMethod);
}