Bug 673226 - Null timestamp usage in telemetry code; r=jduell.mcbugs
authorHonza Bambas <honzab.moz@firemni.cz>
Sun, 21 Aug 2011 09:27:29 +0100
changeset 75617 c3679628bee56a99d714920dd17359bfa747190a
parent 75616 95996d0763a6b739ac9db4e472aa031ce7961f40
child 75618 857f058efa567b1d6464f8541e9e6ecdcd37b935
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersjduell
bugs673226
milestone9.0a1
Bug 673226 - Null timestamp usage in telemetry code; r=jduell.mcbugs
netwerk/base/src/nsLoadGroup.cpp
--- a/netwerk/base/src/nsLoadGroup.cpp
+++ b/netwerk/base/src/nsLoadGroup.cpp
@@ -882,21 +882,16 @@ nsLoadGroup::TelemetryReportChannel(nsIT
                                     bool aDefaultRequest)
 {
     nsresult rv;
     PRBool timingEnabled;
     rv = aTimedChannel->GetTimingEnabled(&timingEnabled);
     if (NS_FAILED(rv) || !timingEnabled)
         return;
 
-    TimeStamp channelCreation;
-    rv = aTimedChannel->GetChannelCreation(&channelCreation);
-    if (NS_FAILED(rv))
-        return;
-
     TimeStamp asyncOpen;
     rv = aTimedChannel->GetAsyncOpen(&asyncOpen);
     // We do not check !asyncOpen.IsNull() bellow, prevent ASSERTIONs this way
     if (NS_FAILED(rv) || asyncOpen.IsNull())
         return;
 
     TimeStamp cacheReadStart;
     rv = aTimedChannel->GetCacheReadStart(&cacheReadStart);
@@ -967,17 +962,17 @@ nsLoadGroup::TelemetryReportChannel(nsIT
         Telemetry::Accumulate(                                                 \
             Telemetry::HTTP_##prefix##_OPEN_TO_FIRST_SENT,                     \
             HISTOGRAM_TIME_DELTA(asyncOpen, requestStart));                    \
                                                                                \
         Telemetry::Accumulate(                                                 \
             Telemetry::HTTP_##prefix##_FIRST_SENT_TO_LAST_RECEIVED,            \
             HISTOGRAM_TIME_DELTA(requestStart, responseEnd));                  \
                                                                                \
-        if (cacheReadStart.IsNull()) {                                         \
+        if (cacheReadStart.IsNull() && !responseStart.IsNull()) {              \
             Telemetry::Accumulate(                                             \
                 Telemetry::HTTP_##prefix##_OPEN_TO_FIRST_RECEIVED,             \
                 HISTOGRAM_TIME_DELTA(asyncOpen, responseStart));               \
         }                                                                      \
     }                                                                          \
                                                                                \
     if (!cacheReadStart.IsNull() && !cacheReadEnd.IsNull()) {                  \
         Telemetry::Accumulate(                                                 \