/* 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/. */
nsDownloader::~nsDownloader() { if (mLocation && mLocationIsTemp) { // release the sink first since it may still hold an open file // descriptor to mLocation. this needs to happen before the // file can be removed otherwise the Remove call will fail. if (mSink) {
mSink->Close();
mSink = nullptr;
}
nsresult rv = mLocation->Remove(false); if (NS_FAILED(rv)) NS_ERROR("unable to remove temp file");
}
}
rv = NS_NewLocalFileOutputStream(getter_AddRefs(mSink), mLocation); if (NS_FAILED(rv)) return rv;
// we could wrap this output stream with a buffered output stream, // but it shouldn't be necessary since we will be writing large // chunks given to us via OnDataAvailable.
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.