Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / dom / cache / CacheStreamControlChild.h
blobfa78b8caf21fd28b1ab2e75d74fd53f22da29c47
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 {
17 class ReadStream;
19 class CacheStreamControlChild final : public PCacheStreamControlChild,
20 public StreamControl,
21 public ActorChild {
22 friend class PCacheStreamControlChild;
24 public:
25 CacheStreamControlChild();
27 // ActorChild methods
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;
39 NS_DECL_OWNINGTHREAD
40 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CacheStreamControlChild, override)
41 private:
42 ~CacheStreamControlChild();
43 virtual void NoteClosedAfterForget(const nsID& aId) override;
45 #ifdef DEBUG
46 virtual void AssertOwningThread() override;
47 #endif
49 // PCacheStreamControlChild methods
50 virtual void ActorDestroy(ActorDestroyReason aReason) override;
51 mozilla::ipc::IPCResult RecvClose(const nsID& aId);
52 mozilla::ipc::IPCResult RecvCloseAll();
54 bool mDestroyStarted;
55 bool mDestroyDelayed;
58 } // namespace mozilla::dom::cache
60 #endif // mozilla_dom_cache_CacheStreamControlChild_h