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

Side by Side Diff: third_party/WebKit/Source/modules/payments/PaymentRequestEvent.cpp

Issue 2903643002: PaymentHandler: Implement PaymentRequestEvent constructor. (Closed)
Patch Set: PaymentHandler: Implement PaymentRequestEvent constructor. Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/payments/PaymentRequestEvent.h" 5 #include "modules/payments/PaymentRequestEvent.h"
6 6
7 #include "bindings/core/v8/ScriptPromiseResolver.h" 7 #include "bindings/core/v8/ScriptPromiseResolver.h"
8 #include "core/dom/DOMException.h" 8 #include "core/dom/DOMException.h"
9 #include "core/workers/WorkerGlobalScope.h" 9 #include "core/workers/WorkerGlobalScope.h"
10 #include "core/workers/WorkerLocation.h" 10 #include "core/workers/WorkerLocation.h"
11 #include "modules/serviceworkers/RespondWithObserver.h" 11 #include "modules/serviceworkers/RespondWithObserver.h"
12 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" 12 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h"
13 #include "modules/serviceworkers/ServiceWorkerWindowClientCallback.h" 13 #include "modules/serviceworkers/ServiceWorkerWindowClientCallback.h"
14 #include "platform/wtf/PtrUtil.h" 14 #include "platform/wtf/PtrUtil.h"
15 #include "platform/wtf/text/AtomicString.h" 15 #include "platform/wtf/text/AtomicString.h"
16 16
17 namespace blink { 17 namespace blink {
18 18
19 PaymentRequestEvent* PaymentRequestEvent::Create( 19 PaymentRequestEvent* PaymentRequestEvent::Create(
20 const AtomicString& type, 20 const AtomicString& type,
21 const PaymentRequestEventInit& initializer) {
22 return new PaymentRequestEvent(type, initializer, nullptr, nullptr);
23 }
24
25 PaymentRequestEvent* PaymentRequestEvent::Create(
26 const AtomicString& type,
21 const PaymentRequestEventInit& initializer, 27 const PaymentRequestEventInit& initializer,
22 RespondWithObserver* respond_with_observer, 28 RespondWithObserver* respond_with_observer,
23 WaitUntilObserver* wait_until_observer) { 29 WaitUntilObserver* wait_until_observer) {
24 return new PaymentRequestEvent(type, initializer, respond_with_observer, 30 return new PaymentRequestEvent(type, initializer, respond_with_observer,
25 wait_until_observer); 31 wait_until_observer);
26 } 32 }
27 33
28 PaymentRequestEvent::~PaymentRequestEvent() {} 34 PaymentRequestEvent::~PaymentRequestEvent() {}
29 35
30 const AtomicString& PaymentRequestEvent::InterfaceName() const { 36 const AtomicString& PaymentRequestEvent::InterfaceName() const {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 visitor->Trace(modifiers_); 121 visitor->Trace(modifiers_);
116 visitor->Trace(observer_); 122 visitor->Trace(observer_);
117 ExtendableEvent::Trace(visitor); 123 ExtendableEvent::Trace(visitor);
118 } 124 }
119 125
120 PaymentRequestEvent::PaymentRequestEvent( 126 PaymentRequestEvent::PaymentRequestEvent(
121 const AtomicString& type, 127 const AtomicString& type,
122 const PaymentRequestEventInit& initializer, 128 const PaymentRequestEventInit& initializer,
123 RespondWithObserver* respond_with_observer, 129 RespondWithObserver* respond_with_observer,
124 WaitUntilObserver* wait_until_observer) 130 WaitUntilObserver* wait_until_observer)
125 : ExtendableEvent(type, ExtendableEventInit(), wait_until_observer), 131 : ExtendableEvent(type, initializer, wait_until_observer),
126 top_level_origin_(initializer.topLevelOrigin()), 132 top_level_origin_(initializer.topLevelOrigin()),
127 payment_request_origin_(initializer.paymentRequestOrigin()), 133 payment_request_origin_(initializer.paymentRequestOrigin()),
128 payment_request_id_(initializer.paymentRequestId()), 134 payment_request_id_(initializer.paymentRequestId()),
129 method_data_(std::move(initializer.methodData())), 135 method_data_(std::move(initializer.methodData())),
130 total_(initializer.total()), 136 total_(initializer.total()),
131 modifiers_(initializer.modifiers()), 137 modifiers_(initializer.modifiers()),
132 instrument_key_(initializer.instrumentKey()), 138 instrument_key_(initializer.instrumentKey()),
133 observer_(respond_with_observer) {} 139 observer_(respond_with_observer) {}
134 140
135 } // namespace blink 141 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698