Chromium Code Reviews| Index: third_party/WebKit/Source/modules/payments/PaymentManager.cpp |
| diff --git a/third_party/WebKit/Source/modules/payments/PaymentManager.cpp b/third_party/WebKit/Source/modules/payments/PaymentManager.cpp |
| index 9e94993684e6ec59ccc5d103855e25ca102b5838..b8c8a8af3b35a43676a507308d8d38300f42f1e7 100644 |
| --- a/third_party/WebKit/Source/modules/payments/PaymentManager.cpp |
| +++ b/third_party/WebKit/Source/modules/payments/PaymentManager.cpp |
| @@ -9,6 +9,7 @@ |
| #include "core/dom/DOMException.h" |
| #include "modules/payments/PaymentAppManifest.h" |
| #include "modules/payments/PaymentAppOption.h" |
| +#include "modules/payments/PaymentInstruments.h" |
| #include "modules/serviceworkers/ServiceWorkerRegistration.h" |
| #include "platform/mojo/MojoHelper.h" |
| #include "public/platform/InterfaceProvider.h" |
| @@ -128,12 +129,20 @@ ScriptPromise PaymentManager::getManifest(ScriptState* scriptState) { |
| return promise; |
| } |
| +PaymentInstruments* PaymentManager::instruments() { |
| + if (!m_instruments) { |
|
please use gerrit instead
2017/03/29 21:30:16
No need for {} in a single-line if statement body.
zino
2017/03/30 00:12:53
Done.
|
| + m_instruments = new PaymentInstruments(); |
| + } |
| + return m_instruments; |
| +} |
| + |
| DEFINE_TRACE(PaymentManager) { |
| visitor->trace(m_registration); |
| + visitor->trace(m_instruments); |
| } |
| PaymentManager::PaymentManager(ServiceWorkerRegistration* registration) |
| - : m_registration(registration) { |
| + : m_registration(registration), m_instruments(nullptr) { |
| DCHECK(registration); |
| Platform::current()->interfaceProvider()->getInterface( |
| mojo::MakeRequest(&m_manager)); |