OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ServiceWorkerRegistrationBackgroundFetch_h |
| 6 #define ServiceWorkerRegistrationBackgroundFetch_h |
| 7 |
| 8 #include "modules/serviceworkers/ServiceWorkerRegistration.h" |
| 9 #include "platform/Supplementable.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 class BackgroundFetchManager; |
| 14 class ServiceWorkerRegistration; |
| 15 |
| 16 // This exposes the background fetch manager on the ServiceWorkerRegistration |
| 17 // partial interface. |
| 18 class ServiceWorkerRegistrationBackgroundFetch final |
| 19 : public GarbageCollectedFinalized< |
| 20 ServiceWorkerRegistrationBackgroundFetch>, |
| 21 public Supplement<ServiceWorkerRegistration> { |
| 22 USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerRegistrationBackgroundFetch); |
| 23 WTF_MAKE_NONCOPYABLE(ServiceWorkerRegistrationBackgroundFetch); |
| 24 |
| 25 public: |
| 26 virtual ~ServiceWorkerRegistrationBackgroundFetch(); |
| 27 static ServiceWorkerRegistrationBackgroundFetch& from( |
| 28 ServiceWorkerRegistration&); |
| 29 |
| 30 // Implementation of the Background Fetch API interface. |
| 31 static BackgroundFetchManager* backgroundFetch(ServiceWorkerRegistration&); |
| 32 BackgroundFetchManager* backgroundFetch(); |
| 33 |
| 34 DECLARE_VIRTUAL_TRACE(); |
| 35 |
| 36 private: |
| 37 explicit ServiceWorkerRegistrationBackgroundFetch(ServiceWorkerRegistration*); |
| 38 static const char* supplementName(); |
| 39 |
| 40 Member<ServiceWorkerRegistration> m_registration; |
| 41 Member<BackgroundFetchManager> m_backgroundFetch; |
| 42 }; |
| 43 |
| 44 } // namespace blink |
| 45 |
| 46 #endif // ServiceWorkerRegistrationBackgroundFetch_h |
OLD | NEW |