/* -*- 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/. */
nsresult MemoryDownloader::ConsumeData(nsIInputStream* aIn, void* aClosure, constchar* aFromRawSegment,
uint32_t aToOffset, uint32_t aCount,
uint32_t* aWriteCount) {
MemoryDownloader* self = static_cast<MemoryDownloader*>(aClosure); if (!self->mData->AppendElements(aFromRawSegment, aCount, fallible)) { // The error returned by ConsumeData isn't propagated to the // return of ReadSegments, so it has to be passed as state.
self->mStatus = NS_ERROR_OUT_OF_MEMORY; return NS_ERROR_OUT_OF_MEMORY;
}
*aWriteCount = aCount; return NS_OK;
}
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.