Source code

Revision control

Other Tools

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
12
namespace mozilla {
13
namespace dom {
14
15
class IPCWorkerRef;
16
class RemoteServiceWorkerRegistrationImpl;
17
18
class ServiceWorkerRegistrationChild final
19
: public PServiceWorkerRegistrationChild {
20
RefPtr<IPCWorkerRef> mIPCWorkerRef;
21
RemoteServiceWorkerRegistrationImpl* mOwner;
22
bool mTeardownStarted;
23
24
ServiceWorkerRegistrationChild();
25
26
// PServiceWorkerRegistrationChild
27
void ActorDestroy(ActorDestroyReason aReason) override;
28
29
mozilla::ipc::IPCResult RecvUpdateState(
30
const IPCServiceWorkerRegistrationDescriptor& aDescriptor) override;
31
32
mozilla::ipc::IPCResult RecvFireUpdateFound() override;
33
34
public:
35
static ServiceWorkerRegistrationChild* Create();
36
37
~ServiceWorkerRegistrationChild() = default;
38
39
void SetOwner(RemoteServiceWorkerRegistrationImpl* aOwner);
40
41
void RevokeOwner(RemoteServiceWorkerRegistrationImpl* aOwner);
42
43
void MaybeStartTeardown();
44
};
45
46
} // namespace dom
47
} // namespace mozilla
48
49
#endif // mozilla_dom_serviceworkerregistrationchild_h__