Bug 1627533 - Have DocumentLoadListener retrieve the request context id from the BrowsingContext and use it for http loads. r=dragana,necko-reviewers
authorMatt Woodrow <mwoodrow@mozilla.com>
Thu, 21 May 2020 03:38:45 +0000
changeset 531377 fb696e38fc5cafa37423b0c26a7006ddc7fd2c72
parent 531376 80377f949b46616cec510584a405131a49bdcf94
child 531378 2d00a1a6495c9b0350c4a7d601df64b49355e701
push id37438
push userabutkovits@mozilla.com
push dateThu, 21 May 2020 09:36:57 +0000
treeherdermozilla-central@2d00a1a6495c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdragana, necko-reviewers
bugs1627533
milestone78.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 1627533 - Have DocumentLoadListener retrieve the request context id from the BrowsingContext and use it for http loads. r=dragana,necko-reviewers Differential Revision: https://phabricator.services.mozilla.com/D75886
netwerk/ipc/DocumentLoadListener.cpp
--- a/netwerk/ipc/DocumentLoadListener.cpp
+++ b/netwerk/ipc/DocumentLoadListener.cpp
@@ -449,16 +449,21 @@ bool DocumentLoadListener::Open(
     httpChannelImpl->SetWarningReporter(this);
   }
 
   nsCOMPtr<nsITimedChannel> timedChannel = do_QueryInterface(mChannel);
   if (timedChannel) {
     timedChannel->SetAsyncOpen(aAsyncOpenTime);
   }
 
+  if (nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(mChannel)) {
+    Unused << httpChannel->SetRequestContextID(
+        browsingContext->GetRequestContextId());
+  }
+
   // nsViewSourceChannel normally replaces the nsIRequest passed to
   // OnStart/StopRequest with itself. We don't need this, and instead
   // we want the original request so that we get different ones for
   // each part of a multipart channel.
   nsCOMPtr<nsIViewSourceChannel> viewSourceChannel;
   if (OtherPid() && (viewSourceChannel = do_QueryInterface(mChannel))) {
     viewSourceChannel->SetReplaceRequest(false);
   }