Backed out changeset 8507a552a358 (bug 1436517) for failing modified xpcshell test netwerk/test/unit/test_header_Server_Timing.js. a=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Tue, 13 Feb 2018 16:53:56 +0200
changeset 454829 7590a5f25ea3eab7a8bf1ed118f394f6a01ea335
parent 454828 18ee6c43696db0470138c203edd519a6cb65b0f5
child 454830 caa3a8b55ccab1b4c30cafaaab23d45b7b3b0da7
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1436517
milestone59.0
backs out8507a552a358bf60a26d9c51be4016ea0eae8dce
Backed out changeset 8507a552a358 (bug 1436517) for failing modified xpcshell test netwerk/test/unit/test_header_Server_Timing.js. a=backout
netwerk/protocol/http/HttpBaseChannel.cpp
netwerk/protocol/http/nsHttpHandler.cpp
netwerk/protocol/http/nsHttpHandler.h
netwerk/test/unit/test_header_Server_Timing.js
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -4485,27 +4485,22 @@ ParseServerTimingHeader(const nsAutoPtr<
   }
 }
 
 NS_IMETHODIMP
 HttpBaseChannel::GetServerTiming(nsIArray **aServerTiming)
 {
   NS_ENSURE_ARG_POINTER(aServerTiming);
 
-  bool isHTTPS = false;
-  if (gHttpHandler->AllowPlaintextServerTiming() ||
-      (NS_SUCCEEDED(mURI->SchemeIs("https", &isHTTPS)) && isHTTPS)) {
-    nsTArray<nsCOMPtr<nsIServerTiming>> data;
-    nsresult rv = NS_OK;
-    nsCOMPtr<nsIMutableArray> array = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    ParseServerTimingHeader(mResponseHead, array);
-    ParseServerTimingHeader(mResponseTrailers, array);
-
-    array.forget(aServerTiming);
-  }
-
+  nsTArray<nsCOMPtr<nsIServerTiming>> data;
+  nsresult rv = NS_OK;
+  nsCOMPtr<nsIMutableArray> array = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  ParseServerTimingHeader(mResponseHead, array);
+  ParseServerTimingHeader(mResponseTrailers, array);
+
+  array.forget(aServerTiming);
   return NS_OK;
 }
 
 } // namespace net
 } // namespace mozilla
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -288,17 +288,16 @@ nsHttpHandler::nsHttpHandler()
     , mUseFastOpen(true)
     , mFastOpenConsecutiveFailureLimit(5)
     , mFastOpenConsecutiveFailureCounter(0)
     , mFastOpenStallsLimit(3)
     , mFastOpenStallsCounter(0)
     , mFastOpenStallsIdleTime(10)
     , mFastOpenStallsTimeout(20)
     , mActiveTabPriority(true)
-    , mAllowPlaintextServerTiming(false)
     , mProcessId(0)
     , mNextChannelId(1)
     , mLastActiveTabLoadOptimizationLock("nsHttpConnectionMgr::LastActiveTabLoadOptimization")
 {
     LOG(("Creating nsHttpHandler [this=%p].\n", this));
 
     mUserAgentOverride.SetIsVoid(true);
 
@@ -465,17 +464,16 @@ nsHttpHandler::Init()
         prefBranch->AddObserver(HTTP_PREF("tcp_keepalive.long_lived_connections"), this, true);
         prefBranch->AddObserver(SAFE_HINT_HEADER_VALUE, this, true);
         prefBranch->AddObserver(SECURITY_PREFIX, this, true);
         prefBranch->AddObserver(TCP_FAST_OPEN_ENABLE, this, true);
         prefBranch->AddObserver(TCP_FAST_OPEN_FAILURE_LIMIT, this, true);
         prefBranch->AddObserver(TCP_FAST_OPEN_STALLS_LIMIT, this, true);
         prefBranch->AddObserver(TCP_FAST_OPEN_STALLS_IDLE, this, true);
         prefBranch->AddObserver(TCP_FAST_OPEN_STALLS_TIMEOUT, this, true);
-        prefBranch->AddObserver(HTTP_PREF("allow-plaintext-server-timing"), this, false);
         PrefsChanged(prefBranch, nullptr);
     }
 
     nsHttpChannelAuthProvider::InitializePrefs();
 
     mMisc.AssignLiteral("rv:" MOZILLA_UAVERSION);
 
     mCompatFirefox.AssignLiteral("Firefox/" MOZILLA_UAVERSION);
