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

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

Issue 2192413002: Timeout if website never completes the transaction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Marijn's comments Created 4 years, 4 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/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/PaymentAddress.h" 8 #include "modules/payments/PaymentAddress.h"
9 #include "modules/payments/PaymentCompleter.h" 9 #include "modules/payments/PaymentCompleter.h"
10 #include "wtf/Assertions.h" 10 #include "wtf/Assertions.h"
(...skipping 16 matching lines...) Expand all
27 { 27 {
28 } 28 }
29 29
30 ScriptValue PaymentResponse::details(ScriptState* scriptState, ExceptionState& e xceptionState) const 30 ScriptValue PaymentResponse::details(ScriptState* scriptState, ExceptionState& e xceptionState) const
31 { 31 {
32 return ScriptValue(scriptState, fromJSONString(scriptState, m_stringifiedDet ails, exceptionState)); 32 return ScriptValue(scriptState, fromJSONString(scriptState, m_stringifiedDet ails, exceptionState));
33 } 33 }
34 34
35 ScriptPromise PaymentResponse::complete(ScriptState* scriptState, const String& result) 35 ScriptPromise PaymentResponse::complete(ScriptState* scriptState, const String& result)
36 { 36 {
37 PaymentComplete convertedResult = Unknown; 37 PaymentCompleter::PaymentComplete convertedResult = PaymentCompleter::Unknow n;
38 if (result == "success") 38 if (result == "success")
39 convertedResult = Success; 39 convertedResult = PaymentCompleter::Success;
40 if (result == "fail") 40 else if (result == "fail")
41 convertedResult = Fail; 41 convertedResult = PaymentCompleter::Fail;
42 return m_paymentCompleter->complete(scriptState, convertedResult); 42 return m_paymentCompleter->complete(scriptState, convertedResult);
43 } 43 }
44 44
45 DEFINE_TRACE(PaymentResponse) 45 DEFINE_TRACE(PaymentResponse)
46 { 46 {
47 visitor->trace(m_shippingAddress); 47 visitor->trace(m_shippingAddress);
48 visitor->trace(m_paymentCompleter); 48 visitor->trace(m_paymentCompleter);
49 } 49 }
50 50
51 } // namespace blink 51 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698