Bug 876397 - Inter-App Communication API (part 9, new promise). r=nsm
authorGene Lian <clian@mozilla.com>
Thu, 12 Sep 2013 23:21:10 +0800
changeset 159765 67a98b765933163049203aab43cefb5b722eb93a
parent 159764 11cc413aad1c3b7ac09e170fb49690b878273b89
child 159766 4473d84c6ab6e2190d92aab9fbe09c08117bd612
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnsm
bugs876397
milestone26.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 876397 - Inter-App Communication API (part 9, new promise). r=nsm
dom/apps/src/Webapps.js
--- a/dom/apps/src/Webapps.js
+++ b/dom/apps/src/Webapps.js
@@ -461,33 +461,39 @@ WebappsApplication.prototype = {
       }
       Services.tm.currentThread.dispatch(runnable,
                                          Ci.nsIThread.DISPATCH_NORMAL);
     }
     return request;
   },
 
   connect: function(aKeyword, aRules) {
-    return this.createPromise(function (aResolver) {
+    return this.createPromise(function (aResolve, aReject) {
       cpmm.sendAsyncMessage("Webapps:Connect",
                             { keyword: aKeyword,
                               rules: aRules,
                               manifestURL: this.manifestURL,
                               outerWindowID: this._id,
                               appStatus: this._appStatus,
-                              requestID: this.getPromiseResolverId(aResolver) });
+                              requestID: this.getPromiseResolverId({
+                                resolve: aResolve,
+                                reject: aReject
+                              })});
     }.bind(this));
   },
 
   getConnections: function() {
-    return this.createPromise(function (aResolver) {
+    return this.createPromise(function (aResolve, aReject) {
       cpmm.sendAsyncMessage("Webapps:GetConnections",
                             { manifestURL: this.manifestURL,
                               outerWindowID: this._id,
-                              requestID: this.getPromiseResolverId(aResolver) });
+                              requestID: this.getPromiseResolverId({
+                                resolve: aResolve,
+                                reject: aReject
+                              })});
     }.bind(this));
   },
 
   uninit: function() {
     this._onprogress = null;
     cpmm.sendAsyncMessage("Webapps:UnregisterForMessages",
                           ["Webapps:OfflineCache",
                            "Webapps:PackageEvent",