| Index: third_party/WebKit/Source/modules/background_fetch/ServiceWorkerRegistrationBackgroundFetch.h
|
| diff --git a/third_party/WebKit/Source/modules/background_fetch/ServiceWorkerRegistrationBackgroundFetch.h b/third_party/WebKit/Source/modules/background_fetch/ServiceWorkerRegistrationBackgroundFetch.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e7c244be9a5f0e604ca3386226a37676f76540da
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/modules/background_fetch/ServiceWorkerRegistrationBackgroundFetch.h
|
| @@ -0,0 +1,46 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef ServiceWorkerRegistrationBackgroundFetch_h
|
| +#define ServiceWorkerRegistrationBackgroundFetch_h
|
| +
|
| +#include "modules/serviceworkers/ServiceWorkerRegistration.h"
|
| +#include "platform/Supplementable.h"
|
| +
|
| +namespace blink {
|
| +
|
| +class BackgroundFetchManager;
|
| +class ServiceWorkerRegistration;
|
| +
|
| +// This exposes the background fetch manager on the ServiceWorkerRegistration
|
| +// partial interface.
|
| +class ServiceWorkerRegistrationBackgroundFetch final
|
| + : public GarbageCollectedFinalized<
|
| + ServiceWorkerRegistrationBackgroundFetch>,
|
| + public Supplement<ServiceWorkerRegistration> {
|
| + USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerRegistrationBackgroundFetch);
|
| + WTF_MAKE_NONCOPYABLE(ServiceWorkerRegistrationBackgroundFetch);
|
| +
|
| + public:
|
| + virtual ~ServiceWorkerRegistrationBackgroundFetch();
|
| + static ServiceWorkerRegistrationBackgroundFetch& from(
|
| + ServiceWorkerRegistration&);
|
| +
|
| + // Implementation of the Background Fetch API interface.
|
| + static BackgroundFetchManager* backgroundFetch(ServiceWorkerRegistration&);
|
| + BackgroundFetchManager* backgroundFetch();
|
| +
|
| + DECLARE_VIRTUAL_TRACE();
|
| +
|
| + private:
|
| + explicit ServiceWorkerRegistrationBackgroundFetch(ServiceWorkerRegistration*);
|
| + static const char* supplementName();
|
| +
|
| + Member<ServiceWorkerRegistration> m_registration;
|
| + Member<BackgroundFetchManager> m_backgroundFetch;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // ServiceWorkerRegistrationBackgroundFetch_h
|
|
|