Bug 1415630 Make PerformanceResourceTiming.fetchStart match the time we dispatch the FetchEvent when SW interception occurs. r=baku
authorBen Kelly <ben@wanderview.com>
Thu, 09 Nov 2017 09:00:43 -0800
changeset 695877 b5969c9b92fb92951471da6402e73e91c0847c94
parent 695876 3ade6d760d37851e0cfcdbc755d98ab21f656983
child 695878 037b63d51202e07b31e62916de7a93dfe7ba19fb
push id88577
push usermozilla@noorenberghe.ca
push dateThu, 09 Nov 2017 23:43:51 +0000
reviewersbaku
bugs1415630
milestone58.0a1
Bug 1415630 Make PerformanceResourceTiming.fetchStart match the time we dispatch the FetchEvent when SW interception occurs. r=baku
dom/performance/PerformanceTiming.cpp
--- a/dom/performance/PerformanceTiming.cpp
+++ b/dom/performance/PerformanceTiming.cpp
@@ -139,18 +139,18 @@ PerformanceTiming::FetchStartHighRes()
   if (!mFetchStart) {
     if (!nsContentUtils::IsPerformanceTimingEnabled() || !IsInitialized() ||
         nsContentUtils::ShouldResistFingerprinting()) {
       return mZeroTime;
     }
     MOZ_ASSERT(!mAsyncOpen.IsNull(), "The fetch start time stamp should always be "
         "valid if the performance timing is enabled");
     if (!mAsyncOpen.IsNull()) {
-      if (!mWorkerStart.IsNull() && mWorkerStart > mAsyncOpen) {
-        mFetchStart = TimeStampToDOMHighRes(mWorkerStart);
+      if (!mWorkerRequestStart.IsNull() && mWorkerRequestStart > mAsyncOpen) {
+        mFetchStart = TimeStampToDOMHighRes(mWorkerRequestStart);
       } else {
         mFetchStart = TimeStampToDOMHighRes(mAsyncOpen);
       }
     }
   }
   return mFetchStart;
 }