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/. */
7 #ifndef mozilla_dom_cache_CacheStreamControlChild_h
8 #define mozilla_dom_cache_CacheStreamControlChild_h
10 #include "mozilla/dom/cache/ActorChild.h"
11 #include "mozilla/dom/cache/PCacheStreamControlChild.h"
12 #include "mozilla/dom/cache/StreamControl.h"
13 #include "nsTObserverArray.h"
15 namespace mozilla::dom::cache
{
19 class CacheStreamControlChild final
: public PCacheStreamControlChild
,
22 friend class PCacheStreamControlChild
;
25 CacheStreamControlChild();
28 virtual void StartDestroy() override
;
30 // StreamControl methods
31 virtual void SerializeControl(CacheReadStream
* aReadStreamOut
) override
;
33 virtual void SerializeStream(CacheReadStream
* aReadStreamOut
,
34 nsIInputStream
* aStream
) override
;
36 virtual void OpenStream(const nsID
& aId
,
37 InputStreamResolver
&& aResolver
) override
;
40 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CacheStreamControlChild
, override
)
42 ~CacheStreamControlChild();
43 virtual void NoteClosedAfterForget(const nsID
& aId
) override
;
46 virtual void AssertOwningThread() override
;
49 // PCacheStreamControlChild methods
50 virtual void ActorDestroy(ActorDestroyReason aReason
) override
;
51 mozilla::ipc::IPCResult
RecvClose(const nsID
& aId
);
52 mozilla::ipc::IPCResult
RecvCloseAll();
58 } // namespace mozilla::dom::cache
60 #endif // mozilla_dom_cache_CacheStreamControlChild_h