Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/serviceworkers/ServiceWorkerRegistrationChild.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
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef mozilla_dom_serviceworkerregistrationchild_h__
8
#define mozilla_dom_serviceworkerregistrationchild_h__
9
10
#include "mozilla/dom/PServiceWorkerRegistrationChild.h"
11
#include "mozilla/dom/WorkerHolderToken.h"
12
13
namespace mozilla {
14
namespace dom {
15
16
class RemoteServiceWorkerRegistrationImpl;
17
18
class ServiceWorkerRegistrationChild final : public PServiceWorkerRegistrationChild
19
                                           , public WorkerHolderToken::Listener
20
{
21
  RefPtr<WorkerHolderToken> mWorkerHolderToken;
22
  RemoteServiceWorkerRegistrationImpl* mOwner;
23
  bool mTeardownStarted;
24
25
  // PServiceWorkerRegistrationChild
26
  void
27
  ActorDestroy(ActorDestroyReason aReason) override;
28
29
  mozilla::ipc::IPCResult
30
  RecvUpdateState(const IPCServiceWorkerRegistrationDescriptor& aDescriptor) override;
31
32
  // WorkerHolderToken::Listener
33
  void
34
  WorkerShuttingDown() override;
35
36
public:
37
  explicit ServiceWorkerRegistrationChild(WorkerHolderToken* aWorkerHolderToken);
38
0
  ~ServiceWorkerRegistrationChild() = default;
39
40
  void
41
  SetOwner(RemoteServiceWorkerRegistrationImpl* aOwner);
42
43
  void
44
  RevokeOwner(RemoteServiceWorkerRegistrationImpl* aOwner);
45
46
  void
47
  MaybeStartTeardown();
48
};
49
50
} // namespace dom
51
} // namespace mozilla
52
53
#endif // mozilla_dom_serviceworkerregistrationchild_h__