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/PaymentResponse.h" | 5 #include "modules/payments/PaymentResponse.h" |
6 | 6 |
7 #include "bindings/core/v8/JSONValuesForV8.h" | 7 #include "bindings/core/v8/JSONValuesForV8.h" |
8 #include "modules/payments/PaymentCompleter.h" | 8 #include "modules/payments/PaymentCompleter.h" |
9 #include "wtf/Assertions.h" | 9 #include "wtf/Assertions.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 PaymentResponse::PaymentResponse(mojom::wtf::PaymentResponsePtr response, Paymen
tCompleter* paymentCompleter) | 13 PaymentResponse::PaymentResponse(mojom::blink::PaymentResponsePtr response, Paym
entCompleter* paymentCompleter) |
14 : m_methodName(response->method_name) | 14 : m_methodName(response->method_name) |
15 , m_stringifiedDetails(response->stringified_details) | 15 , m_stringifiedDetails(response->stringified_details) |
16 , m_paymentCompleter(paymentCompleter) | 16 , m_paymentCompleter(paymentCompleter) |
17 { | 17 { |
18 DCHECK(m_paymentCompleter); | 18 DCHECK(m_paymentCompleter); |
19 } | 19 } |
20 | 20 |
21 PaymentResponse::~PaymentResponse() | 21 PaymentResponse::~PaymentResponse() |
22 { | 22 { |
23 } | 23 } |
24 | 24 |
25 ScriptValue PaymentResponse::details(ScriptState* scriptState, ExceptionState& e
xceptionState) const | 25 ScriptValue PaymentResponse::details(ScriptState* scriptState, ExceptionState& e
xceptionState) const |
26 { | 26 { |
27 return ScriptValue(scriptState, fromJSONString(scriptState, m_stringifiedDet
ails, exceptionState)); | 27 return ScriptValue(scriptState, fromJSONString(scriptState, m_stringifiedDet
ails, exceptionState)); |
28 } | 28 } |
29 | 29 |
30 ScriptPromise PaymentResponse::complete(ScriptState* scriptState, bool success) | 30 ScriptPromise PaymentResponse::complete(ScriptState* scriptState, bool success) |
31 { | 31 { |
32 return m_paymentCompleter->complete(scriptState, success); | 32 return m_paymentCompleter->complete(scriptState, success); |
33 } | 33 } |
34 | 34 |
35 DEFINE_TRACE(PaymentResponse) | 35 DEFINE_TRACE(PaymentResponse) |
36 { | 36 { |
37 visitor->trace(m_paymentCompleter); | 37 visitor->trace(m_paymentCompleter); |
38 } | 38 } |
39 | 39 |
40 } // namespace blink | 40 } // namespace blink |
OLD | NEW |