| Index: third_party/WebKit/Source/modules/payments/PaymentRequest.h
|
| diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequest.h b/third_party/WebKit/Source/modules/payments/PaymentRequest.h
|
| index 8f92cca3a6e06497f9e159026ec104d502e0f928..7d7270b5dde919458f83fc3381046edcdd01d064 100644
|
| --- a/third_party/WebKit/Source/modules/payments/PaymentRequest.h
|
| +++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.h
|
| @@ -12,6 +12,7 @@
|
| #include "modules/payments/PaymentDetails.h"
|
| #include "modules/payments/PaymentOptions.h"
|
| #include "platform/heap/Handle.h"
|
| +#include "platform/payments/PaymentRequestProxy.h"
|
| #include "wtf/Noncopyable.h"
|
| #include "wtf/RefPtr.h"
|
| #include "wtf/Vector.h"
|
| @@ -20,10 +21,11 @@
|
| namespace blink {
|
|
|
| class ExceptionState;
|
| +class ScriptPromiseResolver;
|
| class ScriptState;
|
| class ShippingAddress;
|
|
|
| -class PaymentRequest final : public RefCountedGarbageCollectedEventTargetWithInlineData<PaymentRequest> {
|
| +class PaymentRequest final : public RefCountedGarbageCollectedEventTargetWithInlineData<PaymentRequest>, PaymentRequestProxy::Listener {
|
| REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PaymentRequest);
|
| DEFINE_WRAPPERTYPEINFO();
|
| WTF_MAKE_NONCOPYABLE(PaymentRequest);
|
| @@ -36,7 +38,7 @@ public:
|
| virtual ~PaymentRequest();
|
|
|
| ScriptPromise show(ScriptState*);
|
| - void abort();
|
| + void abort(ExceptionState&);
|
|
|
| ShippingAddress* shippingAddress() const { return m_shippingAddress.get(); }
|
| const String& shippingOption() const { return m_shippingOption; }
|
| @@ -48,11 +50,20 @@ public:
|
| const AtomicString& interfaceName() const override;
|
| ExecutionContext* executionContext() const override;
|
|
|
| + ScriptPromise complete(ScriptState*, bool success);
|
| +
|
| DECLARE_TRACE();
|
|
|
| private:
|
| PaymentRequest(ScriptState*, const Vector<String>& supportedMethods, const PaymentDetails&, const PaymentOptions&, const ScriptValue& data, ExceptionState&);
|
|
|
| + // PaymentRequestProxy::Listener
|
| + void onShippingAddressChange(const PlatformShippingAddress&) override;
|
| + void onShippingOptionChange(const String& shippingOptionId) override;
|
| + void onPaymentResponse(const PlatformPaymentResponse&) override;
|
| + void onError() override;
|
| + void onComplete() override;
|
| +
|
| RefPtr<ScriptState> m_scriptState;
|
| Vector<String> m_supportedMethods;
|
| PaymentDetails m_details;
|
| @@ -60,6 +71,9 @@ private:
|
| String m_stringifiedData;
|
| Member<ShippingAddress> m_shippingAddress;
|
| String m_shippingOption;
|
| + Member<ScriptPromiseResolver> m_showResolver;
|
| + Member<ScriptPromiseResolver> m_completeResolver;
|
| + PaymentRequestProxy m_paymentRequestProxy;
|
| };
|
|
|
| } // namespace blink
|
|
|