Bug 832951 - [WebPayment] Expose DOMRequest ID within mozChromeEvents; r=fabrice, a=nonlibxul
authorFernando Jiménez <ferjmoreno@gmail.com>
Tue, 22 Jan 2013 12:29:54 +0100
changeset 129353 23e803630aca76e9a696ebd7a64c2bad622020fd
parent 129341 bedb55033fe72a9c584a65b0b98a7e7504502b99
child 129354 275fdd66aa4cc4bc39f12eaecde9e5b520931eb2
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice, nonlibxul
bugs832951
milestone21.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 832951 - [WebPayment] Expose DOMRequest ID within mozChromeEvents; r=fabrice, a=nonlibxul
b2g/chrome/content/payment.js
b2g/components/PaymentGlue.js
--- a/b2g/chrome/content/payment.js
+++ b/b2g/chrome/content/payment.js
@@ -56,17 +56,18 @@ function closePaymentFlowDialog(aCallbac
   let browser = Services.wm.getMostRecentWindow("navigator:browser");
   let content = browser.getContentWindow();
   if (!content) {
     return;
   }
 
   let detail = {
     type: kClosePaymentFlowEvent,
-    id: id
+    id: id,
+    requestId: requestId
   };
 
   // In order to avoid race conditions, we wait for the UI to notify that
   // it has successfully closed the payment flow and has recovered the
   // caller app, before notifying the parent process to fire the success
   // or error event over the DOMRequest.
   content.addEventListener("mozContentEvent",
                            function closePaymentFlowReturn(evt) {
--- a/b2g/components/PaymentGlue.js
+++ b/b2g/components/PaymentGlue.js
@@ -49,16 +49,17 @@ PaymentUI.prototype = {
 
     // The UI should listen for mozChromeEvent 'open-payment-confirmation-dialog'
     // type in order to create and show the payment request confirmation frame
     // embeded within a trusted dialog.
     let id = kOpenPaymentConfirmationEvent + "-" + this.getRandomId();
     let detail = {
       type: kOpenPaymentConfirmationEvent,
       id: id,
+      requestId: aRequestId,
       paymentRequests: aRequests
     };
 
     // Once the user confirm the payment request and makes his choice, we get
     // back to the DOM part to get the appropriate payment flow information
     // based on the selected payment provider.
     content.addEventListener("mozContentEvent", function handleSelection(evt) {
       let msg = evt.detail;
@@ -94,16 +95,17 @@ PaymentUI.prototype = {
       _error("NO_CONTENT_WINDOW");
       return;
     }
 
     let id = kOpenPaymentFlowEvent + "-" + this.getRandomId();
     let detail = {
       type: kOpenPaymentFlowEvent,
       id: id,
+      requestId: aRequestId,
       uri: aPaymentFlowInfo.uri,
       method: aPaymentFlowInfo.requestMethod,
       jwt: aPaymentFlowInfo.jwt
     };
 
     // At some point the UI would send the created iframe back so the
     // callbacks for firing DOMRequest events can be loaded on its
     // content.