Bug 1405571 - Only do a final flush on the XHR text decoder once; r=hsivonen
authorThomas Wisniewski <wisniewskit@gmail.com>
Wed, 04 Oct 2017 15:05:28 -0400
changeset 384731 224d8c57a4693138c8823ac108659bb1fe5b308e
parent 384730 1053bf2fbaed195d37a07ae81d5086cac0b8f6b8
child 384732 abcd8dfc3a869a1c5292f91b48b7e21f48766f59
push id52750
push userryanvm@gmail.com
push dateThu, 05 Oct 2017 19:07:15 +0000
treeherderautoland@224d8c57a469 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsivonen
bugs1405571
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1405571 - Only do a final flush on the XHR text decoder once; r=hsivonen MozReview-Commit-ID: 7KphkchHBiw
dom/xhr/XMLHttpRequestMainThread.cpp
--- a/dom/xhr/XMLHttpRequestMainThread.cpp
+++ b/dom/xhr/XMLHttpRequestMainThread.cpp
@@ -568,16 +568,21 @@ XMLHttpRequestMainThread::AppendToRespon
     AsBytes(MakeSpan(aSrcBuffer, aSrcBufferLen)),
     MakeSpan(helper.EndOfExistingData(), destBufferLen.value()),
     aLast);
   MOZ_ASSERT(result == kInputEmpty);
   MOZ_ASSERT(read == aSrcBufferLen);
   MOZ_ASSERT(written <= destBufferLen.value());
   Unused << hadErrors;
   helper.AddLength(written);
+
+  if (aLast) {
+    mDecoder = nullptr;
+  }
+
   return NS_OK;
 }
 
 NS_IMETHODIMP
 XMLHttpRequestMainThread::GetResponseText(nsAString& aResponseText)
 {
   ErrorResult rv;
   DOMString str;