2015-03-02 16:20:00 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_cache_CacheStreamControlChild_h
|
|
|
|
#define mozilla_dom_cache_CacheStreamControlChild_h
|
|
|
|
|
|
|
|
#include "mozilla/dom/cache/ActorChild.h"
|
|
|
|
#include "mozilla/dom/cache/PCacheStreamControlChild.h"
|
2015-03-20 21:01:57 +03:00
|
|
|
#include "mozilla/dom/cache/StreamControl.h"
|
2015-03-02 16:20:00 +03:00
|
|
|
#include "nsTObserverArray.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
2016-05-15 20:32:09 +03:00
|
|
|
namespace ipc {
|
|
|
|
class AutoIPCStream;
|
|
|
|
} // namespace ipc
|
2015-03-02 16:20:00 +03:00
|
|
|
namespace dom {
|
|
|
|
namespace cache {
|
|
|
|
|
|
|
|
class ReadStream;
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class CacheStreamControlChild final : public PCacheStreamControlChild,
|
2015-03-22 09:52:12 +03:00
|
|
|
public StreamControl,
|
|
|
|
public ActorChild {
|
2019-02-06 18:57:37 +03:00
|
|
|
friend class PCacheStreamControlChild;
|
|
|
|
|
2015-03-02 16:20:00 +03:00
|
|
|
public:
|
|
|
|
CacheStreamControlChild();
|
|
|
|
|
2015-03-21 00:03:27 +03:00
|
|
|
// ActorChild methods
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void StartDestroy() override;
|
2015-03-20 21:01:57 +03:00
|
|
|
|
2015-03-20 21:01:57 +03:00
|
|
|
// StreamControl methods
|
2015-04-16 22:00:15 +03:00
|
|
|
virtual void SerializeControl(CacheReadStream* aReadStreamOut) override;
|
2015-03-20 21:01:57 +03:00
|
|
|
|
2016-05-15 20:32:09 +03:00
|
|
|
virtual void SerializeStream(CacheReadStream* aReadStreamOut,
|
|
|
|
nsIInputStream* aStream,
|
|
|
|
nsTArray<UniquePtr<mozilla::ipc::AutoIPCStream>>&
|
|
|
|
aStreamCleanupList) override;
|
2015-03-20 21:01:57 +03:00
|
|
|
|
2017-09-15 22:25:41 +03:00
|
|
|
virtual void OpenStream(const nsID& aId,
|
|
|
|
InputStreamResolver&& aResolver) override;
|
|
|
|
|
2020-06-09 15:58:44 +03:00
|
|
|
NS_DECL_OWNINGTHREAD
|
|
|
|
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CacheStreamControlChild, override)
|
2015-03-02 16:20:00 +03:00
|
|
|
private:
|
2020-06-09 15:58:44 +03:00
|
|
|
~CacheStreamControlChild();
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void NoteClosedAfterForget(const nsID& aId) override;
|
2015-03-20 21:01:57 +03:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void AssertOwningThread() override;
|
2015-03-20 21:01:57 +03:00
|
|
|
#endif
|
|
|
|
|
2015-03-02 16:20:00 +03:00
|
|
|
// PCacheStreamControlChild methods
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason aReason) override;
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvClose(const nsID& aId);
|
|
|
|
mozilla::ipc::IPCResult RecvCloseAll();
|
2015-03-02 16:20:00 +03:00
|
|
|
|
|
|
|
bool mDestroyStarted;
|
2015-04-16 22:00:15 +03:00
|
|
|
bool mDestroyDelayed;
|
2015-03-02 16:20:00 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace cache
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_cache_CacheStreamControlChild_h
|