Bug 1331324 - Prevent network load time of custom conditional request from being reported. r=michal
authorJunior Hsu <juhsu@mozilla.com>
Wed, 18 Jan 2017 19:22:00 +0800
changeset 377567 ee9b37dd70f59232bcb415ebedb724687801b61e
parent 377566 19507933747f4c345866d53e57dc8ff63f353e11
child 377568 d21bd74f1a20d20afcefb23be322c7f20763e1a8
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmichal
bugs1331324
milestone53.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 1331324 - Prevent network load time of custom conditional request from being reported. r=michal
netwerk/protocol/http/nsHttpChannel.cpp
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -6716,16 +6716,17 @@ nsHttpChannel::OnStopRequest(nsIRequest 
 
         // If we are using the transaction to serve content, we also save the
         // time since async open in the cache entry so we can compare telemetry
         // between cache and net response.
         // Do not store the time of conditional requests because even if we
         // fetch the data from the server, the time includes loading of the old
         // cache entry which would skew the network load time.
         if (request == mTransactionPump && mCacheEntry && !mDidReval &&
+            !mCustomConditionalRequest &&
             !mAsyncOpenTime.IsNull() && !mOnStartRequestTimestamp.IsNull()) {
             nsAutoCString onStartTime;
             onStartTime.AppendInt( (uint64_t) (mOnStartRequestTimestamp - mAsyncOpenTime).ToMilliseconds());
             mCacheEntry->SetMetaDataElement("net-response-time-onstart", onStartTime.get());
 
             nsAutoCString responseTime;
             responseTime.AppendInt( (uint64_t) (TimeStamp::Now() - mAsyncOpenTime).ToMilliseconds());
             mCacheEntry->SetMetaDataElement("net-response-time-onstop", responseTime.get());