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