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