ClientManagerChild.h (1824B)
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 8 9 #include "ClientThing.h" 10 #include "mozilla/dom/PClientManagerChild.h" 11 12 namespace mozilla::dom { 13 14 class IPCWorkerRef; 15 class WorkerPrivate; 16 17 class ClientManagerChild final : public PClientManagerChild { 18 ClientThing<ClientManagerChild>* mManager; 19 20 RefPtr<IPCWorkerRef> mIPCWorkerRef; 21 bool mTeardownStarted; 22 23 ClientManagerChild(); 24 ~ClientManagerChild(); 25 26 // PClientManagerChild interface 27 void ActorDestroy(ActorDestroyReason aReason) override; 28 29 PClientManagerOpChild* AllocPClientManagerOpChild( 30 const ClientOpConstructorArgs& aArgs) override; 31 32 bool DeallocPClientManagerOpChild(PClientManagerOpChild* aActor) override; 33 34 PClientNavigateOpChild* AllocPClientNavigateOpChild( 35 const ClientNavigateOpConstructorArgs& aArgs) override; 36 37 bool DeallocPClientNavigateOpChild(PClientNavigateOpChild* aActor) override; 38 39 mozilla::ipc::IPCResult RecvPClientNavigateOpConstructor( 40 PClientNavigateOpChild* aActor, 41 const ClientNavigateOpConstructorArgs& aArgs) override; 42 43 public: 44 NS_INLINE_DECL_REFCOUNTING(ClientManagerChild, override) 45 46 static already_AddRefed<ClientManagerChild> Create(); 47 48 void SetOwner(ClientThing<ClientManagerChild>* aThing); 49 50 void RevokeOwner(ClientThing<ClientManagerChild>* aThing); 51 52 void MaybeStartTeardown(); 53 54 mozilla::dom::WorkerPrivate* GetWorkerPrivate() const; 55 }; 56 57 } // namespace mozilla::dom 58 59 #endif // _mozilla_dom_ClientManagerChild_h