Bug 1704628 Part 4: Avoid use of ESC to close context menu in browser_toolbox_content...
[gecko.git] / dom / cache / CacheStreamControlChild.h
blob47e8fde21f7711eecc54b1a6d0f251fe7ab42be8
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 {
16 namespace ipc {
17 class AutoIPCStream;
18 } // namespace ipc
19 namespace dom {
20 namespace cache {
22 class ReadStream;
24 class CacheStreamControlChild final : public PCacheStreamControlChild,
25 public StreamControl,
26 public ActorChild {
27 friend class PCacheStreamControlChild;
29 public:
30 CacheStreamControlChild();
32 // ActorChild methods
33 virtual void StartDestroy() override;
35 // StreamControl methods
36 virtual void SerializeControl(CacheReadStream* aReadStreamOut) override;
38 virtual void SerializeStream(CacheReadStream* aReadStreamOut,
39 nsIInputStream* aStream,
40 nsTArray<UniquePtr<mozilla::ipc::AutoIPCStream>>&
41 aStreamCleanupList) override;
43 virtual void OpenStream(const nsID& aId,
44 InputStreamResolver&& aResolver) override;
46 NS_DECL_OWNINGTHREAD
47 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CacheStreamControlChild, override)
48 private:
49 ~CacheStreamControlChild();
50 virtual void NoteClosedAfterForget(const nsID& aId) override;
52 #ifdef DEBUG
53 virtual void AssertOwningThread() override;
54 #endif
56 // PCacheStreamControlChild methods
57 virtual void ActorDestroy(ActorDestroyReason aReason) override;
58 mozilla::ipc::IPCResult RecvClose(const nsID& aId);
59 mozilla::ipc::IPCResult RecvCloseAll();
61 bool mDestroyStarted;
62 bool mDestroyDelayed;
65 } // namespace cache
66 } // namespace dom
67 } // namespace mozilla
69 #endif // mozilla_dom_cache_CacheStreamControlChild_h