Bug 1321878 P1 Don't exclude child process and IPC transit time from Performance API network timings. r=mayhemer
authorBen Kelly <ben@wanderview.com>
Thu, 08 Dec 2016 14:56:00 +0100
changeset 469646 b3f45eae647ff9caf40937a8d6dbe0f465e14c42
parent 469645 8a44f5ca07bb359d6b38ef0f355b2dd148298f2e
child 469647 a3da42e997403cfd7dc34577b4adccbdf07b7530
push id43793
push userdmitchell@mozilla.com
push dateThu, 02 Feb 2017 14:41:57 +0000
reviewersmayhemer
bugs1321878
milestone54.0a1
Bug 1321878 P1 Don't exclude child process and IPC transit time from Performance API network timings. r=mayhemer MozReview-Commit-ID: 4JVFq40YvvF
netwerk/protocol/http/HttpChannelChild.cpp
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -899,17 +899,24 @@ HttpChannelChild::OnStopRequest(const ns
 
   mTransactionTimings.domainLookupStart = timing.domainLookupStart;
   mTransactionTimings.domainLookupEnd = timing.domainLookupEnd;
   mTransactionTimings.connectStart = timing.connectStart;
   mTransactionTimings.connectEnd = timing.connectEnd;
   mTransactionTimings.requestStart = timing.requestStart;
   mTransactionTimings.responseStart = timing.responseStart;
   mTransactionTimings.responseEnd = timing.responseEnd;
-  mAsyncOpenTime = timing.fetchStart;
+
+  // Do not overwrite or adjust the original mAsyncOpenTime.  We must use the
+  // original child process time in order to account for child side work and IPC
+  // transit overhead.  This depends on TimeStamp being equivalent across
+  // processes.  We work hard to ensure this on modern hardware, but there could
+  // be some variance on older devices.
+  MOZ_DIAGNOSTIC_ASSERT(mAsyncOpenTime <= timing.fetchStart);
+
   mRedirectStartTimeStamp = timing.redirectStart;
   mRedirectEndTimeStamp = timing.redirectEnd;
   mTransferSize = timing.transferSize;
   mEncodedBodySize = timing.encodedBodySize;
   mProtocolVersion = timing.protocolVersion;
 
   mCacheReadStart = timing.cacheReadStart;
   mCacheReadEnd = timing.cacheReadEnd;