Bug 1332613 - Remove the call to getAllLogins from browsingData.remove(passwords) in favor of calling removeAllLogins(since); r?bsilverberg
MozReview-Commit-ID: 1B8R7uz5rTW
--- a/browser/components/extensions/ext-browsingData.js
+++ b/browser/components/extensions/ext-browsingData.js
@@ -82,32 +82,17 @@ function clearFormData(options) {
function clearHistory(options) {
return sanitizer.items.history.clear(makeRange(options));
}
let clearPasswords = Task.async(function* (options) {
let loginManager = Services.logins;
let yieldCounter = 0;
- if (options.since) {
- // Iterate through the logins and delete any updated after our cutoff.
- let logins = loginManager.getAllLogins();
- for (let login of logins) {
- login.QueryInterface(Ci.nsILoginMetaInfo);
- if (login.timePasswordChanged >= options.since) {
- loginManager.removeLogin(login);
- if (++yieldCounter % YIELD_PERIOD == 0) {
- yield new Promise(resolve => setTimeout(resolve, 0)); // Don't block the main thread too long.
- }
- }
- }
- } else {
- // Remove everything.
- loginManager.removeAllLogins();
- }
+ loginManager.removeAllLogins(options.since);
});
function clearPluginData(options) {
return sanitizer.items.pluginData.clear(makeRange(options));
}
let clearServiceWorkers = Task.async(function* () {
// Clearing service workers does not support timestamps.