Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: third_party/WebKit/Source/modules/payments/PaymentRequestEvent.cpp

Issue 2705293010: PaymentApp: Implement respondWith() in PaymentRequestEvent. (blink side) (Closed)
Patch Set: PaymentApp: Implement respondWith() in PaymentRequestEvent. (blink side) Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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) {
+ 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

Powered by Google App Engine
This is Rietveld 408576698