DOMTimeMilliSec nsDOMNavigationTiming::TimeStampToDOMOrFetchStart(mozilla::TimeStamp aStamp) const { if (!aStamp.IsNull()) { return TimeStampToDOM(aStamp); } else { return GetFetchStart(); } }
DOMTimeMilliSec nsDOMNavigationTiming::TimeStampToDOM(mozilla::TimeStamp aStamp) const { if (aStamp.IsNull()) { return 0; } mozilla::TimeDuration duration = aStamp - mNavigationStartTimeStamp; return mNavigationStart + static_cast<int32_t>(duration.ToMilliseconds()); }
nsresult nsDOMNavigationTiming::TimeStampToDOMOrFetchStart(mozilla::TimeStamp aStamp, DOMTimeMilliSec* aResult) { if (!aStamp.IsNull()) { return TimeStampToDOM(aStamp, aResult); } else { return GetFetchStart(aResult); } }
nsresult nsDOMNavigationTiming::TimeStampToDOM(mozilla::TimeStamp aStamp, DOMTimeMilliSec* aResult) { if (aStamp.IsNull()) { *aResult = 0; return NS_OK; } mozilla::TimeDuration duration = aStamp - mNavigationStartTimeStamp; *aResult = mNavigationStart + static_cast<PRInt32>(duration.ToMilliseconds()); return NS_OK; }