ClientSourceChild.h (1618B)
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_ClientSourceChild_h 7 #define _mozilla_dom_ClientSourceChild_h 8 9 #include "mozilla/dom/PClientSourceChild.h" 10 11 namespace mozilla::dom { 12 13 class ClientSource; 14 class ClientSourceConstructorArgs; 15 template <typename ActorType> 16 class ClientThing; 17 18 class ClientSourceChild final : public PClientSourceChild { 19 ClientSource* mSource; 20 bool mTeardownStarted; 21 22 ~ClientSourceChild() = default; 23 24 // PClientSourceChild interface 25 void ActorDestroy(ActorDestroyReason aReason) override; 26 27 PClientSourceOpChild* AllocPClientSourceOpChild( 28 const ClientOpConstructorArgs& aArgs) override; 29 30 bool DeallocPClientSourceOpChild(PClientSourceOpChild* aActor) override; 31 32 mozilla::ipc::IPCResult RecvPClientSourceOpConstructor( 33 PClientSourceOpChild* aActor, 34 const ClientOpConstructorArgs& aArgs) override; 35 36 mozilla::ipc::IPCResult RecvEvictFromBFCache() override; 37 38 public: 39 NS_INLINE_DECL_REFCOUNTING(ClientSourceChild, override) 40 41 explicit ClientSourceChild(const ClientSourceConstructorArgs& aArgs); 42 43 void SetOwner(ClientThing<ClientSourceChild>* aThing); 44 45 void RevokeOwner(ClientThing<ClientSourceChild>* aThing); 46 47 ClientSource* GetSource() const; 48 49 void MaybeStartTeardown(); 50 }; 51 52 } // namespace mozilla::dom 53 54 #endif // _mozilla_dom_ClientSourceChild_h