Bug 1506512 - ServerTiming header must be updated onStopRequest as well. r=valentin
authorDragana Damjanovic <dd.mozilla@gmail.com>
Fri, 16 Nov 2018 10:17:15 +0000
changeset 503219 f377e1c9ae609ed3738bca407d5cc0da6d483725
parent 503218 d1cbe1578a464515dadc6e66a107d55b55ab0e2b
child 503220 cf97290aeea1015925955b375b220cb16ee77aa4
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1506512
milestone65.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 1506512 - ServerTiming header must be updated onStopRequest as well. r=valentin Differential Revision: https://phabricator.services.mozilla.com/D12026
dom/performance/PerformanceTiming.cpp
--- a/dom/performance/PerformanceTiming.cpp
+++ b/dom/performance/PerformanceTiming.cpp
@@ -157,18 +157,16 @@ PerformanceTimingData::PerformanceTiming
     aChannel->GetCacheReadEnd(&mCacheReadEnd);
 
     aChannel->GetDispatchFetchEventStart(&mWorkerStart);
     aChannel->GetHandleFetchEventStart(&mWorkerRequestStart);
     // TODO: Track when FetchEvent.respondWith() promise resolves as
     //       ServiceWorker interception responseStart?
     aChannel->GetHandleFetchEventEnd(&mWorkerResponseEnd);
 
-    aChannel->GetNativeServerTiming(mServerTiming);
-
     // The performance timing api essentially requires that the event timestamps
     // have a strict relation with each other. The truth, however, is the
     // browser engages in a number of speculative activities that sometimes mean
     // connections and lookups begin at different times. Workaround that here by
     // clamping these values to what we expect FetchStart to be.  This means the
     // later of AsyncOpen or WorkerStart times.
     if (!mAsyncOpen.IsNull()) {
       // We want to clamp to the expected FetchStart value.  This is later of
@@ -227,16 +225,18 @@ PerformanceTimingData::SetPropertiesFrom
   if (mDecodedBodySize == 0) {
     mDecodedBodySize = mEncodedBodySize;
   }
 
   mTimingAllowed = CheckAllowedOrigin(aHttpChannel, aChannel);
   bool redirectsPassCheck = false;
   aChannel->GetAllRedirectsPassTimingAllowCheck(&redirectsPassCheck);
   mReportCrossOriginRedirect = mTimingAllowed && redirectsPassCheck;
+
+  aChannel->GetNativeServerTiming(mServerTiming);
 }
 
 PerformanceTiming::~PerformanceTiming()
 {
 }
 
 DOMHighResTimeStamp
 PerformanceTimingData::FetchStartHighRes(Performance* aPerformance)