Chromium Code Reviews| Index: third_party/WebKit/Source/modules/payments/PaymentRequest.cpp |
| diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0219bc0e3e7136ada5a3502f266feb675ec0557e |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp |
| @@ -0,0 +1,68 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "modules/payments/PaymentRequest.h" |
| + |
| +#include "bindings/core/v8/ScriptPromiseResolver.h" |
| +#include "modules/EventTargetModulesNames.h" |
| + |
| +namespace blink { |
| + |
| +// static |
| +PaymentRequest* PaymentRequest::create(ExecutionContext* context, const Vector<String>& supportedMethods, const PaymentDetails& details, const PaymentOptions& options, const ScriptValue& data) |
| +{ |
| + return new PaymentRequest(context, supportedMethods, details, options, data); |
| +} |
| + |
| +PaymentRequest::PaymentRequest(ExecutionContext* context, const Vector<String>& supportedMethods, const PaymentDetails& details, const PaymentOptions& options, const ScriptValue& data) |
| + : ActiveDOMObject(context) |
| + , m_supportedMethods(supportedMethods) |
| + , m_details(details) |
| + , m_options(options) |
| + , m_data(data) |
| +{ |
| +} |
| + |
| +PaymentRequest::~PaymentRequest() |
| +{ |
| +} |
| + |
| +ScriptPromise PaymentRequest::show(ScriptState* scriptState) |
| +{ |
| + 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.
|
| +} |
| + |
| +void PaymentRequest::abort() |
| +{ |
| +} |
| + |
| +const AtomicString& PaymentRequest::interfaceName() const |
| +{ |
| + return EventTargetNames::PaymentRequest; |
| +} |
| + |
| +ExecutionContext* PaymentRequest::executionContext() const |
| +{ |
| + return ActiveDOMObject::executionContext(); |
| +} |
| + |
| +bool PaymentRequest::hasPendingActivity() const |
| +{ |
| + return false; |
| +} |
| + |
| +void PaymentRequest::stop() |
| +{ |
| +} |
| + |
| +DEFINE_TRACE(PaymentRequest) |
| +{ |
| + visitor->trace(m_details); |
| + visitor->trace(m_options); |
| + visitor->trace(m_shippingAddress); |
| + RefCountedGarbageCollectedEventTargetWithInlineData<PaymentRequest>::trace(visitor); |
| + ActiveDOMObject::trace(visitor); |
| +} |
| + |
| +} // namespace blink |