mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
Bug 1422365 - Introduce nsIClearDataService - part 14 - logins, r=johannh
This commit is contained in:
parent
bd85ed6605
commit
fe0853f6f2
@ -421,14 +421,9 @@ var Sanitizer = {
|
||||
async clear(range) {
|
||||
let refObj = {};
|
||||
TelemetryStopwatch.start("FX_SANITIZE_SESSIONS", refObj);
|
||||
await clearData(range, Ci.nsIClearDataService.CLEAR_AUTH_TOKENS);
|
||||
|
||||
try {
|
||||
// clear FTP and plain HTTP auth sessions
|
||||
Services.obs.notifyObservers(null, "net:clear-active-logins");
|
||||
} finally {
|
||||
TelemetryStopwatch.finish("FX_SANITIZE_SESSIONS", refObj);
|
||||
}
|
||||
await clearData(range, Ci.nsIClearDataService.CLEAR_AUTH_TOKENS |
|
||||
Ci.nsIClearDataService.CLEAR_AUTH_CACHE);
|
||||
TelemetryStopwatch.finish("FX_SANITIZE_SESSIONS", refObj);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -474,6 +474,15 @@ const AuthTokensCleaner = {
|
||||
},
|
||||
};
|
||||
|
||||
const AuthCacheCleaner = {
|
||||
deleteAll() {
|
||||
return new Promise(aResolve => {
|
||||
Services.obs.notifyObservers(null, "net:clear-active-logins");
|
||||
aResolve();
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
// Here the map of Flags-Cleaner.
|
||||
const FLAGS_MAP = [
|
||||
{ flag: Ci.nsIClearDataService.CLEAR_COOKIES,
|
||||
@ -517,6 +526,9 @@ const FLAGS_MAP = [
|
||||
|
||||
{ flag: Ci.nsIClearDataService.CLEAR_AUTH_TOKENS,
|
||||
cleaner: AuthTokensCleaner, },
|
||||
|
||||
{ flag: Ci.nsIClearDataService.CLEAR_AUTH_CACHE,
|
||||
cleaner: AuthCacheCleaner, },
|
||||
];
|
||||
|
||||
this.ClearDataService = function() {};
|
||||
|
@ -153,6 +153,11 @@ interface nsIClearDataService : nsISupports
|
||||
*/
|
||||
const uint32_t CLEAR_AUTH_TOKENS = 1 << 13;
|
||||
|
||||
/**
|
||||
* Login cache
|
||||
*/
|
||||
const uint32_t CLEAR_AUTH_CACHE = 1 << 14;
|
||||
|
||||
/* TODO
|
||||
const uint32_t CLEAR_EME = 1 << 4;
|
||||
const uint32_t CLEAR_PERMISSIONS = 1 << 7;
|
||||
@ -160,7 +165,6 @@ interface nsIClearDataService : nsISupports
|
||||
const uint32_t CLEAR_HSTS = 1 << 12;
|
||||
const uint32_t CLEAR_HPKP = 1 << 13;
|
||||
const uint32_t CLEAR_FORMDATA = 1 << 16;
|
||||
const uint32_t CLEAR_LOGINS = 1 << 18;
|
||||
*/
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user