@@ -1776,20 +1774,16 @@ nsHttpHandler::PrefsChanged(nsIPrefBranc
             if (ratio > 0 && ratio < 1) {
                 mFocusedWindowTransactionRatio = ratio;
             } else {
                 NS_WARNING("Wrong value for focused_window_transaction_ratio");
             }
         }
     }
 
-    if (PREF_CHANGED(HTTP_PREF("allow-plaintext-server-timing"))) {
-        Unused << prefs->GetBoolPref(HTTP_PREF("allow-plaintext-server-timing"), &mAllowPlaintextServerTiming);
-    }
-
     //
     // INTL options
     //
 
     if (PREF_CHANGED(INTL_ACCEPT_LANGUAGES)) {
         // We don't want to set the new accept languages here since
         // this pref is a complex type and it may be racy with flushing
         // string resources.
--- a/netwerk/protocol/http/nsHttpHandler.h
+++ b/netwerk/protocol/http/nsHttpHandler.h
@@ -143,18 +143,16 @@ public:
     uint32_t       TailBlockingDelayQuantum(bool aAfterDOMContentLoaded) {
       return aAfterDOMContentLoaded ? mTailDelayQuantumAfterDCL : mTailDelayQuantum;
     }
     uint32_t       TailBlockingDelayMax() { return mTailDelayMax; }
     uint32_t       TailBlockingTotalMax() { return mTailTotalMax; }
 
     uint32_t       ThrottlingReadLimit() { return mThrottleVersion == 1 ? 0 : mThrottleReadLimit; }
 
-    bool           AllowPlaintextServerTiming() { return mAllowPlaintextServerTiming; }
-
     // TCP Keepalive configuration values.
 
     // Returns true if TCP keepalive should be enabled for short-lived conns.
     bool TCPKeepaliveEnabledForShortLivedConns() {
       return mTCPKeepaliveShortLivedEnabled;
     }
     // Return time (secs) that a connection is consider short lived (for TCP
     // keepalive purposes). After this time, the connection is long-lived.
@@ -663,18 +661,16 @@ private:
     uint32_t mFastOpenStallsLimit;
     uint32_t mFastOpenStallsCounter;
     uint32_t mFastOpenStallsIdleTime;
     uint32_t mFastOpenStallsTimeout;
 
     // If true, the transactions from active tab will be dispatched first.
     bool mActiveTabPriority;
 
-    bool mAllowPlaintextServerTiming;
-
 private:
     // For Rate Pacing Certain Network Events. Only assign this pointer on
     // socket thread.
     void MakeNewRequestTokenBucket();
     RefPtr<EventTokenBucket> mRequestTokenBucket;
 
 public:
     // Socket thread only
--- a/netwerk/test/unit/test_header_Server_Timing.js
+++ b/netwerk/test/unit/test_header_Server_Timing.js
@@ -49,21 +49,16 @@ function contentHandler(metadata, respon
   response.write(body);
   response.write(createServerTimingHeader(trailerServerTiming));
   response.write("\r\n");
   response.finish();
 }
 
 function run_test()
 {
-  Services.prefs.setBoolPref("network.http.allow-plaintext-server-timing", true);
-  registerCleanupFunction(() => {
-    Services.prefs.clearUserPref("network.http.allow-plaintext-server-timing");
-  });
-
   httpServer = new HttpServer();
   httpServer.registerPathHandler("/content", contentHandler);
   httpServer.start(-1);
 
   do_test_pending();
   make_and_open_channel(URL, readServerContent);
 }