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>
Sat, 08 Apr 2017 23:55:21 -0400
changeset 559170 d9744d461e5a89881046cac86146da8054def65f
parent 559169 6d2a4f7ca866b84f947aa20a0e904051a7400268
child 623318 f658375f7bc90103372e24df9693c9d01a4192c5
push id53009
push userwisniewskit@gmail.com
push dateSun, 09 Apr 2017 04:07:21 +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: 9uhQ8c0Vpwz
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.