diff options
Diffstat (limited to 'netwerk/base/nsIncrementalStreamLoader.cpp')
-rw-r--r-- | netwerk/base/nsIncrementalStreamLoader.cpp | 10 |
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; } |