Coverage Report

Created: 2018-09-25 14:53

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