| 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/PaymentAppServiceWorkerRegistration.h" | 5 #include "modules/payments/PaymentAppServiceWorkerRegistration.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptState.h" | 7 #include "bindings/core/v8/ScriptState.h" |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "modules/payments/PaymentAppManager.h" | 9 #include "modules/payments/PaymentAppManager.h" |
| 10 #include "modules/serviceworkers/ServiceWorkerRegistration.h" | 10 #include "modules/serviceworkers/ServiceWorkerRegistration.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 PaymentAppManager* PaymentAppServiceWorkerRegistration::paymentAppManager( | 33 PaymentAppManager* PaymentAppServiceWorkerRegistration::paymentAppManager( |
| 34 ScriptState* scriptState, | 34 ScriptState* scriptState, |
| 35 ServiceWorkerRegistration& registration) { | 35 ServiceWorkerRegistration& registration) { |
| 36 return PaymentAppServiceWorkerRegistration::from(registration) | 36 return PaymentAppServiceWorkerRegistration::from(registration) |
| 37 .paymentAppManager(scriptState); | 37 .paymentAppManager(scriptState); |
| 38 } | 38 } |
| 39 | 39 |
| 40 PaymentAppManager* PaymentAppServiceWorkerRegistration::paymentAppManager( | 40 PaymentAppManager* PaymentAppServiceWorkerRegistration::paymentAppManager( |
| 41 ScriptState* scriptState) { | 41 ScriptState* scriptState) { |
| 42 if (!m_paymentAppManager) { | 42 if (!m_paymentAppManager) { |
| 43 m_paymentAppManager = PaymentAppManager::create( | 43 m_paymentAppManager = PaymentAppManager::create(m_registration); |
| 44 scriptState->getExecutionContext(), m_registration); | |
| 45 } | 44 } |
| 46 return m_paymentAppManager.get(); | 45 return m_paymentAppManager.get(); |
| 47 } | 46 } |
| 48 | 47 |
| 49 DEFINE_TRACE(PaymentAppServiceWorkerRegistration) { | 48 DEFINE_TRACE(PaymentAppServiceWorkerRegistration) { |
| 50 visitor->trace(m_registration); | 49 visitor->trace(m_registration); |
| 51 visitor->trace(m_paymentAppManager); | 50 visitor->trace(m_paymentAppManager); |
| 52 Supplement<ServiceWorkerRegistration>::trace(visitor); | 51 Supplement<ServiceWorkerRegistration>::trace(visitor); |
| 53 } | 52 } |
| 54 | 53 |
| 55 PaymentAppServiceWorkerRegistration::PaymentAppServiceWorkerRegistration( | 54 PaymentAppServiceWorkerRegistration::PaymentAppServiceWorkerRegistration( |
| 56 ServiceWorkerRegistration* registration) | 55 ServiceWorkerRegistration* registration) |
| 57 : m_registration(registration) {} | 56 : m_registration(registration) {} |
| 58 | 57 |
| 59 // static | 58 // static |
| 60 const char* PaymentAppServiceWorkerRegistration::supplementName() { | 59 const char* PaymentAppServiceWorkerRegistration::supplementName() { |
| 61 return "PaymentAppServiceWorkerRegistration"; | 60 return "PaymentAppServiceWorkerRegistration"; |
| 62 } | 61 } |
| 63 | 62 |
| 64 } // namespace blink | 63 } // namespace blink |
| OLD | NEW |