/* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* 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/. */
/** * mozilla::net::MemoryDownloader * * This class is similar to nsIDownloader, but stores the downloaded * stream in memory instead of a file. Ownership of the temporary * memory is transferred to the observer when download is complete; * there is no need to retain a reference to the downloader.
*/
namespace mozilla { namespace net {
class MemoryDownloader final : public nsIStreamListener { public:
NS_DECL_ISUPPORTS
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSISTREAMLISTENER
using Data = mozilla::UniquePtr<FallibleTArray<uint8_t>>;
class IObserver : public nsISupports { public: // Note: aData may be null if (and only if) aStatus indicates failure. virtualvoid OnDownloadComplete(MemoryDownloader* aDownloader,
nsIRequest* aRequest, nsresult aStatus,
Data aData) = 0;
};
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.