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 #ifndef _mozilla_dom_ClientManagerChild_h
7 #define _mozilla_dom_ClientManagerChild_h
9 #include "ClientThing.h"
10 #include "mozilla/dom/PClientManagerChild.h"
12 namespace mozilla::dom
{
17 class ClientManagerChild final
: public PClientManagerChild
{
18 ClientThing
<ClientManagerChild
>* mManager
;
20 RefPtr
<IPCWorkerRef
> mIPCWorkerRef
;
21 bool mTeardownStarted
;
24 ~ClientManagerChild();
26 // PClientManagerChild interface
27 void ActorDestroy(ActorDestroyReason aReason
) override
;
29 PClientManagerOpChild
* AllocPClientManagerOpChild(
30 const ClientOpConstructorArgs
& aArgs
) override
;
32 bool DeallocPClientManagerOpChild(PClientManagerOpChild
* aActor
) override
;
34 PClientNavigateOpChild
* AllocPClientNavigateOpChild(
35 const ClientNavigateOpConstructorArgs
& aArgs
) override
;
37 bool DeallocPClientNavigateOpChild(PClientNavigateOpChild
* aActor
) override
;
39 mozilla::ipc::IPCResult
RecvPClientNavigateOpConstructor(
40 PClientNavigateOpChild
* aActor
,
41 const ClientNavigateOpConstructorArgs
& aArgs
) override
;
44 NS_INLINE_DECL_REFCOUNTING(ClientManagerChild
, override
)
46 static already_AddRefed
<ClientManagerChild
> Create();
48 void SetOwner(ClientThing
<ClientManagerChild
>* aThing
);
50 void RevokeOwner(ClientThing
<ClientManagerChild
>* aThing
);
52 void MaybeStartTeardown();
54 mozilla::dom::WorkerPrivate
* GetWorkerPrivate() const;
57 } // namespace mozilla::dom
59 #endif // _mozilla_dom_ClientManagerChild_h