Bug 1332613 - Remove the call to getAllLogins from browsingData.remove(passwords) in favor of calling removeAllLogins(since); r?bsilverberg draft
authorThomas Wisniewski <wisniewskit@gmail.com>
Sun, 09 Apr 2017 00:11:15 -0400
changeset 559172 56131c3fba3d6889aaaae60002d948e7115a9876
parent 559171 2100a3e04f34aeb4584d438877d72436b3379df0
child 623319 bbbd9d20b3672b25f62905bc89489e4b9994828c
push id53010
push userwisniewskit@gmail.com
push dateSun, 09 Apr 2017 04:14:03 +0000
reviewersbsilverberg
bugs1332613
milestone55.0a1
Bug 1332613 - Remove the call to getAllLogins from browsingData.remove(passwords) in favor of calling removeAllLogins(since); r?bsilverberg MozReview-Commit-ID: 1B8R7uz5rTW
browser/components/extensions/ext-browsingData.js
--- 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.