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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
123 ScriptPromise promise = resolver->Promise(); | 123 ScriptPromise promise = resolver->Promise(); |
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_) { |
please use gerrit instead
2017/04/12 19:02:37
{} is not necessary.
| |
134 instruments_ = new PaymentInstruments(); | 134 instruments_ = new PaymentInstruments(manager_); |
please use gerrit instead
2017/04/12 19:02:37
The order of deletion in this object is manager_,
haraken
2017/04/13 01:32:31
I don't fully understand what you mean, but a dest
zino
2017/04/15 03:30:10
Done.
Anyway I modified order of declaration in h
| |
135 } | |
135 return instruments_; | 136 return instruments_; |
136 } | 137 } |
137 | 138 |
138 DEFINE_TRACE(PaymentManager) { | 139 DEFINE_TRACE(PaymentManager) { |
139 visitor->Trace(registration_); | 140 visitor->Trace(registration_); |
140 visitor->Trace(instruments_); | 141 visitor->Trace(instruments_); |
141 } | 142 } |
142 | 143 |
143 PaymentManager::PaymentManager(ServiceWorkerRegistration* registration) | 144 PaymentManager::PaymentManager(ServiceWorkerRegistration* registration) |
144 : registration_(registration), instruments_(nullptr) { | 145 : 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.")); | 199 "No payment app manifest associated with the service worker.")); |
199 break; | 200 break; |
200 } | 201 } |
201 } | 202 } |
202 | 203 |
203 void PaymentManager::OnServiceConnectionError() { | 204 void PaymentManager::OnServiceConnectionError() { |
204 manager_.reset(); | 205 manager_.reset(); |
205 } | 206 } |
206 | 207 |
207 } // namespace blink | 208 } // namespace blink |
OLD | NEW |