Bug 919391 - Incorrect Navigation Timing API: performance.timing.responseStart - performance.timing.requestStart < 0 r=baku
authorValentin Gosu <valentin.gosu@gmail.com>
Wed, 23 Aug 2017 16:50:18 +0200
changeset 376334 4a471c993ab69ec865e40ab9a94342761d9ef0a5
parent 376333 d080b90698bc6d062f46364a6ee666c4874eaef5
child 376335 109e89a7d561d58e4b6ee6180391058e4f2447d1
push id94075
push uservalentin.gosu@gmail.com
push dateWed, 23 Aug 2017 14:50:32 +0000
treeherdermozilla-inbound@4a471c993ab6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs919391
milestone57.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 919391 - Incorrect Navigation Timing API: performance.timing.responseStart - performance.timing.requestStart < 0 r=baku MozReview-Commit-ID: 6s5FljTQEAB
dom/performance/PerformanceTiming.cpp
--- a/dom/performance/PerformanceTiming.cpp
+++ b/dom/performance/PerformanceTiming.cpp
@@ -381,16 +381,21 @@ PerformanceTiming::ResponseStartHighRes(
   if (!nsContentUtils::IsPerformanceTimingEnabled() || !IsInitialized() ||
       nsContentUtils::ShouldResistFingerprinting()) {
     return mZeroTime;
   }
   if (mResponseStart.IsNull() ||
      (!mCacheReadStart.IsNull() && mCacheReadStart < mResponseStart)) {
     mResponseStart = mCacheReadStart;
   }
+
+  if (mResponseStart.IsNull() ||
+      (!mRequestStart.IsNull() && mResponseStart < mRequestStart)) {
+    mResponseStart = mRequestStart;
+  }
   return TimeStampToDOMHighResOrFetchStart(mResponseStart);
 }
 
 DOMTimeMilliSec
 PerformanceTiming::ResponseStart()
 {
   return static_cast<int64_t>(ResponseStartHighRes());
 }