summaryrefslogtreecommitdiffstats
path: root/netwerk/base/nsIncrementalStreamLoader.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-10-24 10:42:23 +0000
committerMoonchild <moonchild@palemoon.org>2020-10-24 10:42:23 +0000
commite1db27e19989db11fef70f439cf95821316535b3 (patch)
treeabac2c9f5115323a8816d3ef600d8cb2bca5a33e /netwerk/base/nsIncrementalStreamLoader.cpp
parenta98d06380fe706e3b1b602411c597b9882516b3e (diff)
parenta5203631d8cded437c05243cde17cddeba13e3ec (diff)
downloadUXP-RC_20201024.tar
UXP-RC_20201024.tar.gz
UXP-RC_20201024.tar.lz
UXP-RC_20201024.tar.xz
UXP-RC_20201024.zip
Merge branch 'redwood' into releaseRELBASE_20201024RC_20201024
Diffstat (limited to 'netwerk/base/nsIncrementalStreamLoader.cpp')
-rw-r--r--netwerk/base/nsIncrementalStreamLoader.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/netwerk/base/nsIncrementalStreamLoader.cpp b/netwerk/base/nsIncrementalStreamLoader.cpp
index a7298be3f..8890333f8 100644
--- a/netwerk/base/nsIncrementalStreamLoader.cpp
+++ b/netwerk/base/nsIncrementalStreamLoader.cpp
@@ -11,10 +11,7 @@
#include <limits>
-nsIncrementalStreamLoader::nsIncrementalStreamLoader()
- : mData(), mBytesConsumed(0)
-{
-}
+nsIncrementalStreamLoader::nsIncrementalStreamLoader() = default;
nsIncrementalStreamLoader::~nsIncrementalStreamLoader()
{
@@ -49,7 +46,7 @@ NS_IMPL_ISUPPORTS(nsIncrementalStreamLoader, nsIIncrementalStreamLoader,
NS_IMETHODIMP
nsIncrementalStreamLoader::GetNumBytesRead(uint32_t* aNumBytes)
{
- *aNumBytes = mBytesConsumed + mData.length();
+ *aNumBytes = mBytesRead;
return NS_OK;
}
@@ -180,7 +177,6 @@ nsIncrementalStreamLoader::WriteSegmentFun(nsIInputStream *inStr,
}
}
- self->mBytesConsumed += consumedCount;
*writeCount = count;
return NS_OK;
@@ -198,6 +194,8 @@ nsIncrementalStreamLoader::OnDataAvailable(nsIRequest* request, nsISupports *ctx
uint32_t countRead;
nsresult rv = inStr->ReadSegments(WriteSegmentFun, this, count, &countRead);
mRequest = nullptr;
+ NS_ENSURE_SUCCESS(rv, rv);
+ mBytesRead += countRead;
return rv;
}