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_remoteserviceworkerimpl_h__
8
#define mozilla_dom_remoteserviceworkerimpl_h__
9
10
#include "ServiceWorker.h"
11
12
namespace mozilla {
13
namespace dom {
14
15
class ServiceWorkerChild;
16
17
class RemoteServiceWorkerImpl final : public ServiceWorker::Inner {
18
ServiceWorkerChild* mActor;
19
ServiceWorker* mWorker;
20
bool mShutdown;
21
22
~RemoteServiceWorkerImpl();
23
24
void Shutdown();
25
26
// ServiceWorker::Inner implementation
27
void AddServiceWorker(ServiceWorker* aWorker) override;
28
29
void RemoveServiceWorker(ServiceWorker* aWorker) override;
30
31
void GetRegistration(ServiceWorkerRegistrationCallback&& aSuccessCB,
32
ServiceWorkerFailureCallback&& aFailureCB) override;
33
34
void PostMessage(RefPtr<ServiceWorkerCloneData>&& aData,
35
const ClientInfo& aClientInfo,
36
const ClientState& aClientState) override;
37
38
public:
39
explicit RemoteServiceWorkerImpl(const ServiceWorkerDescriptor& aDescriptor);
40
41
void RevokeActor(ServiceWorkerChild* aActor);
42
43
NS_INLINE_DECL_REFCOUNTING(RemoteServiceWorkerImpl, override)
44
};
45
46
} // namespace dom
47
} // namespace mozilla
48
49
#endif // mozilla_dom_remoteserviceworkerimpl_h__