Chromium Code Reviews| Index: third_party/WebKit/Source/modules/payments/PaymentRequestEvent.cpp |
| diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequestEvent.cpp b/third_party/WebKit/Source/modules/payments/PaymentRequestEvent.cpp |
| index 14fcf1dbc8c2af1c0ae9181aef8e1272dafd5f11..cb2c755ddc41f6ffce17c1c22124565a044bf6cf 100644 |
| --- a/third_party/WebKit/Source/modules/payments/PaymentRequestEvent.cpp |
| +++ b/third_party/WebKit/Source/modules/payments/PaymentRequestEvent.cpp |
| @@ -4,6 +4,7 @@ |
| #include "modules/payments/PaymentRequestEvent.h" |
| +#include "modules/serviceworkers/RespondWithObserver.h" |
| #include "wtf/text/AtomicString.h" |
| namespace blink { |
| @@ -11,8 +12,10 @@ namespace blink { |
| PaymentRequestEvent* PaymentRequestEvent::create( |
| const AtomicString& type, |
| const PaymentAppRequest& appRequest, |
| - WaitUntilObserver* observer) { |
| - return new PaymentRequestEvent(type, appRequest, observer); |
| + RespondWithObserver* respondWithObserver, |
| + WaitUntilObserver* waitUntilObserver) { |
| + return new PaymentRequestEvent(type, appRequest, respondWithObserver, |
| + waitUntilObserver); |
| } |
| PaymentRequestEvent::~PaymentRequestEvent() {} |
| @@ -25,19 +28,28 @@ void PaymentRequestEvent::appRequest(PaymentAppRequest& appRequest) const { |
| appRequest = m_appRequest; |
| } |
| -void PaymentRequestEvent::respondWith(ScriptPromise) { |
| - NOTIMPLEMENTED(); |
| +void PaymentRequestEvent::respondWith(ScriptState* scriptState, |
| + ScriptPromise scriptPromise, |
| + ExceptionState& exceptionState) { |
| + stopImmediatePropagation(); |
| + if (m_observer) { |
|
nhiroki
2017/03/16 13:24:47
Is it possible that |m_observer| is null here?
zino
2017/03/16 14:32:02
In the extream case, nullptr might be coming when
nhiroki
2017/03/17 07:45:12
Thank you for the clarification. I'm ok with keepi
|
| + m_observer->respondWith(scriptState, scriptPromise, exceptionState); |
| + } |
| } |
| DEFINE_TRACE(PaymentRequestEvent) { |
| visitor->trace(m_appRequest); |
| + visitor->trace(m_observer); |
| ExtendableEvent::trace(visitor); |
| } |
| -PaymentRequestEvent::PaymentRequestEvent(const AtomicString& type, |
| - const PaymentAppRequest& appRequest, |
| - WaitUntilObserver* observer) |
| - : ExtendableEvent(type, ExtendableEventInit(), observer), |
| - m_appRequest(appRequest) {} |
| +PaymentRequestEvent::PaymentRequestEvent( |
| + const AtomicString& type, |
| + const PaymentAppRequest& appRequest, |
| + RespondWithObserver* respondWithObserver, |
| + WaitUntilObserver* waitUntilObserver) |
| + : ExtendableEvent(type, ExtendableEventInit(), waitUntilObserver), |
| + m_appRequest(appRequest), |
| + m_observer(respondWithObserver) {} |
| } // namespace blink |