Bug 702275 - check AddObserver return code in nsDOMStorage.cpp. r=honzab.

This commit is contained in:
Rafael Ávila de Espíndola 2011-11-15 01:10:51 -05:00
parent 1b8e035e99
commit 74f049f0da

View File

@ -287,16 +287,27 @@ nsDOMStorageManager::Initialize()
if (!os)
return NS_OK;
os->AddObserver(gStorageManager, "cookie-changed", false);
os->AddObserver(gStorageManager, "offline-app-removed", false);
os->AddObserver(gStorageManager, NS_PRIVATE_BROWSING_SWITCH_TOPIC, false);
os->AddObserver(gStorageManager, "profile-after-change", false);
os->AddObserver(gStorageManager, "perm-changed", false);
os->AddObserver(gStorageManager, "browser:purge-domain-data", false);
nsresult rv;
rv = os->AddObserver(gStorageManager, "cookie-changed", false);
NS_ENSURE_SUCCESS(rv, rv);
rv = os->AddObserver(gStorageManager, "offline-app-removed", false);
NS_ENSURE_SUCCESS(rv, rv);
rv = os->AddObserver(gStorageManager, NS_PRIVATE_BROWSING_SWITCH_TOPIC,
false);
NS_ENSURE_SUCCESS(rv, rv);
rv = os->AddObserver(gStorageManager, "profile-after-change", false);
NS_ENSURE_SUCCESS(rv, rv);
rv = os->AddObserver(gStorageManager, "perm-changed", false);
NS_ENSURE_SUCCESS(rv, rv);
rv = os->AddObserver(gStorageManager, "browser:purge-domain-data", false);
NS_ENSURE_SUCCESS(rv, rv);
// Used for temporary table flushing
os->AddObserver(gStorageManager, "profile-before-change", false);
os->AddObserver(gStorageManager, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
os->AddObserver(gStorageManager, NS_DOMSTORAGE_FLUSH_TIMER_TOPIC, false);
rv = os->AddObserver(gStorageManager, "profile-before-change", false);
NS_ENSURE_SUCCESS(rv, rv);
rv = os->AddObserver(gStorageManager, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
NS_ENSURE_SUCCESS(rv, rv);
rv = os->AddObserver(gStorageManager, NS_DOMSTORAGE_FLUSH_TIMER_TOPIC, false);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
}