CacheStreamControlChild.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef mozilla_dom_cache_CacheStreamControlChild_h
  6. #define mozilla_dom_cache_CacheStreamControlChild_h
  7. #include "mozilla/dom/cache/ActorChild.h"
  8. #include "mozilla/dom/cache/PCacheStreamControlChild.h"
  9. #include "mozilla/dom/cache/StreamControl.h"
  10. #include "nsTObserverArray.h"
  11. namespace mozilla {
  12. namespace ipc {
  13. class AutoIPCStream;
  14. } // namespace ipc
  15. namespace dom {
  16. namespace cache {
  17. class ReadStream;
  18. class CacheStreamControlChild final : public PCacheStreamControlChild
  19. , public StreamControl
  20. , public ActorChild
  21. {
  22. public:
  23. CacheStreamControlChild();
  24. ~CacheStreamControlChild();
  25. // ActorChild methods
  26. virtual void StartDestroy() override;
  27. // StreamControl methods
  28. virtual void
  29. SerializeControl(CacheReadStream* aReadStreamOut) override;
  30. virtual void
  31. SerializeStream(CacheReadStream* aReadStreamOut, nsIInputStream* aStream,
  32. nsTArray<UniquePtr<mozilla::ipc::AutoIPCStream>>& aStreamCleanupList) override;
  33. private:
  34. virtual void
  35. NoteClosedAfterForget(const nsID& aId) override;
  36. #ifdef DEBUG
  37. virtual void
  38. AssertOwningThread() override;
  39. #endif
  40. // PCacheStreamControlChild methods
  41. virtual void ActorDestroy(ActorDestroyReason aReason) override;
  42. virtual bool RecvClose(const nsID& aId) override;
  43. virtual bool RecvCloseAll() override;
  44. bool mDestroyStarted;
  45. bool mDestroyDelayed;
  46. NS_DECL_OWNINGTHREAD
  47. };
  48. } // namespace cache
  49. } // namespace dom
  50. } // namespace mozilla
  51. #endif // mozilla_dom_cache_CacheStreamControlChild_h