Bug 1139831 - end timestamps are before start timestamps. r=baku

This commit is contained in:
Valentin Gosu 2015-04-16 03:53:44 +03:00
parent ecc5ad311e
commit 46ec35820e

View File

@ -261,7 +261,9 @@ nsPerformanceTiming::DomainLookupEndHighRes()
if (!nsContentUtils::IsPerformanceTimingEnabled() || !IsInitialized()) {
return mZeroTime;
}
return TimeStampToDOMHighResOrFetchStart(mDomainLookupEnd);
// Bug 1155008 - nsHttpTransaction is racy. Return DomainLookupStart when null
return mDomainLookupEnd.IsNull() ? DomainLookupStartHighRes()
: TimeStampToDOMHighRes(mDomainLookupEnd);
}
DOMTimeMilliSec
@ -292,7 +294,8 @@ nsPerformanceTiming::ConnectEndHighRes()
if (!nsContentUtils::IsPerformanceTimingEnabled() || !IsInitialized()) {
return mZeroTime;
}
return mConnectEnd.IsNull() ? DomainLookupEndHighRes()
// Bug 1155008 - nsHttpTransaction is racy. Return ConnectStart when null
return mConnectEnd.IsNull() ? ConnectStartHighRes()
: TimeStampToDOMHighRes(mConnectEnd);
}
@ -346,7 +349,9 @@ nsPerformanceTiming::ResponseEndHighRes()
(!mCacheReadEnd.IsNull() && mCacheReadEnd < mResponseEnd)) {
mResponseEnd = mCacheReadEnd;
}
return TimeStampToDOMHighResOrFetchStart(mResponseEnd);
// Bug 1155008 - nsHttpTransaction is racy. Return ResponseStart when null
return mResponseEnd.IsNull() ? ResponseStartHighRes()
: TimeStampToDOMHighRes(mResponseEnd);
}
DOMTimeMilliSec