Bug 1482640 - Null out mDecoder in OnStopRequest to avoid asserting when there is more than one OnStopRequest. r=smaug
authorHenri Sivonen <hsivonen@hsivonen.fi>
Mon, 13 Aug 2018 17:10:06 +0000
changeset 486393 02b3167c1a8e87b2cb09cf2c6508df76e3e03c76
parent 486392 e0ddd48b0a8f092c05f3d254e346407929b43f30
child 486394 ec15fcd87b3825b08c31601091a57a921cddaf20
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1482640
milestone63.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 1482640 - Null out mDecoder in OnStopRequest to avoid asserting when there is more than one OnStopRequest. r=smaug MozReview-Commit-ID: K25XhiYGzhl Differential Revision: https://phabricator.services.mozilla.com/D3217
dom/xhr/XMLHttpRequestMainThread.cpp
--- a/dom/xhr/XMLHttpRequestMainThread.cpp
+++ b/dom/xhr/XMLHttpRequestMainThread.cpp
@@ -2083,16 +2083,18 @@ XMLHttpRequestMainThread::OnStopRequest(
     // Can this still happen?
     return NS_OK;
   }
 
   // Send the decoder the signal that we've hit the end of the stream,
   // but only when parsing text (not XML, which does this already).
   if (mDecoder && !mFlagParseBody) {
     AppendToResponseText(nullptr, 0, true);
+    // Null out the decoder to ignore subsequent OnStopRequest calls
+    mDecoder = nullptr;
   }
 
   mWaitingForOnStopRequest = false;
 
   if (mRequestObserver) {
     NS_ASSERTION(mFirstStartRequestSeen, "Inconsistent state!");
     mFirstStartRequestSeen = false;
     mRequestObserver->OnStopRequest(request, ctxt, status);