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
9 #include "mozilla/dom/PClientSourceChild.h"
11 namespace mozilla::dom
{
14 class ClientSourceConstructorArgs
;
15 template <typename ActorType
>
18 class ClientSourceChild final
: public PClientSourceChild
{
19 ClientSource
* mSource
;
20 bool mTeardownStarted
;
22 // PClientSourceChild interface
23 void ActorDestroy(ActorDestroyReason aReason
) override
;
25 PClientSourceOpChild
* AllocPClientSourceOpChild(
26 const ClientOpConstructorArgs
& aArgs
) override
;
28 bool DeallocPClientSourceOpChild(PClientSourceOpChild
* aActor
) override
;
30 mozilla::ipc::IPCResult
RecvPClientSourceOpConstructor(
31 PClientSourceOpChild
* aActor
,
32 const ClientOpConstructorArgs
& aArgs
) override
;
34 mozilla::ipc::IPCResult
RecvEvictFromBFCache() override
;
37 explicit ClientSourceChild(const ClientSourceConstructorArgs
& aArgs
);
39 void SetOwner(ClientThing
<ClientSourceChild
>* aThing
);
41 void RevokeOwner(ClientThing
<ClientSourceChild
>* aThing
);
43 ClientSource
* GetSource() const;
45 void MaybeStartTeardown();
48 } // namespace mozilla::dom
50 #endif // _mozilla_dom_ClientSourceChild_h