Source code

Revision control

Other Tools

1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
* License, v. 2.0. If a copy of the MPL was not distributed with this
5
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef mozilla_dom_serviceworkercontainerimpl_h__
8
#define mozilla_dom_serviceworkercontainerimpl_h__
9
10
#include "ServiceWorkerContainer.h"
11
12
namespace mozilla {
13
namespace dom {
14
15
// Lightweight serviceWorker APIs collection.
16
class ServiceWorkerContainerImpl final : public ServiceWorkerContainer::Inner {
17
ServiceWorkerContainer* mOuter;
18
19
~ServiceWorkerContainerImpl();
20
21
public:
22
ServiceWorkerContainerImpl();
23
24
void AddContainer(ServiceWorkerContainer* aOuter) override;
25
26
void RemoveContainer(ServiceWorkerContainer* aOuter) override;
27
28
void Register(const ClientInfo& aClientInfo, const nsACString& aScopeURL,
29
const nsACString& aScriptURL,
30
ServiceWorkerUpdateViaCache aUpdateViaCache,
31
ServiceWorkerRegistrationCallback&& aSuccessCB,
32
ServiceWorkerFailureCallback&& aFailureCB) const override;
33
34
void GetRegistration(
35
const ClientInfo& aClientInfo, const nsACString& aURL,
36
ServiceWorkerRegistrationCallback&& aSuccessCB,
37
ServiceWorkerFailureCallback&& aFailureCB) const override;
38
39
void GetRegistrations(
40
const ClientInfo& aClientInfo,
41
ServiceWorkerRegistrationListCallback&& aSuccessCB,
42
ServiceWorkerFailureCallback&& aFailureCB) const override;
43
44
void GetReady(const ClientInfo& aClientInfo,
45
ServiceWorkerRegistrationCallback&& aSuccessCB,
46
ServiceWorkerFailureCallback&& aFailureCB) const override;
47
48
NS_INLINE_DECL_REFCOUNTING(ServiceWorkerContainerImpl, override)
49
};
50
51
} // namespace dom
52
} // namespace mozilla
53
54
#endif /* mozilla_dom_serviceworkercontainerimpl_h__ */