summaryrefslogtreecommitdiffstats
path: root/toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-25 15:48:44 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-25 15:48:44 +0200
commit3ab6c7feee8126bdfc5c9ab9371db41102e12e95 (patch)
treea309c45826300b888238b6a517051fe7e71d63eb /toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp
parentb18a9cf86ea25bc52d9cfea584e3aa8bfbe81f0a (diff)
parentb069dabc91b7e0f5f8d161cdbe598276a21d6d68 (diff)
downloadUXP-3ab6c7feee8126bdfc5c9ab9371db41102e12e95.tar
UXP-3ab6c7feee8126bdfc5c9ab9371db41102e12e95.tar.gz
UXP-3ab6c7feee8126bdfc5c9ab9371db41102e12e95.tar.lz
UXP-3ab6c7feee8126bdfc5c9ab9371db41102e12e95.tar.xz
UXP-3ab6c7feee8126bdfc5c9ab9371db41102e12e95.zip
Merge branch 'master' of https://github.com/MoonchildProductions/UXP into pm_url_1
Diffstat (limited to 'toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp')
-rw-r--r--toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp17
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);
}
////////////////////////////////////////////////////////////////////////////////