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_ServiceWorkerImpl_h
8
#define mozilla_dom_ServiceWorkerImpl_h
9
10
#include "ServiceWorker.h"
11
12
namespace mozilla {
13
namespace dom {
14
15
class ServiceWorkerInfo;
16
class ServiceWorkerRegistrationInfo;
17
18
class ServiceWorkerImpl final : public ServiceWorker::Inner {
19
RefPtr<ServiceWorkerInfo> mInfo;
20
RefPtr<ServiceWorkerRegistrationInfo> mReg;
21
ServiceWorker* mOuter;
22
23
~ServiceWorkerImpl();
24
25
// ServiceWorker::Inner interface
26
void AddServiceWorker(ServiceWorker* aWorker) override;
27
28
void RemoveServiceWorker(ServiceWorker* aWorker) override;
29
30
void GetRegistration(ServiceWorkerRegistrationCallback&& aSuccessCB,
31
ServiceWorkerFailureCallback&& aFailureCB) override;
32
33
void PostMessage(RefPtr<ServiceWorkerCloneData>&& aData,
34
const ClientInfo& aClientInfo,
35
const ClientState& aClientState) override;
36
37
public:
38
ServiceWorkerImpl(ServiceWorkerInfo* aInfo,
39
ServiceWorkerRegistrationInfo* aReg);
40
41
NS_INLINE_DECL_REFCOUNTING(ServiceWorkerImpl, override);
42
};
43
44
} // namespace dom
45
} // namespace mozilla
46
47
#endif // mozilla_dom_ServiceWorkerImpl_h