Line data Source code
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 : namespace workers {
22 :
23 : class ServiceWorkerManagerService;
24 :
25 : class ServiceWorkerManagerParent final : public PServiceWorkerManagerParent
26 : {
27 : friend class mozilla::ipc::BackgroundParentImpl;
28 :
29 : public:
30 2 : NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ServiceWorkerManagerParent)
31 :
32 0 : uint64_t ID() const
33 : {
34 0 : return mID;
35 : }
36 :
37 : private:
38 : ServiceWorkerManagerParent();
39 : ~ServiceWorkerManagerParent();
40 :
41 : virtual mozilla::ipc::IPCResult RecvRegister(
42 : const ServiceWorkerRegistrationData& aData) override;
43 :
44 : virtual mozilla::ipc::IPCResult RecvUnregister(const PrincipalInfo& aPrincipalInfo,
45 : const nsString& aScope) override;
46 :
47 : virtual mozilla::ipc::IPCResult RecvPropagateSoftUpdate(const OriginAttributes& aOriginAttributes,
48 : const nsString& aScope) override;
49 :
50 : virtual mozilla::ipc::IPCResult RecvPropagateUnregister(const PrincipalInfo& aPrincipalInfo,
51 : const nsString& aScope) override;
52 :
53 : virtual mozilla::ipc::IPCResult RecvPropagateRemove(const nsCString& aHost) override;
54 :
55 : virtual mozilla::ipc::IPCResult RecvPropagateRemoveAll() override;
56 :
57 : virtual mozilla::ipc::IPCResult RecvShutdown() override;
58 :
59 : virtual PServiceWorkerUpdaterParent*
60 : AllocPServiceWorkerUpdaterParent(const OriginAttributes& aOriginAttributes,
61 : const nsCString& aScope) override;
62 :
63 : virtual mozilla::ipc::IPCResult
64 : RecvPServiceWorkerUpdaterConstructor(PServiceWorkerUpdaterParent* aActor,
65 : const OriginAttributes& aOriginAttributes,
66 : const nsCString& aScope) override;
67 :
68 : virtual bool
69 : DeallocPServiceWorkerUpdaterParent(PServiceWorkerUpdaterParent* aActor) override;
70 :
71 : virtual void ActorDestroy(ActorDestroyReason aWhy) override;
72 :
73 : RefPtr<ServiceWorkerManagerService> mService;
74 :
75 : // We use this ID in the Service in order to avoid the sending of messages to
76 : // ourself.
77 : uint64_t mID;
78 : };
79 :
80 : } // namespace workers
81 : } // namespace dom
82 : } // namespace mozilla
83 :
84 : #endif // mozilla_dom_ServiceWorkerManagerParent_h
|