Backed out 3 changesets (bug 1525640) for causing leaks a=backout
authorCoroiu Cristina <ccoroiu@mozilla.com>
Sat, 13 Apr 2019 14:57:11 +0300
changeset 469331 d9ee5458ce46d43e760fe81dffe866673080b78e
parent 469330 846d7680d2de2f8ae3cc55f8a448d4e8fff7f688
child 469403 45bf2b32a37712dbdf69b943994a37ae6afc4eb1
child 469418 b7e2018b550c9e0cb80644b23791e673d152ac3f
push id35864
push userccoroiu@mozilla.com
push dateSat, 13 Apr 2019 11:58:03 +0000
treeherdermozilla-central@d9ee5458ce46 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1525640
milestone68.0a1
backs outefdd32c00dc61f9d8b377a78b9955b2d842f28fd
e71641f0465b5b0dd7ce7c67f76a84ee085b61cf
e3539a40afdf5a4a7848edb5d01ffd253966ba75
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 3 changesets (bug 1525640) for causing leaks a=backout Backed out changeset efdd32c00dc6 (bug 1525640) Backed out changeset e71641f0465b (bug 1525640) Backed out changeset e3539a40afdf (bug 1525640)
media/mtransport/test/webrtcproxychannel_unittest.cpp
netwerk/base/nsISocketTransport.idl
netwerk/base/nsSocketTransport2.cpp
netwerk/base/nsSocketTransport2.h
netwerk/dns/TRR.cpp
netwerk/dns/nsDNSService2.cpp
netwerk/protocol/http/ClassifierDummyChannel.cpp
netwerk/protocol/http/Http2Session.cpp
netwerk/protocol/http/Http2Stream.cpp
netwerk/protocol/http/HttpBaseChannel.cpp
netwerk/protocol/http/HttpBaseChannel.h
netwerk/protocol/http/HttpChannelChild.cpp
netwerk/protocol/http/HttpChannelChild.h
netwerk/protocol/http/HttpChannelParent.cpp
netwerk/protocol/http/PHttpChannel.ipdl
netwerk/protocol/http/TunnelUtils.cpp
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/protocol/http/nsHttpConnection.cpp
netwerk/protocol/http/nsHttpConnectionInfo.cpp
netwerk/protocol/http/nsHttpConnectionInfo.h
netwerk/protocol/http/nsHttpTransaction.cpp
netwerk/protocol/http/nsHttpTransaction.h
netwerk/protocol/http/nsIHttpChannelInternal.idl
--- a/media/mtransport/test/webrtcproxychannel_unittest.cpp
+++ b/media/mtransport/test/webrtcproxychannel_unittest.cpp
@@ -177,20 +177,16 @@ class FakeSocketTransportProvider : publ
       bool *aResetIPFamilyPreference) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
   NS_IMETHOD GetEsniUsed(bool *aEsniUsed) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
-  NS_IMETHOD ResolvedByTRR(bool *aResolvedByTRR) override {
-    MOZ_ASSERT(false);
-    return NS_OK;
-  }
 
   // nsITransport
   NS_IMETHOD OpenInputStream(uint32_t aFlags, uint32_t aSegmentSize,
                              uint32_t aSegmentCount,
                              nsIInputStream **_retval) override {
     MOZ_ASSERT(false);
     return NS_OK;
   }
--- a/netwerk/base/nsISocketTransport.idl
+++ b/netwerk/base/nsISocketTransport.idl
@@ -309,14 +309,9 @@ interface nsISocketTransport : nsITransp
      */
     readonly attribute boolean resetIPFamilyPreference;
 
     /**
      * This attribute holds information whether esni has been used.
      * The value is set after PR_Connect is called.
      */
    readonly attribute boolean esniUsed;
-
-   /**
-     * IP address resolved using TRR.
-     */
-    bool resolvedByTRR();
 };
--- a/netwerk/base/nsSocketTransport2.cpp
+++ b/netwerk/base/nsSocketTransport2.cpp
@@ -703,17 +703,16 @@ nsSocketTransport::nsSocketTransport()
       mResetFamilyPreference(false),
       mTlsFlags(0),
       mReuseAddrPort(false),
       mState(STATE_CLOSED),
       mAttached(false),
       mInputClosed(true),
       mOutputClosed(true),
       mResolving(false),
-      mResolvedByTRR(false),
       mDNSLookupStatus(NS_OK),
       mDNSARequestFinished(0),
       mEsniQueried(false),
       mEsniUsed(false),
       mNetAddrIsSet(false),
       mSelfAddrIsSet(false),
       mLock("nsSocketTransport.mLock"),
       mFD(this),
