diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-04-19 12:08:25 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-04-19 12:08:25 +0200 |
commit | d7df65954a585e97ccee21fa9cb50cb116efddcc (patch) | |
tree | 9ed9a1f46f5d2e8373dcab553bad55b54bb8103b /toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp | |
parent | ba71cc45fef6dfaecef8f5edf65ce1f1ff457624 (diff) | |
parent | 9135a11e8c8f0837738fd976b28d36a53fd1de27 (diff) | |
download | UXP-d7df65954a585e97ccee21fa9cb50cb116efddcc.tar UXP-d7df65954a585e97ccee21fa9cb50cb116efddcc.tar.gz UXP-d7df65954a585e97ccee21fa9cb50cb116efddcc.tar.lz UXP-d7df65954a585e97ccee21fa9cb50cb116efddcc.tar.xz UXP-d7df65954a585e97ccee21fa9cb50cb116efddcc.zip |
Merge branch 'ported-upstream'
Diffstat (limited to 'toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp')
-rw-r--r-- | toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp b/toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp index 68f9f1f6f..0e89fd20c 100644 --- a/toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp +++ b/toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp @@ -13,14 +13,11 @@ // nsCheckSummedOutputStream NS_IMPL_ISUPPORTS_INHERITED(nsCheckSummedOutputStream, - nsSafeFileOutputStream, - nsISafeOutputStream, - nsIOutputStream, - nsIFileOutputStream) + nsBufferedOutputStream, + nsISafeOutputStream) NS_IMETHODIMP -nsCheckSummedOutputStream::Init(nsIFile* file, int32_t ioFlags, int32_t perm, - int32_t behaviorFlags) +nsCheckSummedOutputStream::Init(nsIOutputStream* stream, uint32_t bufferSize) { nsresult rv; mHash = do_CreateInstance(NS_CRYPTO_HASH_CONTRACTID, &rv); @@ -29,7 +26,7 @@ nsCheckSummedOutputStream::Init(nsIFile* file, int32_t ioFlags, int32_t perm, rv = mHash->Init(nsICryptoHash::MD5); NS_ENSURE_SUCCESS(rv, rv); - return nsSafeFileOutputStream::Init(file, ioFlags, perm, behaviorFlags); + return nsBufferedOutputStream::Init(stream, bufferSize); } NS_IMETHODIMP @@ -39,12 +36,12 @@ nsCheckSummedOutputStream::Finish() NS_ENSURE_SUCCESS(rv, rv); uint32_t written; - rv = nsSafeFileOutputStream::Write(reinterpret_cast<const char*>(mCheckSum.BeginReading()), + rv = nsBufferedOutputStream::Write(reinterpret_cast<const char*>(mCheckSum.BeginReading()), mCheckSum.Length(), &written); NS_ASSERTION(written == mCheckSum.Length(), "Error writing stream checksum"); NS_ENSURE_SUCCESS(rv, rv); - return nsSafeFileOutputStream::Finish(); + return nsBufferedOutputStream::Finish(); } NS_IMETHODIMP @@ -53,7 +50,7 @@ nsCheckSummedOutputStream::Write(const char *buf, uint32_t count, uint32_t *resu nsresult rv = mHash->Update(reinterpret_cast<const uint8_t*>(buf), count); NS_ENSURE_SUCCESS(rv, rv); - return nsSafeFileOutputStream::Write(buf, count, result); + return nsBufferedOutputStream::Write(buf, count, result); } //////////////////////////////////////////////////////////////////////////////// |