Backed out changeset 440612f47d83 (bug 1638172) for HttpChannelParent.cpp related bustages CLOSED TREE
authorBogdan Tara <btara@mozilla.com>
Fri, 22 May 2020 02:21:35 +0300
changeset 531545 320ad722da7f659f55a146ee4e2b5c0b0699557f
parent 531544 8be6868381828e323d97d6200afe35b1d2fe1b68
child 531546 d9a39c63e40e11af2cc13304f28b4a00fafc1dc5
push id37440
push userabutkovits@mozilla.com
push dateFri, 22 May 2020 09:43:16 +0000
treeherdermozilla-central@fbf71e4d2e21 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1638172
milestone78.0a1
backs out440612f47d83dffb36cbf342c8d349e86f13e6b6
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
Backed out changeset 440612f47d83 (bug 1638172) for HttpChannelParent.cpp related bustages CLOSED TREE
netwerk/protocol/http/HttpChannelParent.cpp
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -1366,27 +1366,23 @@ HttpChannelParent::OnStartRequest(nsIReq
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_RELEASE_ASSERT(!mDivertingFromChild,
                      "Cannot call OnStartRequest if diverting is set!");
 
   Maybe<uint32_t> multiPartID;
   bool isLastPartOfMultiPart = false;
 
   RefPtr<HttpBaseChannel> chan = do_QueryObject(aRequest);
-
-  nsCOMPtr<nsIMultiPartChannel> multiPartChannel;
   if (!chan) {
-    multiPartChannel = do_QueryInterface(aRequest);
+    nsCOMPtr<nsIMultiPartChannel> multiPartChannel =
+        do_QueryInterface(aRequest);
     if (multiPartChannel) {
       mIsMultiPart = true;
       nsCOMPtr<nsIChannel> baseChannel;
       multiPartChannel->GetBaseChannel(getter_AddRefs(baseChannel));
-
-      // Note that `chan` is the underlying base channel of the multipart
-      // channel in this case, which is different from `multiPartChannel`.
       chan = do_QueryObject(baseChannel);
 
       uint32_t partID = 0;
       multiPartChannel->GetPartID(&partID);
       multiPartID = Some(partID);
       multiPartChannel->GetIsLastPart(&isLastPartOfMultiPart);
     }
   }
@@ -1491,20 +1487,20 @@ HttpChannelParent::OnStartRequest(nsIReq
   nsHttpResponseHead* responseHead = chan->GetResponseHead();
   bool useResponseHead = !!responseHead;
   nsHttpResponseHead cleanedUpResponseHead;
   if (responseHead &&
       (responseHead->HasHeader(nsHttp::Set_Cookie) || multiPartID)) {
     cleanedUpResponseHead = *responseHead;
     cleanedUpResponseHead.ClearHeader(nsHttp::Set_Cookie);
     if (multiPartID) {
-      // For the multipart channel, use the parsed subtype instead.
-      MOZ_ASSERT(multiPartChannel);
+      nsCOMPtr<nsIChannel> chan = do_QueryInterface(aRequest);
+      MOZ_ASSERT(chan);
       nsAutoCString contentType;
-      multiPartChannel->GetContentType(contentType);
+      chan->GetContentType(contentType);
       cleanedUpResponseHead.SetContentType(contentType);
     }
     responseHead = &cleanedUpResponseHead;
   }
 
   if (!responseHead) {
     responseHead = &cleanedUpResponseHead;
   }