/* -*- 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/. */
// Abstract class to help implement the stream control Child and Parent actors. // This provides an interface to partly help with serialization of IPC types, // but also an implementation for tracking ReadStream objects. class StreamControl { public: // abstract interface that must be implemented by child class virtualvoid SerializeControl(CacheReadStream* aReadStreamOut) = 0;
// inherited implementation of the ReadStream::Controllable list
// Begin controlling the given ReadStream. This causes a strong ref to // be held by the control. The ReadStream must call NoteClosed() or // ForgetReadStream() to release this ref. void AddReadStream(SafeRefPtr<ReadStream::Controllable> aReadStream);
// Forget the ReadStream without notifying the actor. void ForgetReadStream(SafeRefPtr<ReadStream::Controllable> aReadStream);
// Forget the ReadStream and then notify the actor the stream is closed. void NoteClosed(SafeRefPtr<ReadStream::Controllable> aReadStream, const nsID& aId);
protected:
~StreamControl();
void CloseAllReadStreams();
void CloseAllReadStreamsWithoutReporting();
bool HasEverBeenRead() const;
// protected parts of the abstract interface virtualvoid NoteClosedAfterForget(const nsID& aId) = 0;
private: // Hold strong references to ReadStream object. When the stream is closed // it should call NoteClosed() or ForgetReadStream() to release this ref. using ReadStreamList = nsTObserverArray<SafeRefPtr<ReadStream::Controllable>>;
ReadStreamList mReadStreamList;
};
} // namespace mozilla::dom::cache
#endif// mozilla_dom_cache_StreamControl_h
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.