OLD | NEW |
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/PaymentRequest.h" | 5 #include "modules/payments/PaymentRequest.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
8 #include "bindings/core/v8/JSONValuesForV8.h" | 8 #include "bindings/core/v8/JSONValuesForV8.h" |
9 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
10 #include "core/dom/DOMException.h" | 10 #include "core/dom/DOMException.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 void PaymentRequest::abort() | 44 void PaymentRequest::abort() |
45 { | 45 { |
46 } | 46 } |
47 | 47 |
48 const AtomicString& PaymentRequest::interfaceName() const | 48 const AtomicString& PaymentRequest::interfaceName() const |
49 { | 49 { |
50 return EventTargetNames::PaymentRequest; | 50 return EventTargetNames::PaymentRequest; |
51 } | 51 } |
52 | 52 |
53 ExecutionContext* PaymentRequest::executionContext() const | 53 ExecutionContext* PaymentRequest::getExecutionContext() const |
54 { | 54 { |
55 return m_scriptState->executionContext(); | 55 return m_scriptState->getExecutionContext(); |
56 } | 56 } |
57 | 57 |
58 DEFINE_TRACE(PaymentRequest) | 58 DEFINE_TRACE(PaymentRequest) |
59 { | 59 { |
60 visitor->trace(m_details); | 60 visitor->trace(m_details); |
61 visitor->trace(m_options); | 61 visitor->trace(m_options); |
62 visitor->trace(m_shippingAddress); | 62 visitor->trace(m_shippingAddress); |
63 RefCountedGarbageCollectedEventTargetWithInlineData<PaymentRequest>::trace(v
isitor); | 63 RefCountedGarbageCollectedEventTargetWithInlineData<PaymentRequest>::trace(v
isitor); |
64 } | 64 } |
65 | 65 |
66 PaymentRequest::PaymentRequest(ScriptState* scriptState, const Vector<String>& s
upportedMethods, const PaymentDetails& details, const PaymentOptions& options, c
onst ScriptValue& data, ExceptionState& exceptionState) | 66 PaymentRequest::PaymentRequest(ScriptState* scriptState, const Vector<String>& s
upportedMethods, const PaymentDetails& details, const PaymentOptions& options, c
onst ScriptValue& data, ExceptionState& exceptionState) |
67 : m_scriptState(scriptState) | 67 : m_scriptState(scriptState) |
68 , m_supportedMethods(supportedMethods) | 68 , m_supportedMethods(supportedMethods) |
69 , m_details(details) | 69 , m_details(details) |
70 , m_options(options) | 70 , m_options(options) |
71 { | 71 { |
72 if (!data.isEmpty()) { | 72 if (!data.isEmpty()) { |
73 RefPtr<JSONValue> value = toJSONValue(data.context(), data.v8Value()); | 73 RefPtr<JSONValue> value = toJSONValue(data.context(), data.v8Value()); |
74 if (value && value->getType() == JSONValue::TypeObject) | 74 if (value && value->getType() == JSONValue::TypeObject) |
75 m_stringifiedData = JSONObject::cast(value)->toJSONString(); | 75 m_stringifiedData = JSONObject::cast(value)->toJSONString(); |
76 } | 76 } |
77 } | 77 } |
78 | 78 |
79 } // namespace blink | 79 } // namespace blink |
OLD | NEW |