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_ServiceWorkerManagerChild_h
8 : #define mozilla_dom_ServiceWorkerManagerChild_h
9 :
10 : #include "mozilla/dom/PServiceWorkerManagerChild.h"
11 : #include "mozilla/ipc/BackgroundUtils.h"
12 :
13 : namespace mozilla {
14 :
15 : class OriginAttributes;
16 :
17 : namespace ipc {
18 : class BackgroundChildImpl;
19 : } // namespace ipc
20 :
21 : namespace dom {
22 : namespace workers {
23 :
24 : class ServiceWorkerManagerChild final : public PServiceWorkerManagerChild
25 : {
26 : friend class mozilla::ipc::BackgroundChildImpl;
27 :
28 : public:
29 4 : NS_INLINE_DECL_REFCOUNTING(ServiceWorkerManagerChild)
30 :
31 0 : void ManagerShuttingDown()
32 : {
33 0 : mShuttingDown = true;
34 0 : }
35 :
36 : virtual mozilla::ipc::IPCResult RecvNotifyRegister(const ServiceWorkerRegistrationData& aData)
37 : override;
38 :
39 : virtual mozilla::ipc::IPCResult RecvNotifySoftUpdate(const OriginAttributes& aOriginAttributes,
40 : const nsString& aScope) override;
41 :
42 : virtual mozilla::ipc::IPCResult RecvNotifyUnregister(const PrincipalInfo& aPrincipalInfo,
43 : const nsString& aScope) override;
44 :
45 : virtual mozilla::ipc::IPCResult RecvNotifyRemove(const nsCString& aHost) override;
46 :
47 : virtual mozilla::ipc::IPCResult RecvNotifyRemoveAll() override;
48 :
49 : virtual PServiceWorkerUpdaterChild*
50 : AllocPServiceWorkerUpdaterChild(const OriginAttributes& originAttributes,
51 : const nsCString& scope) override;
52 :
53 : virtual bool
54 : DeallocPServiceWorkerUpdaterChild(PServiceWorkerUpdaterChild* aActor) override;
55 :
56 : private:
57 2 : ServiceWorkerManagerChild()
58 2 : : mShuttingDown(false)
59 2 : {}
60 :
61 0 : ~ServiceWorkerManagerChild() {}
62 :
63 : bool mShuttingDown;
64 : };
65 :
66 : } // namespace workers
67 : } // namespace dom
68 : } // namespace mozilla
69 :
70 : #endif // mozilla_dom_ServiceWorkerManagerChild_h
|