Bug 1116542 - Remove the code to handle shutdown-cleanse from the permission manager; r=jdm

shutdown-cleanse has not been a thing for quite a while.
This commit is contained in:
Ehsan Akhgari 2014-12-30 13:59:33 -05:00
parent 39c642a8f2
commit b47acf7317
4 changed files with 6 additions and 23 deletions

View File

@ -1452,13 +1452,8 @@ NS_IMETHODIMP nsPermissionManager::Observe(nsISupports *aSubject, const char *aT
// The profile is about to change,
// or is going away because the application is shutting down.
mIsShuttingDown = true;
if (!nsCRT::strcmp(someData, MOZ_UTF16("shutdown-cleanse"))) {
// Clear the permissions file and close the db asynchronously
RemoveAllInternal(false);
} else {
RemoveAllFromMemory();
CloseDB(false);
}
RemoveAllFromMemory();
CloseDB(false);
}
else if (!nsCRT::strcmp(aTopic, "profile-do-change")) {
// the profile has already changed; init the db from the new location

View File

@ -80,13 +80,13 @@ _observer.prototype = {
// Close the cookie database. If a generator is supplied, it will be invoked
// once the close is complete.
function do_close_profile(generator, cleanse) {
function do_close_profile(generator) {
// Register an observer for db close.
let obs = new _observer(generator, "cookie-db-closed");
// Close the db.
let service = Services.cookies.QueryInterface(Ci.nsIObserver);
service.observe(null, "profile-before-change", cleanse ? cleanse : "");
service.observe(null, "profile-before-change", "shutdown-persist");
}
// Load the cookie database. If a generator is supplied, it will be invoked

View File

@ -74,15 +74,9 @@ function do_run_test() {
do_check_eq(Services.cookies.countCookiesFromHost(uri1.host), 4);
do_check_eq(Services.cookies.countCookiesFromHost(uri2.host), 0);
// cleanse them
do_close_profile(test_generator, "shutdown-cleanse");
yield;
do_load_profile();
do_check_eq(Services.cookies.countCookiesFromHost(uri1.host), 0);
do_check_eq(Services.cookies.countCookiesFromHost(uri2.host), 0);
// test with cookies set to session-only
Services.prefs.setIntPref("network.cookie.lifetimePolicy", 2);
Services.cookies.removeAll();
do_set_cookies(uri1, channel1, false, [1, 2, 3, 4]);
do_set_cookies(uri2, channel2, true, [1, 2, 3, 4]);

View File

@ -66,15 +66,9 @@ function do_run_test() {
do_check_eq(Services.cookies.countCookiesFromHost(uri1.host), 4);
do_check_eq(Services.cookies.countCookiesFromHost(uri2.host), 0);
// cleanse them
do_close_profile(test_generator, "shutdown-cleanse");
yield;
do_load_profile();
do_check_eq(Services.cookies.countCookiesFromHost(uri1.host), 0);
do_check_eq(Services.cookies.countCookiesFromHost(uri2.host), 0);
// test with third party cookies for session only.
Services.prefs.setBoolPref("network.cookie.thirdparty.sessionOnly", true);
Services.cookies.removeAll();
do_set_cookies(uri1, channel2, false, [1, 2, 3, 4]);
do_set_cookies(uri2, channel1, true, [1, 2, 3, 4]);