Bug 966942 - Convert nsIDOMPaymentRequestInfo to a dictionary. r=bz, r=ferjm

This commit is contained in:
Andrea Marchesini 2014-02-05 13:11:14 -05:00
Родитель 524ca36ead
Коммит 5ebd1530d8
9 изменённых файлов: 1 добавлений и 82 удалений

Просмотреть файл

@ -564,7 +564,6 @@
@BINPATH@/components/Payment.js
@BINPATH@/components/PaymentFlowInfo.js
@BINPATH@/components/PaymentRequestInfo.js
@BINPATH@/components/Payment.manifest
@BINPATH@/components/DownloadsAPI.js

Просмотреть файл

@ -569,7 +569,6 @@
@BINPATH@/components/Payment.js
@BINPATH@/components/PaymentFlowInfo.js
@BINPATH@/components/PaymentRequestInfo.js
@BINPATH@/components/Payment.manifest
#ifdef MOZ_WEBRTC

Просмотреть файл

@ -93,9 +93,6 @@ let PaymentManager = {
if (!pr) {
continue;
}
if (!(pr instanceof Ci.nsIDOMPaymentRequestInfo)) {
return;
}
// We consider jwt type repetition an error.
if (jwtTypes[pr.type]) {
this.paymentFailed(requestId,
@ -342,17 +339,7 @@ let PaymentManager = {
}
let pldRequest = payloadObject.request;
let request = Cc["@mozilla.org/payment/request-info;1"]
.createInstance(Ci.nsIDOMPaymentRequestInfo);
if (!request) {
this.paymentFailed(aRequestId,
"INTERNAL_ERROR_ERROR_CREATING_PAY_REQUEST");
return true;
}
request.wrappedJSObject.init(aJwt,
payloadObject.typ,
provider.name);
return request;
return { jwt: aJwt, type: payloadObject.typ, providerName: provider.name };
},
showPaymentFlow: function showPaymentFlow(aRequestId,

Просмотреть файл

@ -4,6 +4,3 @@ category JavaScript-navigator-property mozPay @mozilla.org/payment/content-helpe
component {b8bce4e7-fbf0-4719-a634-b1bf9018657c} PaymentFlowInfo.js
contract @mozilla.org/payment/flow-info;1 {b8bce4e7-fbf0-4719-a634-b1bf9018657c}
component {0a58c67d-f003-48da-81d1-bd8f605f4b1c} PaymentRequestInfo.js
contract @mozilla.org/payment/request-info;1 {0a58c67d-f003-48da-81d1-bd8f605f4b1c}

Просмотреть файл

@ -1,41 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
const PAYMENTREQUESTINFO_CID =
Components.ID("{0a58c67d-f003-48da-81d1-bd8f605f4b1c}");
// nsIDOMPaymentRequestInfo
function PaymentRequestInfo() {
this.wrappedJSObject = this;
};
PaymentRequestInfo.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDOMPaymentRequestInfo]),
classID: PAYMENTREQUESTINFO_CID,
classInfo: XPCOMUtils.generateCI({
classID: PAYMENTREQUESTINFO_CID,
contractID: "@mozilla.org/payment/request-info;1",
classDescription: "Payment request information",
flags: Ci.nsIClassInfo.DOM_OBJECT,
interfaces: [Ci.nsIDOMPaymentRequestInfo]
}),
jwt: null,
type: null,
providerName: null,
init: function init(aJwt, aType, aProviderName) {
this.jwt = aJwt;
this.type = aType;
this.providerName = aProviderName;
}
};
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PaymentRequestInfo]);

Просмотреть файл

@ -5,7 +5,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
XPIDL_SOURCES += [
'nsIDOMPaymentRequestInfo.idl',
'nsINavigatorPayment.idl',
'nsIPaymentFlowInfo.idl',
'nsIPaymentUIGlue.idl',

Просмотреть файл

@ -1,19 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
[scriptable, uuid(93462984-0e9a-4016-bdb4-a24a88c08a29)]
interface nsIDOMPaymentRequestInfo : nsISupports
{
// Base64 encoded and digitally signed payment request.
readonly attribute DOMString jwt;
// JWT type that identifies the payment provider owner of the payment request
// format.
readonly attribute DOMString type;
// Payment provider name.
readonly attribute DOMString providerName;
};

Просмотреть файл

@ -16,6 +16,5 @@ EXTRA_COMPONENTS += [
'Payment.js',
'Payment.manifest',
'PaymentFlowInfo.js',
'PaymentRequestInfo.js',
]

Просмотреть файл

@ -585,7 +585,6 @@ bin/components/@DLL_PREFIX@nkgnomevfs@DLL_SUFFIX@
@BINPATH@/components/Payment.js
@BINPATH@/components/PaymentFlowInfo.js
@BINPATH@/components/PaymentRequestInfo.js
@BINPATH@/components/Payment.manifest
@BINPATH@/components/PaymentsUI.js