Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/serviceworkers/ServiceWorkerChild.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_serviceworkerchild_h__
8
#define mozilla_dom_serviceworkerchild_h__
9
10
#include "mozilla/dom/PServiceWorkerChild.h"
11
#include "mozilla/dom/WorkerHolderToken.h"
12
13
namespace mozilla {
14
namespace dom {
15
16
class RemoteServiceWorkerImpl;
17
18
class ServiceWorkerChild final : public PServiceWorkerChild
19
                               , public WorkerHolderToken::Listener
20
{
21
  RefPtr<WorkerHolderToken> mWorkerHolderToken;
22
  RemoteServiceWorkerImpl* mOwner;
23
  bool mTeardownStarted;
24
25
  // PServiceWorkerChild
26
  void
27
  ActorDestroy(ActorDestroyReason aReason) override;
28
29
  // WorkerHolderToken::Listener
30
  void
31
  WorkerShuttingDown() override;
32
33
public:
34
  explicit ServiceWorkerChild(WorkerHolderToken* aWorkerHolderToken);
35
0
  ~ServiceWorkerChild() = default;
36
37
  void
38
  SetOwner(RemoteServiceWorkerImpl* aOwner);
39
40
  void
41
  RevokeOwner(RemoteServiceWorkerImpl* aOwner);
42
43
  void
44
  MaybeStartTeardown();
45
};
46
47
} // namespace dom
48
} // namespace mozilla
49
50
#endif // mozilla_dom_serviceworkerchild_h__