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/PaymentRequestUpdateEvent.h" | 5 #include "modules/payments/PaymentRequestUpdateEvent.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
8 #include "bindings/core/v8/ScriptFunction.h" | 8 #include "bindings/core/v8/ScriptFunction.h" |
9 #include "core/dom/DOMException.h" | 9 #include "core/dom/DOMException.h" |
10 #include "core/dom/ExceptionCode.h" | 10 #include "core/dom/ExceptionCode.h" |
11 #include "modules/payments/PaymentUpdater.h" | 11 #include "modules/payments/PaymentUpdater.h" |
12 #include "public/platform/WebTraceLocation.h" | 12 #include "public/platform/WebTraceLocation.h" |
13 #include "wtf/text/WTFString.h" | 13 #include "wtf/text/WTFString.h" |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 namespace { | 16 namespace { |
17 | 17 |
18 static const int abortTimeout = | 18 // Reject the payment request if the page does not resolve the promise from |
19 60; // Reject the payment request if the page does not resolve the promise
from updateWith within 60 seconds. | 19 // updateWith within 60 seconds. |
| 20 static const int abortTimeout = 60; |
20 | 21 |
21 class UpdatePaymentDetailsFunction : public ScriptFunction { | 22 class UpdatePaymentDetailsFunction : public ScriptFunction { |
22 public: | 23 public: |
23 static v8::Local<v8::Function> createFunction(ScriptState* scriptState, | 24 static v8::Local<v8::Function> createFunction(ScriptState* scriptState, |
24 PaymentUpdater* updater) { | 25 PaymentUpdater* updater) { |
25 UpdatePaymentDetailsFunction* self = | 26 UpdatePaymentDetailsFunction* self = |
26 new UpdatePaymentDetailsFunction(scriptState, updater); | 27 new UpdatePaymentDetailsFunction(scriptState, updater); |
27 return self->bindToV8Function(); | 28 return self->bindToV8Function(); |
28 } | 29 } |
29 | 30 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 } | 144 } |
144 | 145 |
145 PaymentRequestUpdateEvent::PaymentRequestUpdateEvent( | 146 PaymentRequestUpdateEvent::PaymentRequestUpdateEvent( |
146 const AtomicString& type, | 147 const AtomicString& type, |
147 const PaymentRequestUpdateEventInit& init) | 148 const PaymentRequestUpdateEventInit& init) |
148 : Event(type, init), | 149 : Event(type, init), |
149 m_waitForUpdate(false), | 150 m_waitForUpdate(false), |
150 m_abortTimer(this, &PaymentRequestUpdateEvent::onUpdateEventTimeout) {} | 151 m_abortTimer(this, &PaymentRequestUpdateEvent::onUpdateEventTimeout) {} |
151 | 152 |
152 } // namespace blink | 153 } // namespace blink |
OLD | NEW |