mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
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:
parent
39c642a8f2
commit
b47acf7317
@ -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
|
||||
|
@ -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
|
||||
|
@ -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]);
|
||||
|
||||
|
@ -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]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user