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
--- 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) {