Bug 1401522 - Don't apply statusCode sent from parent if mCanceled or mStatus has been modified in the child. r=mayhemer
authorSamael Wang <freesamael@gmail.com>
Thu, 28 Sep 2017 11:16:53 +0800
changeset 385685 8ebfa90c4ebca44ac1c3829ef54de74d3b004dfc
parent 385684 aae33bcfef8b4d7e66478d9f54ae2f66d8aaf201
child 385686 2ebd11851adf2b09c4bdf38c3270a8eb7d6d9441
push id32664
push userarchaeopteryx@coole-files.de
push dateThu, 12 Oct 2017 09:34:55 +0000
treeherdermozilla-central@a32c32d9631c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs1401522
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 1401522 - Don't apply statusCode sent from parent if mCanceled or mStatus has been modified in the child. r=mayhemer When a WyciwygChannel is canceled, but WyciwygChannelParent::RecvCancel happens after WyciwygChannelParent::SendOnStartRequest, it would send statusCode=NS_OK to WyciwygChannelChild::OnStartRequest. So we should not apply the statusCode if mCanceled, just like how HttpChannelChild handles it. MozReview-Commit-ID: 5H3PUrlArIA
netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp
--- a/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp
+++ b/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp
@@ -186,17 +186,19 @@ WyciwygChannelChild::OnStartRequest(cons
                                     const int32_t& source,
                                     const nsCString& charset,
                                     const nsCString& securityInfo)
 {
   LOG(("WyciwygChannelChild::RecvOnStartRequest [this=%p]\n", this));
 
   mState = WCC_ONSTART;
 
-  mStatus = statusCode;
+  if (!mCanceled && NS_SUCCEEDED(mStatus)) {
+    mStatus = statusCode;
+  }
   mContentLength = contentLength;
   mCharsetSource = source;
   mCharset = charset;
 
   if (!securityInfo.IsEmpty()) {
     NS_DeserializeObject(securityInfo, getter_AddRefs(mSecurityInfo));
   }