Bug 1525640 - Rename nsIHttpChannelInternal.trr to .isHttpServiceChannel to avoid confusion r=dragana
☠☠ backed out by d9ee5458ce46 ☠ ☠
authorValentin Gosu <valentin.gosu@gmail.com>
Fri, 12 Apr 2019 13:54:29 +0000
changeset 469284 e71641f0465b5b0dd7ce7c67f76a84ee085b61cf
parent 469283 e3539a40afdf5a4a7848edb5d01ffd253966ba75
child 469285 efdd32c00dc61f9d8b377a78b9955b2d842f28fd
push id35861
push userbtara@mozilla.com
push dateFri, 12 Apr 2019 21:56:33 +0000
treeherdermozilla-central@db6f9582aaa8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdragana
bugs1525640
milestone68.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 1525640 - Rename nsIHttpChannelInternal.trr to .isHttpServiceChannel to avoid confusion r=dragana Differential Revision: https://phabricator.services.mozilla.com/D26883
netwerk/dns/TRR.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/nsHttpChannel.cpp
netwerk/protocol/http/nsHttpConnection.cpp
netwerk/protocol/http/nsHttpConnectionInfo.cpp
netwerk/protocol/http/nsHttpConnectionInfo.h
netwerk/protocol/http/nsIHttpChannelInternal.idl
--- 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->SetTrr(true);
+  rv = internalChannel->SetIsTRRServiceChannel(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/protocol/http/ClassifierDummyChannel.cpp
+++ b/netwerk/protocol/http/ClassifierDummyChannel.cpp
@@ -471,20 +471,24 @@ ClassifierDummyChannel::GetBeConservativ
 }
 
 NS_IMETHODIMP
 ClassifierDummyChannel::SetBeConservative(bool aBeConservative) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-ClassifierDummyChannel::GetTrr(bool* aTrr) { return NS_ERROR_NOT_IMPLEMENTED; }
+ClassifierDummyChannel::GetIsTRRServiceChannel(bool* aTrr) {
+  return NS_ERROR_NOT_IMPLEMENTED;
+}
 
 NS_IMETHODIMP
-ClassifierDummyChannel::SetTrr(bool aTrr) { return NS_ERROR_NOT_IMPLEMENTED; }
+ClassifierDummyChannel::SetIsTRRServiceChannel(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->GetTrrUsed()) {
+    if (ci && ci->GetIsTrrServiceChannel()) {
       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->GetTrrUsed()) {
+      if (ci && ci->GetIsTrrServiceChannel()) {
         mSession->IncrementTrrCounter();
       }
 
       return NS_OK;
     }
   }
   return NS_OK;
 }
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -191,17 +191,17 @@ HttpBaseChannel::HttpBaseChannel()
       mLoadedFromApplicationCache(false),
       mChannelIsForDownload(false),
       mTracingEnabled(true),
       mTimingEnabled(false),
       mReportTiming(true),
       mAllowSpdy(true),
       mAllowAltSvc(true),
       mBeConservative(false),
-      mTRR(false),
+      mIsTRRServiceChannel(false),
       mResponseTimeoutEnabled(true),
       mAllRedirectsSameOrigin(true),
       mAllRedirectsPassTimingAllowCheck(true),
       mResponseCouldBeSynthesized(false),
       mBlockAuthPrompt(false),
       mAllowStaleCacheContent(false),
       mAddedAsNonTailRequest(false),
       mAsyncOpenWaitingForStreamLength(false),
@@ -2696,26 +2696,26 @@ HttpBaseChannel::GetBeConservative(bool*
 
 NS_IMETHODIMP
 HttpBaseChannel::SetBeConservative(bool aBeConservative) {
   mBeConservative = aBeConservative;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-HttpBaseChannel::GetTrr(bool* aTRR) {
-  NS_ENSURE_ARG_POINTER(aTRR);
-
-  *aTRR = mTRR;
+HttpBaseChannel::GetIsTRRServiceChannel(bool* aIsTRRServiceChannel) {
+  NS_ENSURE_ARG_POINTER(aIsTRRServiceChannel);
+
+  *aIsTRRServiceChannel = mIsTRRServiceChannel;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-HttpBaseChannel::SetTrr(bool aTRR) {
-  mTRR = aTRR;
+HttpBaseChannel::SetIsTRRServiceChannel(bool aIsTRRServiceChannel) {
+  mIsTRRServiceChannel = aIsTRRServiceChannel;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HttpBaseChannel::GetTlsFlags(uint32_t* aTlsFlags) {
   NS_ENSURE_ARG_POINTER(aTlsFlags);
 
   *aTlsFlags = mTlsFlags;
@@ -3572,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->SetTrr(mTRR);
+    rv = httpInternal->SetIsTRRServiceChannel(mIsTRRServiceChannel);
     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,18 +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 GetTrr(bool *aTRR) override;
-  NS_IMETHOD SetTrr(bool aTRR) override;
+  NS_IMETHOD GetIsTRRServiceChannel(bool *aTRR) override;
+  NS_IMETHOD SetIsTRRServiceChannel(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;
@@ -696,17 +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;
-  uint32_t mTRR : 1;
+  uint32_t mIsTRRServiceChannel : 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/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 (mTRR) {
+  if (mIsTRRServiceChannel) {
     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->SetTrrUsed(mTRR);
+  mConnectionInfo->SetIsTrrServiceChannel(mIsTRRServiceChannel);
   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 (mTRR) {
+  if (mIsTRRServiceChannel) {
     extension.Append("TRR");
   }
 
   if (IsThirdPartyTrackingResource() &&
       !AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(this, mURI,
                                                                nullptr)) {
     nsCOMPtr<nsIURI> topWindowURI;
     rv = GetTopWindowURI(getter_AddRefs(topWindowURI));
--- 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->GetTrrUsed()) {
+    if (ci->GetIsTrrServiceChannel()) {
       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;
-  mTrrUsed = false;
+  mIsTrrServiceChannel = 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->SetTrrUsed(GetTrrUsed());
+  clone->SetIsTrrServiceChannel(GetIsTrrServiceChannel());
   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->SetTrrUsed(GetTrrUsed());
+  clone->SetIsTrrServiceChannel(GetIsTrrServiceChannel());
   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,19 +120,22 @@ 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; }
 
-  // TrrUsed means that this connection is used to send TRR requests over
-  void SetTrrUsed(bool aUsed) { mTrrUsed = aUsed; }
-  bool GetTrrUsed() const { return mTrrUsed; }
+  // IsTrrServiceChannel means that this connection is used to send TRR requests
+  // over
+  void SetIsTrrServiceChannel(bool aIsTRRChannel) {
+    mIsTrrServiceChannel = aIsTRRChannel;
+  }
+  bool GetIsTrrServiceChannel() const { return mIsTrrServiceChannel; }
 
   // 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; }
@@ -190,17 +193,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 mTrrUsed : 1;
+  uint16_t mIsTrrServiceChannel : 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/nsIHttpChannelInternal.idl
+++ b/netwerk/protocol/http/nsIHttpChannelInternal.idl
@@ -238,17 +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 trr;
+    [noscript, must_use] attribute boolean isTRRServiceChannel;
 
     /**
      * 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;