Bug 959420 - Followup to fix the last saveApps call introduced in bug 757226. r=fabrice
authorMarco Castelluccio <mar.castelluccio@studenti.unina.it>
Thu, 16 Jan 2014 17:00:29 -0800
changeset 163855 f363dae6a41cffa765e51a6d30c74263c6a727a1
parent 163854 c5939d786ab82e8f71b0269a4574c27119992d46
child 163856 7ffefbeff08c759687893105f7f205702206f48c
push id3935
push userfdesre@mozilla.com
push dateFri, 17 Jan 2014 01:00:42 +0000
treeherderb2g-inbound@f363dae6a41c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice
bugs959420, 757226
milestone29.0a1
Bug 959420 - Followup to fix the last saveApps call introduced in bug 757226. r=fabrice
dom/apps/src/Webapps.jsm
--- a/dom/apps/src/Webapps.jsm
+++ b/dom/apps/src/Webapps.jsm
@@ -3626,17 +3626,17 @@ onInstallSuccessAck: function onInstallS
     if (index >= 0) {
       aData.error = "RECEIPT_ALREADY_EXISTS";
       aMm.sendAsyncMessage("Webapps:AddReceipt:Return:KO", aData);
       return;
     }
 
     app.receipts.push(receipt);
 
-    this._saveApps(function() {
+    this._saveApps().then(() => {
       aData.receipts = app.receipts;
       aMm.sendAsyncMessage("Webapps:AddReceipt:Return:OK", aData);
     });
   },
 
   removeReceipt: function(aData, aMm) {
     debug("removeReceipt " + aData.manifestURL);
 
@@ -3661,17 +3661,17 @@ onInstallSuccessAck: function onInstallS
     if (index == -1) {
       aData.error = "NO_SUCH_RECEIPT";
       aMm.sendAsyncMessage("Webapps:RemoveReceipt:Return:KO", aData);
       return;
     }
 
     app.receipts.splice(index, 1);
 
-    this._saveApps(function() {
+    this._saveApps().then(() => {
       aData.receipts = app.receipts;
       aMm.sendAsyncMessage("Webapps:RemoveReceipt:Return:OK", aData);
     });
   },
 
   replaceReceipt: function(aData, aMm) {
     debug("replaceReceipt " + aData.manifestURL);
 
@@ -3704,17 +3704,17 @@ onInstallSuccessAck: function onInstallS
     if (oldIndex == -1) {
       aData.error = "NO_SUCH_RECEIPT";
       aMm.sendAsyncMessage("Webapps:ReplaceReceipt:Return:KO", aData);
       return;
     }
 
     app.receipts[oldIndex] = newReceipt;
 
-    this._saveApps(function() {
+    this._saveApps().then(() => {
       aData.receipts = app.receipts;
       aMm.sendAsyncMessage("Webapps:ReplaceReceipt:Return:OK", aData);
     });
   },
 
   getManifestFor: function(aManifestURL) {
     let id = this._appIdForManifestURL(aManifestURL);
     let app = this.webapps[id];