Bug 1343995 - Wait for sanitizing to really finish before shutting down. r?jchen draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Thu, 02 Mar 2017 21:34:23 +0100
changeset 492119 e9d424dca59df0769a5864747635b1fa8007de45
parent 491130 eb0f65bdc8a3952e53fbbef361a13799a69722ff
child 547656 ce0f5afc66a272962d1436bb560b252948ab1519
push id47536
push usermozilla@buttercookie.de
push dateThu, 02 Mar 2017 20:39:56 +0000
reviewersjchen
bugs1343995, 1266594
milestone54.0a1
Bug 1343995 - Wait for sanitizing to really finish before shutting down. r?jchen BrowserApp's sanitize() function assumed that the Sanitizer would return promises for each sanitization handler, so it could wait for them to resolve before proceeding with shutdown (which was also the assumption behind the patch for bug 1266594). In fact even the Sanitizer expected to do this is well, since it wrapped each of its handling functions within a promise/task/sendRequestForResult. However it turns out that Sanitizer's clearItem function then failed to actually return this promise - apparently ever since this was implemented. MozReview-Commit-ID: 6hN3UTXUIuV
mobile/android/modules/Sanitizer.jsm
--- a/mobile/android/modules/Sanitizer.jsm
+++ b/mobile/android/modules/Sanitizer.jsm
@@ -33,20 +33,20 @@ function Sanitizer() {}
 Sanitizer.prototype = {
   clearItem: function (aItemName)
   {
     let item = this.items[aItemName];
     let canClear = item.canClear;
     if (typeof canClear == "function") {
       canClear(function clearCallback(aCanClear) {
         if (aCanClear)
-          item.clear();
+          return item.clear();
       });
     } else if (canClear) {
-      item.clear();
+      return item.clear();
     }
   },
 
   items: {
     cache: {
       clear: function ()
       {
         return new Promise(function(resolve, reject) {