| 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/PaymentManager.h" | 5 #include "modules/payments/PaymentManager.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptPromise.h" | 7 #include "bindings/core/v8/ScriptPromise.h" |
| 8 #include "bindings/core/v8/ScriptState.h" | 8 #include "bindings/core/v8/ScriptState.h" |
| 9 #include "core/dom/DOMException.h" | 9 #include "core/dom/DOMException.h" |
| 10 #include "modules/payments/PaymentAppManifest.h" | 10 #include "modules/payments/PaymentAppManifest.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 manager_->GetManifest(ConvertToBaseCallback( | 125 manager_->GetManifest(ConvertToBaseCallback( |
| 126 WTF::Bind(&PaymentManager::OnGetManifest, WrapPersistent(this), | 126 WTF::Bind(&PaymentManager::OnGetManifest, WrapPersistent(this), |
| 127 WrapPersistent(resolver)))); | 127 WrapPersistent(resolver)))); |
| 128 | 128 |
| 129 return promise; | 129 return promise; |
| 130 } | 130 } |
| 131 | 131 |
| 132 PaymentInstruments* PaymentManager::instruments() { | 132 PaymentInstruments* PaymentManager::instruments() { |
| 133 if (!instruments_) | 133 if (!instruments_) |
| 134 instruments_ = new PaymentInstruments(); | 134 instruments_ = new PaymentInstruments(manager_); |
| 135 return instruments_; | 135 return instruments_; |
| 136 } | 136 } |
| 137 | 137 |
| 138 DEFINE_TRACE(PaymentManager) { | 138 DEFINE_TRACE(PaymentManager) { |
| 139 visitor->Trace(registration_); | 139 visitor->Trace(registration_); |
| 140 visitor->Trace(instruments_); | 140 visitor->Trace(instruments_); |
| 141 } | 141 } |
| 142 | 142 |
| 143 PaymentManager::PaymentManager(ServiceWorkerRegistration* registration) | 143 PaymentManager::PaymentManager(ServiceWorkerRegistration* registration) |
| 144 : registration_(registration), instruments_(nullptr) { | 144 : registration_(registration), instruments_(nullptr) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 "No payment app manifest associated with the service worker.")); | 198 "No payment app manifest associated with the service worker.")); |
| 199 break; | 199 break; |
| 200 } | 200 } |
| 201 } | 201 } |
| 202 | 202 |
| 203 void PaymentManager::OnServiceConnectionError() { | 203 void PaymentManager::OnServiceConnectionError() { |
| 204 manager_.reset(); | 204 manager_.reset(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 } // namespace blink | 207 } // namespace blink |
| OLD | NEW |