Bug 1529301 - P3 - Use the listInitializedOrigins on Sanitizer.jsm; r=baku
authorTom Tung <shes050117@gmail.com>
Fri, 22 Mar 2019 06:04:50 +0000
changeset 465624 7e8e7504a696aad67f417b4b89b3a1fc4969f809
parent 465623 f6bd764df03f9ac88c7dd53c56fdfabdce86522e
child 465625 dcd5ef63ed84c86f834ff759e94bfe93fb866db9
push id35744
push userapavel@mozilla.com
push dateFri, 22 Mar 2019 16:44:08 +0000
treeherdermozilla-central@e66a2b59914d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1529301
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1529301 - P3 - Use the listInitializedOrigins on Sanitizer.jsm; r=baku Differential Revision: https://phabricator.services.mozilla.com/D21725
browser/modules/Sanitizer.jsm
toolkit/components/cleardata/ClearDataService.jsm
--- a/browser/modules/Sanitizer.jsm
+++ b/browser/modules/Sanitizer.jsm
@@ -682,18 +682,18 @@ class PrincipalsCollector {
     }
 
     return this.principals;
   }
 
   async getAllPrincipalsInternal(progress) {
     progress.step = "principals-quota-manager";
     let principals = await new Promise(resolve => {
-      quotaManagerService.getUsage(request => {
-        progress.step = "principals-quota-manager-getUsage";
+      quotaManagerService.listInitializedOrigins(request => {
+        progress.step = "principals-quota-manager-listInitializedOrigins";
         if (request.resultCode != Cr.NS_OK) {
           // We are probably shutting down. We don't want to propagate the
           // error, rejecting the promise.
           resolve([]);
           return;
         }
 
         let list = [];
--- a/toolkit/components/cleardata/ClearDataService.jsm
+++ b/toolkit/components/cleardata/ClearDataService.jsm
@@ -364,22 +364,19 @@ const QuotaCleaner = {
               aResolve();
             } else {
               aReject({message: "Delete by host failed"});
             }
           };
         }));
         if (Services.lsm.nextGenLocalStorageEnabled) {
           // deleteByHost has the semantics that "foo.example.com" should be
-          // wiped if we are provided an aHost of "example.com".  QuotaManager
-          // doesn't have a way to directly do this, so we use getUsage() to
-          // get a list of all of the origins known to QuotaManager and then
-          // check whether the domain is a sub-domain of aHost.
+          // wiped if we are provided an aHost of "example.com".
           promises.push(new Promise((aResolve, aReject) => {
-            Services.qms.getUsage(aRequest => {
+            Services.qms.listInitializedOrigins(aRequest => {
               if (aRequest.resultCode != Cr.NS_OK) {
                 aReject({message: "Delete by host failed"});
                 return;
               }
 
               let promises = [];
               for (let item of aRequest.result) {
                 let principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(item.origin);