OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "modules/payments/PaymentRequest.h" | |
6 | |
7 #include "bindings/core/v8/ScriptPromiseResolver.h" | |
8 #include "modules/EventTargetModulesNames.h" | |
9 | |
10 namespace blink { | |
11 | |
12 // static | |
13 PaymentRequest* PaymentRequest::create(ExecutionContext* context, const Vector<S tring>& supportedMethods, const PaymentDetails& details, const PaymentOptions& o ptions, const ScriptValue& data) | |
14 { | |
15 return new PaymentRequest(context, supportedMethods, details, options, data) ; | |
16 } | |
17 | |
18 PaymentRequest::PaymentRequest(ExecutionContext* context, const Vector<String>& supportedMethods, const PaymentDetails& details, const PaymentOptions& options, const ScriptValue& data) | |
19 : ActiveDOMObject(context) | |
20 , m_supportedMethods(supportedMethods) | |
21 , m_details(details) | |
22 , m_options(options) | |
23 , m_data(data) | |
24 { | |
25 } | |
26 | |
27 PaymentRequest::~PaymentRequest() | |
28 { | |
29 } | |
30 | |
31 ScriptPromise PaymentRequest::show(ScriptState* scriptState) | |
32 { | |
33 return ScriptPromiseResolver::create(scriptState)->promise(); | |
Marijn Kruisselbrink
2016/02/18 21:59:18
I think this will crash, probably better to just r
please use gerrit instead
2016/02/18 22:41:32
Done.
| |
34 } | |
35 | |
36 void PaymentRequest::abort() | |
37 { | |
38 } | |
39 | |
40 const AtomicString& PaymentRequest::interfaceName() const | |
41 { | |
42 return EventTargetNames::PaymentRequest; | |
43 } | |
44 | |
45 ExecutionContext* PaymentRequest::executionContext() const | |
46 { | |
47 return ActiveDOMObject::executionContext(); | |
48 } | |
49 | |
50 bool PaymentRequest::hasPendingActivity() const | |
51 { | |
52 return false; | |
53 } | |
54 | |
55 void PaymentRequest::stop() | |
56 { | |
57 } | |
58 | |
59 DEFINE_TRACE(PaymentRequest) | |
60 { | |
61 visitor->trace(m_details); | |
62 visitor->trace(m_options); | |
63 visitor->trace(m_shippingAddress); | |
64 RefCountedGarbageCollectedEventTargetWithInlineData<PaymentRequest>::trace(v isitor); | |
65 ActiveDOMObject::trace(visitor); | |
66 } | |
67 | |
68 } // namespace blink | |
OLD | NEW |