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 file,
5
* You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef mozilla_dom_ServiceWorkerManagerParent_h
8
#define mozilla_dom_ServiceWorkerManagerParent_h
9
10
#include "mozilla/dom/PServiceWorkerManagerParent.h"
11
12
namespace mozilla {
13
14
class OriginAttributes;
15
16
namespace ipc {
17
class BackgroundParentImpl;
18
} // namespace ipc
19
20
namespace dom {
21
22
class ServiceWorkerManagerService;
23
24
class ServiceWorkerManagerParent final : public PServiceWorkerManagerParent {
25
friend class mozilla::ipc::BackgroundParentImpl;
26
friend class PServiceWorkerManagerParent;
27
28
public:
29
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ServiceWorkerManagerParent)
30
31
uint64_t ID() const { return mID; }
32
33
private:
34
ServiceWorkerManagerParent();
35
~ServiceWorkerManagerParent();
36
37
mozilla::ipc::IPCResult RecvRegister(
38
const ServiceWorkerRegistrationData& aData);
39
40
mozilla::ipc::IPCResult RecvUnregister(const PrincipalInfo& aPrincipalInfo,
41
const nsString& aScope);
42
43
mozilla::ipc::IPCResult RecvPropagateSoftUpdate(
44
const OriginAttributes& aOriginAttributes, const nsString& aScope);
45
46
mozilla::ipc::IPCResult RecvPropagateUnregister(
47
const PrincipalInfo& aPrincipalInfo, const nsString& aScope);
48
49
mozilla::ipc::IPCResult RecvPropagateRemove(const nsCString& aHost);
50
51
mozilla::ipc::IPCResult RecvPropagateRemoveAll();
52
53
mozilla::ipc::IPCResult RecvShutdown();
54
55
PServiceWorkerUpdaterParent* AllocPServiceWorkerUpdaterParent(
56
const OriginAttributes& aOriginAttributes, const nsCString& aScope);
57
58
virtual mozilla::ipc::IPCResult RecvPServiceWorkerUpdaterConstructor(
59
PServiceWorkerUpdaterParent* aActor,
60
const OriginAttributes& aOriginAttributes,
61
const nsCString& aScope) override;
62
63
bool DeallocPServiceWorkerUpdaterParent(PServiceWorkerUpdaterParent* aActor);
64
65
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
66
67
RefPtr<ServiceWorkerManagerService> mService;
68
69
// We use this ID in the Service in order to avoid the sending of messages to
70
// ourself.
71
uint64_t mID;
72
};
73
74
} // namespace dom
75
} // namespace mozilla
76
77
#endif // mozilla_dom_ServiceWorkerManagerParent_h