@@ -1799,17 +1798,16 @@ bool nsSocketTransport::RecoverFromError
       // connection entry
       mResetFamilyPreference = true;
       tryAgain = true;
     }
 
     // try next ip address only if past the resolver stage...
     if (mState == STATE_CONNECTING && mDNSRecord) {
       nsresult rv = mDNSRecord->GetNextAddr(SocketPort(), &mNetAddr);
-      mDNSRecord->IsTRR(&mResolvedByTRR);
       if (NS_SUCCEEDED(rv)) {
         SOCKET_LOG(("  trying again with next ip address\n"));
         tryAgain = true;
       } else if (mConnectionFlags & RETRY_WITH_DIFFERENT_IP_FAMILY) {
         SOCKET_LOG(("  failed to connect, trying with opposite ip family\n"));
         // Drop state to closed.  This will trigger new round of DNS
         // resolving bellow.
         mState = STATE_CLOSED;
@@ -2093,17 +2091,16 @@ void nsSocketTransport::OnSocketEvent(ui
         SendStatus(NS_NET_STATUS_RESOLVED_HOST);
       }
 
       SOCKET_LOG(("  MSG_DNS_LOOKUP_COMPLETE\n"));
       mDNSRequest = nullptr;
       mDNSTxtRequest = nullptr;
       if (mDNSRecord) {
         mDNSRecord->GetNextAddr(SocketPort(), &mNetAddr);
-        mDNSRecord->IsTRR(&mResolvedByTRR);
       }
       // status contains DNS lookup status
       if (NS_FAILED(status)) {
         // When using a HTTP proxy, NS_ERROR_UNKNOWN_HOST means the HTTP
         // proxy host is not found, so we fixup the error code.
         // For SOCKS proxies (mProxyTransparent == true), the socket
         // transport resolves the real host here, so there's no fixup
         // (see bug 226943).
@@ -3521,16 +3518,10 @@ nsSocketTransport::GetResetIPFamilyPrefe
 }
 
 NS_IMETHODIMP
 nsSocketTransport::GetEsniUsed(bool *aEsniUsed) {
   *aEsniUsed = mEsniUsed;
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsSocketTransport::ResolvedByTRR(bool *aResolvedByTRR) {
-  *aResolvedByTRR = mResolvedByTRR;
-  return NS_OK;
-}
-
 }  // namespace net
 }  // namespace mozilla
--- a/netwerk/base/nsSocketTransport2.h
+++ b/netwerk/base/nsSocketTransport2.h
@@ -323,17 +323,16 @@ class nsSocketTransport final : public n
   bool mOutputClosed;
 
   // this flag is used to determine if the results of a host lookup arrive
   // recursively or not.  this flag is not protected by any lock.
   bool mResolving;
 
   nsCOMPtr<nsICancelable> mDNSRequest;
   nsCOMPtr<nsIDNSRecord> mDNSRecord;
-  bool mResolvedByTRR;
 
   nsresult mDNSLookupStatus;
   PRIntervalTime mDNSARequestFinished;
   nsCOMPtr<nsICancelable> mDNSTxtRequest;
   nsCString mDNSRecordTxt;
   bool mEsniQueried;
   bool mEsniUsed;
 
--- a/netwerk/dns/TRR.cpp
+++ b/netwerk/dns/TRR.cpp
@@ -270,17 +270,17 @@ nsresult TRR::SendHTTPRequest() {
   if (!internalChannel) {
     return NS_ERROR_UNEXPECTED;
   }
 
   // setting a small stream window means the h2 stack won't pipeline a window
   // update with each HEADERS or reply to a DATA with a WINDOW UPDATE
   rv = internalChannel->SetInitialRwin(127 * 1024);
   NS_ENSURE_SUCCESS(rv, rv);
-  rv = internalChannel->SetIsTRRServiceChannel(true);
+  rv = internalChannel->SetTrr(true);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mAllowRFC1918 = gTRRService->AllowRFC1918();
 
   if (useGet) {
     rv = httpChannel->SetRequestMethod(NS_LITERAL_CSTRING("GET"));
     NS_ENSURE_SUCCESS(rv, rv);
   } else {
--- a/netwerk/dns/nsDNSService2.cpp
+++ b/netwerk/dns/nsDNSService2.cpp
@@ -113,17 +113,16 @@ nsDNSRecord::IsTRR(bool *retval) {
   MutexAutoLock lock(mHostRecord->addr_info_lock);
   if (mHostRecord->addr_info) {
     *retval = mHostRecord->addr_info->IsTRR();
   } else {
     *retval = false;
   }
   return NS_OK;
 }
-
 NS_IMETHODIMP
 nsDNSRecord::GetNextAddr(uint16_t port, NetAddr *addr) {
   if (mDone) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   mHostRecord->addr_info_lock.Lock();
   if (mHostRecord->addr_info) {
--- a/netwerk/protocol/http/ClassifierDummyChannel.cpp
+++ b/netwerk/protocol/http/ClassifierDummyChannel.cpp
@@ -471,29 +471,20 @@ ClassifierDummyChannel::GetBeConservativ
 }
 
 NS_IMETHODIMP
 ClassifierDummyChannel::SetBeConservative(bool aBeConservative) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-ClassifierDummyChannel::GetIsTRRServiceChannel(bool* aTrr) {
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
+ClassifierDummyChannel::GetTrr(bool* aTrr) { return NS_ERROR_NOT_IMPLEMENTED; }
 
 NS_IMETHODIMP
-ClassifierDummyChannel::SetIsTRRServiceChannel(bool aTrr) {
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-ClassifierDummyChannel::GetIsResolvedByTRR(bool* aResolvedByTRR) {
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
+ClassifierDummyChannel::SetTrr(bool aTrr) { return NS_ERROR_NOT_IMPLEMENTED; }
 
 NS_IMETHODIMP
 ClassifierDummyChannel::GetTlsFlags(uint32_t* aTlsFlags) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 ClassifierDummyChannel::SetTlsFlags(uint32_t aTlsFlags) {
--- a/netwerk/protocol/http/Http2Session.cpp
+++ b/netwerk/protocol/http/Http2Session.cpp
@@ -411,17 +411,17 @@ uint32_t Http2Session::RegisterStreamID(
       mLastRequestBytesSentTime = PR_IntervalNow();
     }
   }
 
   if (aNewID & 1) {
     // don't count push streams here
     MOZ_ASSERT(stream->Transaction(), "no transation for the stream!");
     RefPtr<nsHttpConnectionInfo> ci(stream->Transaction()->ConnectionInfo());
-    if (ci && ci->GetIsTrrServiceChannel()) {
+    if (ci && ci->GetTrrUsed()) {
       IncrementTrrCounter();
     }
   }
   return aNewID;
 }
 
 bool Http2Session::AddStream(nsAHttpTransaction *aHttpTransaction,
                              int32_t aPriority, bool aUseTunnel,
--- a/netwerk/protocol/http/Http2Stream.cpp
+++ b/netwerk/protocol/http/Http2Stream.cpp
@@ -491,17 +491,17 @@ nsresult Http2Stream::ParseHttpRequestHe
 
       // There is probably pushed data buffered so trigger a read manually
       // as we can't rely on future network events to do it
       mSession->ConnectPushedStream(this);
       mOpenGenerated = 1;
 
       // if the "mother stream" had TRR, this one is a TRR stream too!
       RefPtr<nsHttpConnectionInfo> ci(Transaction()->ConnectionInfo());
-      if (ci && ci->GetIsTrrServiceChannel()) {
+      if (ci && ci->GetTrrUsed()) {
         mSession->IncrementTrrCounter();
       }
 
       return NS_OK;
     }
   }
   return NS_OK;
 }
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -191,18 +191,17 @@ HttpBaseChannel::HttpBaseChannel()
       mLoadedFromApplicationCache(false),
       mChannelIsForDownload(false),
       mTracingEnabled(true),
       mTimingEnabled(false),
       mReportTiming(true),
       mAllowSpdy(true),
       mAllowAltSvc(true),
       mBeConservative(false),
-      mIsTRRServiceChannel(false),
-      mResolvedByTRR(false),
+      mTRR(false),
       mResponseTimeoutEnabled(true),
       mAllRedirectsSameOrigin(true),
       mAllRedirectsPassTimingAllowCheck(true),
       mResponseCouldBeSynthesized(false),
       mBlockAuthPrompt(false),
       mAllowStaleCacheContent(false),
       mAddedAsNonTailRequest(false),
       mAsyncOpenWaitingForStreamLength(false),
@@ -2697,33 +2696,26 @@ HttpBaseChannel::GetBeConservative(bool*
 
 NS_IMETHODIMP
 HttpBaseChannel::SetBeConservative(bool aBeConservative) {
   mBeConservative = aBeConservative;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-HttpBaseChannel::GetIsTRRServiceChannel(bool* aIsTRRServiceChannel) {
-  NS_ENSURE_ARG_POINTER(aIsTRRServiceChannel);
-
-  *aIsTRRServiceChannel = mIsTRRServiceChannel;
+HttpBaseChannel::GetTrr(bool* aTRR) {
+  NS_ENSURE_ARG_POINTER(aTRR);
+
+  *aTRR = mTRR;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-HttpBaseChannel::SetIsTRRServiceChannel(bool aIsTRRServiceChannel) {
-  mIsTRRServiceChannel = aIsTRRServiceChannel;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-HttpBaseChannel::GetIsResolvedByTRR(bool* aResolvedByTRR) {
-  NS_ENSURE_ARG_POINTER(aResolvedByTRR);
-  *aResolvedByTRR = mResolvedByTRR;
+HttpBaseChannel::SetTrr(bool aTRR) {
+  mTRR = aTRR;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HttpBaseChannel::GetTlsFlags(uint32_t* aTlsFlags) {
   NS_ENSURE_ARG_POINTER(aTlsFlags);
 
   *aTlsFlags = mTlsFlags;
@@ -3580,17 +3572,17 @@ nsresult HttpBaseChannel::SetupReplaceme
     rv = httpInternal->SetThirdPartyFlags(mThirdPartyFlags);
     MOZ_ASSERT(NS_SUCCEEDED(rv));
     rv = httpInternal->SetAllowSpdy(mAllowSpdy);
     MOZ_ASSERT(NS_SUCCEEDED(rv));
     rv = httpInternal->SetAllowAltSvc(mAllowAltSvc);
     MOZ_ASSERT(NS_SUCCEEDED(rv));
     rv = httpInternal->SetBeConservative(mBeConservative);
     MOZ_ASSERT(NS_SUCCEEDED(rv));
-    rv = httpInternal->SetIsTRRServiceChannel(mIsTRRServiceChannel);
+    rv = httpInternal->SetTrr(mTRR);
     MOZ_ASSERT(NS_SUCCEEDED(rv));
     rv = httpInternal->SetTlsFlags(mTlsFlags);
     MOZ_ASSERT(NS_SUCCEEDED(rv));
 
     RefPtr<nsHttpChannel> realChannel;
     CallQueryInterface(newChannel, realChannel.StartAssignment());
     if (realChannel) {
       rv = realChannel->SetTopWindowURI(mTopWindowURI);
--- a/netwerk/protocol/http/HttpBaseChannel.h
+++ b/netwerk/protocol/http/HttpBaseChannel.h
@@ -271,19 +271,18 @@ class HttpBaseChannel : public nsHashPro
   NS_IMETHOD GetOnlyConnect(bool *aOnlyConnect) override;
   NS_IMETHOD SetConnectOnly() override;
   NS_IMETHOD GetAllowSpdy(bool *aAllowSpdy) override;
   NS_IMETHOD SetAllowSpdy(bool aAllowSpdy) override;
   NS_IMETHOD GetAllowAltSvc(bool *aAllowAltSvc) override;
   NS_IMETHOD SetAllowAltSvc(bool aAllowAltSvc) override;
   NS_IMETHOD GetBeConservative(bool *aBeConservative) override;
   NS_IMETHOD SetBeConservative(bool aBeConservative) override;
-  NS_IMETHOD GetIsTRRServiceChannel(bool *aTRR) override;
-  NS_IMETHOD SetIsTRRServiceChannel(bool aTRR) override;
-  NS_IMETHOD GetIsResolvedByTRR(bool *aResolvedByTRR) override;
+  NS_IMETHOD GetTrr(bool *aTRR) override;
+  NS_IMETHOD SetTrr(bool aTRR) override;
   NS_IMETHOD GetTlsFlags(uint32_t *aTlsFlags) override;
   NS_IMETHOD SetTlsFlags(uint32_t aTlsFlags) override;
   NS_IMETHOD GetApiRedirectToURI(nsIURI **aApiRedirectToURI) override;
   virtual MOZ_MUST_USE nsresult AddSecurityMessage(
       const nsAString &aMessageTag, const nsAString &aMessageCategory);
   NS_IMETHOD TakeAllSecurityMessages(
       nsCOMArray<nsISecurityConsoleMessage> &aMessages) override;
   NS_IMETHOD GetResponseTimeoutEnabled(bool *aEnable) override;
@@ -697,22 +696,17 @@ class HttpBaseChannel : public nsHashPro
   uint32_t mTimingEnabled : 1;
   uint32_t mReportTiming : 1;
   uint32_t mAllowSpdy : 1;
   uint32_t mAllowAltSvc : 1;
   // !!! This is also used by the URL classifier to exempt channels from
   // classification. If this is changed or removed, make sure we also update
   // NS_ShouldClassifyChannel accordingly !!!
   uint32_t mBeConservative : 1;
-  // If the current channel is used to as a TRR connection.
-  uint32_t mIsTRRServiceChannel : 1;
-  // If the request was performed to a TRR resolved IP address.
-  // Will be false if loading the resource does not create a connection
-  // (for example when it's loaded from the cache).
-  uint32_t mResolvedByTRR : 1;
+  uint32_t mTRR : 1;
   uint32_t mResponseTimeoutEnabled : 1;
   // A flag that should be false only if a cross-domain redirect occurred
   uint32_t mAllRedirectsSameOrigin : 1;
 
   // Is 1 if no redirects have occured or if all redirects
   // pass the Resource Timing timing-allow-check
   uint32_t mAllRedirectsPassTimingAllowCheck : 1;
 
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -401,17 +401,17 @@ class StartRequestEvent : public NeckoTa
       const ParentLoadInfoForwarderArgs& loadInfoForwarder,
       const bool& aIsFromCache, const bool& aCacheEntryAvailable,
       const uint64_t& aCacheEntryId, const int32_t& aCacheFetchCount,
       const uint32_t& aCacheExpirationTime, const nsCString& aCachedCharset,
       const nsCString& aSecurityInfoSerialization, const NetAddr& aSelfAddr,
       const NetAddr& aPeerAddr, const uint32_t& aCacheKey,
       const nsCString& altDataType, const int64_t& altDataLen,
       const bool& deliveringAltData, const bool& aApplyConversion,
-      const bool& aIsResolvedByTRR, const ResourceTimingStruct& aTiming)
+      const ResourceTimingStruct& aTiming)
       : NeckoTargetChannelEvent<HttpChannelChild>(aChild),
         mChannelStatus(aChannelStatus),
         mResponseHead(aResponseHead),
         mRequestHeaders(aRequestHeaders),
         mUseResponseHead(aUseResponseHead),
         mApplyConversion(aApplyConversion),
         mIsFromCache(aIsFromCache),
         mCacheEntryAvailable(aCacheEntryAvailable),
@@ -422,28 +422,27 @@ class StartRequestEvent : public NeckoTa
         mSecurityInfoSerialization(aSecurityInfoSerialization),
         mSelfAddr(aSelfAddr),
         mPeerAddr(aPeerAddr),
         mCacheKey(aCacheKey),
         mAltDataType(altDataType),
         mAltDataLen(altDataLen),
         mDeliveringAltData(deliveringAltData),
         mLoadInfoForwarder(loadInfoForwarder),
-        mIsResolvedByTRR(aIsResolvedByTRR),
         mTiming(aTiming) {}
 
   void Run() override {
     LOG(("StartRequestEvent [this=%p]\n", mChild));
     mChild->OnStartRequest(
         mChannelStatus, mResponseHead, mUseResponseHead, mRequestHeaders,
         mLoadInfoForwarder, mIsFromCache, mCacheEntryAvailable, mCacheEntryId,
         mCacheFetchCount, mCacheExpirationTime, mCachedCharset,
         mSecurityInfoSerialization, mSelfAddr, mPeerAddr, mCacheKey,
         mAltDataType, mAltDataLen, mDeliveringAltData, mApplyConversion,
-        mIsResolvedByTRR, mTiming);
+        mTiming);
   }
 
  private:
   nsresult mChannelStatus;
   nsHttpResponseHead mResponseHead;
   nsHttpHeaderArray mRequestHeaders;
   bool mUseResponseHead;
   bool mApplyConversion;
@@ -456,33 +455,31 @@ class StartRequestEvent : public NeckoTa
   nsCString mSecurityInfoSerialization;
   NetAddr mSelfAddr;
   NetAddr mPeerAddr;
   uint32_t mCacheKey;
   nsCString mAltDataType;
   int64_t mAltDataLen;
   bool mDeliveringAltData;
   ParentLoadInfoForwarderArgs mLoadInfoForwarder;
-  bool mIsResolvedByTRR;
   ResourceTimingStruct mTiming;
 };
 
 mozilla::ipc::IPCResult HttpChannelChild::RecvOnStartRequest(
     const nsresult& channelStatus, const nsHttpResponseHead& responseHead,
     const bool& useResponseHead, const nsHttpHeaderArray& requestHeaders,
     const ParentLoadInfoForwarderArgs& loadInfoForwarder,
     const bool& isFromCache, const bool& cacheEntryAvailable,
     const uint64_t& cacheEntryId, const int32_t& cacheFetchCount,
     const uint32_t& cacheExpirationTime, const nsCString& cachedCharset,
     const nsCString& securityInfoSerialization, const NetAddr& selfAddr,
     const NetAddr& peerAddr, const int16_t& redirectCount,
     const uint32_t& cacheKey, const nsCString& altDataType,
     const int64_t& altDataLen, const bool& deliveringAltData,
-    const bool& aApplyConversion, const bool& aIsResolvedByTRR,
-    const ResourceTimingStruct& aTiming) {
+    const bool& aApplyConversion, const ResourceTimingStruct& aTiming) {
   AUTO_PROFILER_LABEL("HttpChannelChild::RecvOnStartRequest", NETWORK);
   LOG(("HttpChannelChild::RecvOnStartRequest [this=%p]\n", this));
   // mFlushedForDiversion and mDivertingToParent should NEVER be set at this
   // stage, as they are set in the listener's OnStartRequest.
   MOZ_RELEASE_ASSERT(
       !mFlushedForDiversion,
       "mFlushedForDiversion should be unset before OnStartRequest!");
   MOZ_RELEASE_ASSERT(
@@ -491,18 +488,17 @@ mozilla::ipc::IPCResult HttpChannelChild
 
   mRedirectCount = redirectCount;
 
   mEventQ->RunOrEnqueue(new StartRequestEvent(
       this, channelStatus, responseHead, useResponseHead, requestHeaders,
       loadInfoForwarder, isFromCache, cacheEntryAvailable, cacheEntryId,
       cacheFetchCount, cacheExpirationTime, cachedCharset,
       securityInfoSerialization, selfAddr, peerAddr, cacheKey, altDataType,
-      altDataLen, deliveringAltData, aApplyConversion, aIsResolvedByTRR,
-      aTiming));
+      altDataLen, deliveringAltData, aApplyConversion, aTiming));
 
   {
     // Child's mEventQ is to control the execution order of the IPC messages
     // from both main thread IPDL and PBackground IPDL.
     // To guarantee the ordering, PBackground IPC messages that are sent after
     // OnStartRequest will be throttled until OnStartRequest hits the Child's
     // mEventQ.
     MutexAutoLock lock(mBgChildMutex);
@@ -526,17 +522,17 @@ void HttpChannelChild::OnStartRequest(
     const ParentLoadInfoForwarderArgs& loadInfoForwarder,
     const bool& isFromCache, const bool& cacheEntryAvailable,
     const uint64_t& cacheEntryId, const int32_t& cacheFetchCount,
     const uint32_t& cacheExpirationTime, const nsCString& cachedCharset,
     const nsCString& securityInfoSerialization, const NetAddr& selfAddr,
     const NetAddr& peerAddr, const uint32_t& cacheKey,
     const nsCString& altDataType, const int64_t& altDataLen,
     const bool& deliveringAltData, const bool& aApplyConversion,
-    const bool& aIsResolvedByTRR, const ResourceTimingStruct& aTiming) {
+    const ResourceTimingStruct& aTiming) {
   LOG(("HttpChannelChild::OnStartRequest [this=%p]\n", this));
 
   // mFlushedForDiversion and mDivertingToParent should NEVER be set at this
   // stage, as they are set in the listener's OnStartRequest.
   MOZ_RELEASE_ASSERT(
       !mFlushedForDiversion,
       "mFlushedForDiversion should be unset before OnStartRequest!");
   MOZ_RELEASE_ASSERT(
@@ -579,17 +575,16 @@ void HttpChannelChild::OnStartRequest(
   mCacheExpirationTime = cacheExpirationTime;
   mCachedCharset = cachedCharset;
   mSelfAddr = selfAddr;
   mPeerAddr = peerAddr;
 
   mAvailableCachedAltDataType = altDataType;
   mDeliveringAltData = deliveringAltData;
   mAltDataLength = altDataLen;
-  mResolvedByTRR = aIsResolvedByTRR;
 
   SetApplyConversion(aApplyConversion);
 
   mAfterOnStartRequestBegun = true;
 
   AutoEventEnqueuer ensureSerialDispatch(mEventQ);
 
   mCacheKey = cacheKey;
--- a/netwerk/protocol/http/HttpChannelChild.h
+++ b/netwerk/protocol/http/HttpChannelChild.h
@@ -140,17 +140,17 @@ class HttpChannelChild final : public PH
       const ParentLoadInfoForwarderArgs& loadInfoForwarder,
       const bool& isFromCache, const bool& cacheEntryAvailable,
       const uint64_t& cacheEntryId, const int32_t& cacheFetchCount,
       const uint32_t& cacheExpirationTime, const nsCString& cachedCharset,
       const nsCString& securityInfoSerialization, const NetAddr& selfAddr,
       const NetAddr& peerAddr, const int16_t& redirectCount,
       const uint32_t& cacheKey, const nsCString& altDataType,
       const int64_t& altDataLen, const bool& deliveringAltData,
-      const bool& aApplyConversion, const bool& aIsResolvedByTRR,
+      const bool& aApplyConversion,
       const ResourceTimingStruct& aTiming) override;
   mozilla::ipc::IPCResult RecvFailedAsyncOpen(const nsresult& status) override;
   mozilla::ipc::IPCResult RecvRedirect1Begin(
       const uint32_t& registrarId, const URIParams& newURI,
       const uint32_t& newLoadFlags, const uint32_t& redirectFlags,
       const ParentLoadInfoForwarderArgs& loadInfoForwarder,
       const nsHttpResponseHead& responseHead,
       const nsCString& securityInfoSerialization, const uint64_t& channelId,
@@ -465,17 +465,17 @@ class HttpChannelChild final : public PH
       const ParentLoadInfoForwarderArgs& loadInfoForwarder,
       const bool& isFromCache, const bool& cacheEntryAvailable,
       const uint64_t& cacheEntryId, const int32_t& cacheFetchCount,
       const uint32_t& cacheExpirationTime, const nsCString& cachedCharset,
       const nsCString& securityInfoSerialization, const NetAddr& selfAddr,
       const NetAddr& peerAddr, const uint32_t& cacheKey,
       const nsCString& altDataType, const int64_t& altDataLen,
       const bool& deliveringAltData, const bool& aApplyConversion,
-      const bool& aIsResolvedByTRR, const ResourceTimingStruct& aTiming);
+      const ResourceTimingStruct& aTiming);
   void MaybeDivertOnData(const nsCString& data, const uint64_t& offset,
                          const uint32_t& count);
   void OnTransportAndData(const nsresult& channelStatus, const nsresult& status,
                           const uint64_t& offset, const uint32_t& count,
                           const nsCString& data);
   void OnStopRequest(const nsresult& channelStatus,
                      const ResourceTimingStruct& timing,
                      const nsHttpHeaderArray& aResponseTrailers);
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -1456,29 +1456,26 @@ HttpChannelParent::OnStartRequest(nsIReq
     cleanedUpRequestHeaders = requestHead->Headers();
     cleanedUpRequestHeaders.ClearHeader(nsHttp::Cookie);
     cleanedUpRequest = true;
   }
 
   ResourceTimingStruct timing;
   GetTimingAttributes(mChannel, timing);
 
-  bool isResolvedByTRR = false;
-  chan->GetIsResolvedByTRR(&isResolvedByTRR);
-
   rv = NS_OK;
   if (mIPCClosed ||
       !SendOnStartRequest(
           channelStatus, *responseHead, useResponseHead,
           cleanedUpRequest ? cleanedUpRequestHeaders : requestHead->Headers(),
           loadInfoForwarderArg, isFromCache, mCacheEntry ? true : false,
           cacheEntryId, fetchCount, expirationTime, cachedCharset,
           secInfoSerialization, chan->GetSelfAddr(), chan->GetPeerAddr(),
           redirectCount, cacheKey, altDataType, altDataLen, deliveringAltData,
-          applyConversion, isResolvedByTRR, timing)) {
+          applyConversion, timing)) {
     rv = NS_ERROR_UNEXPECTED;
   }
   requestHead->Exit();
 
   // OnStartRequest is sent to content process successfully.
   // Notify PHttpBackgroundChannelChild that all following IPC mesasges
   // should be run after OnStartRequest is handled.
   if (NS_SUCCEEDED(rv)) {
--- a/netwerk/protocol/http/PHttpChannel.ipdl
+++ b/netwerk/protocol/http/PHttpChannel.ipdl
@@ -121,17 +121,16 @@ child:
                        NetAddr             selfAddr,
                        NetAddr             peerAddr,
                        int16_t             redirectCount,
                        uint32_t            cacheKey,
                        nsCString           altDataType,
                        int64_t             altDataLength,
                        bool                deliveringAltData,
                        bool                applyConversion,
-                       bool                isResolvedByTRR,
                        ResourceTimingStruct timing);
 
   // Used to cancel child channel if we hit errors during creating and
   // AsyncOpen of nsHttpChannel on the parent.
   async FailedAsyncOpen(nsresult status);
 
   // Called to initiate content channel redirect, starts talking to sinks
   // on the content process and reports result via Redirect2Verify above
--- a/netwerk/protocol/http/TunnelUtils.cpp
+++ b/netwerk/protocol/http/TunnelUtils.cpp
@@ -1822,24 +1822,16 @@ SocketTransportShim::GetFirstRetryError(
 NS_IMETHODIMP
 SocketTransportShim::GetEsniUsed(bool *aEsniUsed) {
   if (mIsWebsocket) {
     LOG3(("WARNING: SocketTransportShim::GetEsniUsed %p", this));
   }
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-NS_IMETHODIMP
-SocketTransportShim::ResolvedByTRR(bool *aResolvedByTRR) {
-  if (mIsWebsocket) {
-    LOG3(("WARNING: SocketTransportShim::IsTRR %p", this));
-  }
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
 #define FWD_TS_PTR(fx, ts) \
   NS_IMETHODIMP            \
   SocketTransportShim::fx(ts *arg) { return mWrapped->fx(arg); }
 
 #define FWD_TS_ADDREF(fx, ts) \
   NS_IMETHODIMP               \
   SocketTransportShim::fx(ts **arg) { return mWrapped->fx(arg); }
 
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -612,32 +612,32 @@ nsresult nsHttpChannel::ContinueOnBefore
       // though, in case we end up having to fallback to http/1.1 (where
       // we absolutely do want to disable keepalive).
       mCaps |= NS_HTTP_ALLOW_SPDY_WITHOUT_KEEPALIVE;
     } else {
       mCaps |= NS_HTTP_DISALLOW_SPDY;
     }
   }
 
-  if (mIsTRRServiceChannel) {
+  if (mTRR) {
     mCaps |= NS_HTTP_LARGE_KEEPALIVE | NS_HTTP_DISABLE_TRR;
   }
 
   if (mLoadFlags & LOAD_DISABLE_TRR) {
     mCaps |= NS_HTTP_DISABLE_TRR;
   }
 
   // Finalize ConnectionInfo flags before SpeculativeConnect
   mConnectionInfo->SetAnonymous((mLoadFlags & LOAD_ANONYMOUS) != 0);
   mConnectionInfo->SetPrivate(mPrivateBrowsing);
   mConnectionInfo->SetNoSpdy(mCaps & NS_HTTP_DISALLOW_SPDY);
   mConnectionInfo->SetBeConservative((mCaps & NS_HTTP_BE_CONSERVATIVE) ||
                                      mBeConservative);
   mConnectionInfo->SetTlsFlags(mTlsFlags);
-  mConnectionInfo->SetIsTrrServiceChannel(mIsTRRServiceChannel);
+  mConnectionInfo->SetTrrUsed(mTRR);
   mConnectionInfo->SetTrrDisabled(mCaps & NS_HTTP_DISABLE_TRR);
   mConnectionInfo->SetIPv4Disabled(mCaps & NS_HTTP_DISABLE_IPV4);
   mConnectionInfo->SetIPv6Disabled(mCaps & NS_HTTP_DISABLE_IPV6);
 
   // notify "http-on-before-connect" observers
   gHttpHandler->OnBeforeConnect(this);
 
   // Check if request was cancelled during http-on-before-connect.
@@ -4032,17 +4032,17 @@ nsresult nsHttpChannel::OpenCacheEntryIn
   // Only for backward compatibility with the old cache back end.
   // When removed, remove the flags and related code snippets.
   if (mLoadFlags & LOAD_BYPASS_LOCAL_CACHE_IF_BUSY)
     cacheEntryOpenFlags |= nsICacheStorage::OPEN_BYPASS_IF_BUSY;
 
   if (mPostID) {
     extension.Append(nsPrintfCString("%d", mPostID));
   }
-  if (mIsTRRServiceChannel) {
+  if (mTRR) {
     extension.Append("TRR");
   }
 
   if (IsThirdPartyTrackingResource() &&
       !AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(this, mURI,
                                                                nullptr)) {
     nsCOMPtr<nsIURI> topWindowURI;
     rv = GetTopWindowURI(getter_AddRefs(topWindowURI));
@@ -8424,25 +8424,21 @@ nsHttpChannel::OnTransportStatus(nsITran
   MOZ_ASSERT(NS_IsMainThread(), "Should be on main thread only");
   // cache the progress sink so we don't have to query for it each time.
   if (!mProgressSink) GetCallback(mProgressSink);
 
   if (status == NS_NET_STATUS_CONNECTED_TO ||
       status == NS_NET_STATUS_WAITING_FOR) {
     if (mTransaction) {
       mTransaction->GetNetworkAddresses(mSelfAddr, mPeerAddr);
-      mResolvedByTRR = mTransaction->ResolvedByTRR();
     } else {
       nsCOMPtr<nsISocketTransport> socketTransport = do_QueryInterface(trans);
       if (socketTransport) {
         socketTransport->GetSelfAddr(&mSelfAddr);
         socketTransport->GetPeerAddr(&mPeerAddr);
-        bool isTrr = false;
-        socketTransport->ResolvedByTRR(&isTrr);
-        mResolvedByTRR = isTrr;
       }
     }
   }
 
   // block socket status event after Cancel or OnStopRequest has been called.
   if (mProgressSink && NS_SUCCEEDED(mStatus) && mIsPending) {
     LOG(("sending progress%s notification [this=%p status=%" PRIx32
          " progress=%" PRId64 "/%" PRId64 "]\n",
--- a/netwerk/protocol/http/nsHttpConnection.cpp
+++ b/netwerk/protocol/http/nsHttpConnection.cpp
@@ -134,17 +134,17 @@ nsHttpConnection::~nsHttpConnection() {
     if (mTransaction) {
       ci = mTransaction->ConnectionInfo();
     }
     if (!ci) {
       ci = mConnInfo;
     }
 
     MOZ_ASSERT(ci);
-    if (ci->GetIsTrrServiceChannel()) {
+    if (ci->GetTrrUsed()) {
       Telemetry::Accumulate(Telemetry::DNS_TRR_REQUEST_PER_CONN,
                             mHttp1xTransactionCount);
     }
   }
 
   if (mTotalBytesRead) {
     uint32_t totalKBRead = static_cast<uint32_t>(mTotalBytesRead >> 10);
     LOG(("nsHttpConnection %p read %dkb on connection spdy=%d\n", this,
--- a/netwerk/protocol/http/nsHttpConnectionInfo.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionInfo.cpp
@@ -76,17 +76,17 @@ void nsHttpConnectionInfo::Init(const ns
 
   mUsername = username;
   mProxyInfo = proxyInfo;
   mEndToEndSSL = e2eSSL;
   mUsingConnect = false;
   mNPNToken = npnToken;
   mOriginAttributes = originAttributes;
   mTlsFlags = 0x0;
-  mIsTrrServiceChannel = false;
+  mTrrUsed = false;
   mTrrDisabled = false;
   mIPv4Disabled = false;
   mIPv6Disabled = false;
 
   mUsingHttpsProxy = (proxyInfo && proxyInfo->IsHTTPS());
   mUsingHttpProxy = mUsingHttpsProxy || (proxyInfo && proxyInfo->IsHTTP());
 
   if (mUsingHttpProxy) {
@@ -245,17 +245,17 @@ already_AddRefed<nsHttpConnectionInfo> n
 
   // Make sure the anonymous, insecure-scheme, and private flags are transferred
   clone->SetAnonymous(GetAnonymous());
   clone->SetPrivate(GetPrivate());
   clone->SetInsecureScheme(GetInsecureScheme());
   clone->SetNoSpdy(GetNoSpdy());
   clone->SetBeConservative(GetBeConservative());
   clone->SetTlsFlags(GetTlsFlags());
-  clone->SetIsTrrServiceChannel(GetIsTrrServiceChannel());
+  clone->SetTrrUsed(GetTrrUsed());
   clone->SetTrrDisabled(GetTrrDisabled());
   clone->SetIPv4Disabled(GetIPv4Disabled());
   clone->SetIPv6Disabled(GetIPv6Disabled());
   MOZ_ASSERT(clone->Equals(this));
 
   return clone.forget();
 }
 
@@ -271,17 +271,17 @@ void nsHttpConnectionInfo::CloneAsDirect
                                mProxyInfo, mOriginAttributes, mEndToEndSSL);
   // Make sure the anonymous, insecure-scheme, and private flags are transferred
   clone->SetAnonymous(GetAnonymous());
   clone->SetPrivate(GetPrivate());
   clone->SetInsecureScheme(GetInsecureScheme());
   clone->SetNoSpdy(GetNoSpdy());
   clone->SetBeConservative(GetBeConservative());
   clone->SetTlsFlags(GetTlsFlags());
-  clone->SetIsTrrServiceChannel(GetIsTrrServiceChannel());
+  clone->SetTrrUsed(GetTrrUsed());
   clone->SetTrrDisabled(GetTrrDisabled());
   clone->SetIPv4Disabled(GetIPv4Disabled());
   clone->SetIPv6Disabled(GetIPv6Disabled());
 
   clone.forget(outCI);
 }
 
 nsresult nsHttpConnectionInfo::CreateWildCard(nsHttpConnectionInfo **outParam) {
--- a/netwerk/protocol/http/nsHttpConnectionInfo.h
+++ b/netwerk/protocol/http/nsHttpConnectionInfo.h
@@ -120,22 +120,19 @@ class nsHttpConnectionInfo final : publi
   void SetBeConservative(bool aBeConservative) {
     mHashKey.SetCharAt(aBeConservative ? 'C' : '.', 6);
   }
   bool GetBeConservative() const { return mHashKey.CharAt(6) == 'C'; }
 
   void SetTlsFlags(uint32_t aTlsFlags);
   uint32_t GetTlsFlags() const { return mTlsFlags; }
 
-  // IsTrrServiceChannel means that this connection is used to send TRR requests
-  // over
-  void SetIsTrrServiceChannel(bool aIsTRRChannel) {
-    mIsTrrServiceChannel = aIsTRRChannel;
-  }
-  bool GetIsTrrServiceChannel() const { return mIsTrrServiceChannel; }
+  // TrrUsed means that this connection is used to send TRR requests over
+  void SetTrrUsed(bool aUsed) { mTrrUsed = aUsed; }
+  bool GetTrrUsed() const { return mTrrUsed; }
 
   // SetTrrDisabled means don't use TRR to resolve host names for this
   // connection
   void SetTrrDisabled(bool aNoTrr);
   bool GetTrrDisabled() const { return mTrrDisabled; }
 
   void SetIPv4Disabled(bool aNoIPv4);
   bool GetIPv4Disabled() const { return mIPv4Disabled; }
@@ -193,17 +190,17 @@ class nsHttpConnectionInfo final : publi
   bool mUsingHttpProxy;
   bool mUsingHttpsProxy;
   bool mEndToEndSSL;
   bool mUsingConnect;  // if will use CONNECT with http proxy
   nsCString mNPNToken;
   OriginAttributes mOriginAttributes;
 
   uint32_t mTlsFlags;
-  uint16_t mIsTrrServiceChannel : 1;
+  uint16_t mTrrUsed : 1;
   uint16_t mTrrDisabled : 1;
   uint16_t mIPv4Disabled : 1;
   uint16_t mIPv6Disabled : 1;
 
   bool mLessThanTls13;  // This will be set to true if we negotiate less than
                         // tls1.3. If the tls version is till not know or it
                         // is 1.3 or greater the value will be false.
 
--- a/netwerk/protocol/http/nsHttpTransaction.cpp
+++ b/netwerk/protocol/http/nsHttpTransaction.cpp
@@ -138,17 +138,16 @@ nsHttpTransaction::nsHttpTransaction()
       mResponseHeadTaken(false),
       mForTakeResponseTrailers(nullptr),
       mResponseTrailersTaken(false),
       mTopLevelOuterContentWindowId(0),
       mSubmittedRatePacing(false),
       mPassedRatePacing(false),
       mSynchronousRatePaceRequest(false),
       mClassOfService(0),
-      mResolvedByTRR(false),
       m0RTTInProgress(false),
       mDoNotTryEarlyData(false),
       mEarlyDataDisposition(EARLY_NONE),
       mFastOpenStatus(TFO_NOT_TRIED),
       mTrafficCategory(HttpTrafficCategory::eInvalid) {
   this->mSelfAddr.inet = {};
   this->mPeerAddr.inet = {};
   LOG(("Creating nsHttpTransaction @%p\n", this));
@@ -587,17 +586,16 @@ void nsHttpTransaction::OnTransportStatu
   if (status == NS_NET_STATUS_CONNECTED_TO ||
       status == NS_NET_STATUS_WAITING_FOR) {
     nsISocketTransport *socketTransport =
         mConnection ? mConnection->Transport() : nullptr;
     if (socketTransport) {
       MutexAutoLock lock(mLock);
       socketTransport->GetSelfAddr(&mSelfAddr);
       socketTransport->GetPeerAddr(&mPeerAddr);
-      socketTransport->ResolvedByTRR(&mResolvedByTRR);
     }
   }
 
   // If the timing is enabled, and we are not using a persistent connection
   // then the requestStart timestamp will be null, so we mark the timestamps
   // for domainLookupStart/End and connectStart/End
   // If we are using a persistent connection they will remain null,
   // and the correct value will be returned in Performance.
--- a/netwerk/protocol/http/nsHttpTransaction.h
+++ b/netwerk/protocol/http/nsHttpTransaction.h
@@ -459,22 +459,20 @@ class nsHttpTransaction final : public n
     mTransactionObserver = arg;
   }
 
  private:
   RefPtr<TransactionObserver> mTransactionObserver;
 
  public:
   void GetNetworkAddresses(NetAddr &self, NetAddr &peer);
-  bool ResolvedByTRR() { return mResolvedByTRR; }
 
  private:
   NetAddr mSelfAddr;
   NetAddr mPeerAddr;
-  bool mResolvedByTRR;
 
   bool m0RTTInProgress;
   bool mDoNotTryEarlyData;
   enum {
     EARLY_NONE,
     EARLY_SENT,
     EARLY_ACCEPTED,
     EARLY_425
--- a/netwerk/protocol/http/nsIHttpChannelInternal.idl
+++ b/netwerk/protocol/http/nsIHttpChannelInternal.idl
@@ -238,24 +238,17 @@ interface nsIHttpChannelInternal : nsISu
      * default is false.
      */
     [must_use] attribute boolean beConservative;
 
     /**
      * True if channel is used by the internal trusted recursive resolver
      * This flag places data for the request in a cache segment specific to TRR
      */
-    [noscript, must_use] attribute boolean isTRRServiceChannel;
-
-    /**
-     * If the channel's remote IP was resolved using TRR.
-     * Is false for resources loaded from the cache or resources that have an
-     * IP literal host.
-     */
-    [noscript, must_use] readonly attribute boolean isResolvedByTRR;
+    [noscript, must_use] attribute boolean trr;
 
     /**
      * An opaque flags for non-standard behavior of the TLS system.
      * It is unlikely this will need to be set outside of telemetry studies
      * relating to the TLS implementation.
      */
     [must_use] attribute unsigned long tlsFlags;