bug 1483311 - add LOAD_DISABLE_TRR as a loadflag r=mcmanus
authorDaniel Stenberg <daniel@haxx.se>
Mon, 20 Aug 2018 22:02:04 +0000
changeset 487647 dbd045e6bb9c86ee75a207e80dd6b9103624e51a
parent 487646 32a3585e5b0b9b1a046b6b16a2b7197903e59e5f
child 487648 a022c40e4d55f303bbaac93b33447faa02e93add
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs1483311
milestone63.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 1483311 - add LOAD_DISABLE_TRR as a loadflag r=mcmanus Disable TRR at will without needing to toggle the pref. MozReview-Commit-ID: 1Ept6kDrjN3 Differential Revision: https://phabricator.services.mozilla.com/D3399
netwerk/base/nsIRequest.idl
netwerk/protocol/http/nsHttpChannel.cpp
--- a/netwerk/base/nsIRequest.idl
+++ b/netwerk/base/nsIRequest.idl
@@ -132,16 +132,22 @@ interface nsIRequest : nsISupports
     const unsigned long LOAD_HTML_OBJECT_DATA = 1 << 1;
 
     /**
      * This flag marks the request as belonging to a document that requires access
      * to the document.cookies API.
      */
     const unsigned long LOAD_DOCUMENT_NEEDS_COOKIE = 1 << 2;
 
+
+    /**
+     * Set this flag to disable TRR for this request.
+     */
+    const unsigned long LOAD_DISABLE_TRR = 1 << 3;
+
     /**************************************************************************
      * The following flags control the flow of data into the cache.
      */
 
     /**
      * This flag prevents caching of any kind.  It does not, however, prevent
      * cached content from being used to satisfy this request.
      */
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -560,16 +560,20 @@ nsHttpChannel::OnBeforeConnect()
     if (mUpgradeProtocolCallback) {
         mCaps |=  NS_HTTP_DISALLOW_SPDY;
     }
 
     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);
 
     // notify "http-on-before-connect" observers