Bug 1403926 - Make the PerformanceNavigationTiming timestamps be relative to startTime r=baku

MozReview-Commit-ID: 7lvSsde9dzh

--HG--
extra : rebase_source : bc4b7fa0526a3fe749c17ce10f70baa8a33f8bb1
This commit is contained in:
Valentin Gosu 2017-10-04 02:48:36 +02:00
Родитель 3fba909015
Коммит 9b2d85e6e1
2 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -314,7 +314,9 @@ PerformanceMainThread::EnsureDocEntry()
{
if (!mDocEntry && nsContentUtils::IsPerformanceNavigationTimingEnabled()) {
nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(mChannel);
mDocEntry = new PerformanceNavigationTiming(Timing(), this,
RefPtr<PerformanceTiming> timing =
new PerformanceTiming(this, mChannel, nullptr, 0);
mDocEntry = new PerformanceNavigationTiming(timing, this,
httpChannel);
}
}

Просмотреть файл

@ -24,6 +24,10 @@ class PerformanceNavigationTiming final
public:
NS_DECL_ISUPPORTS_INHERITED
// Note that aPerformanceTiming must be initalized with zeroTime = 0
// so that timestamps are relative to startTime, as opposed to the
// performance.timing object for which timestamps are absolute and has a
// zeroTime initialized to navigationStart
explicit PerformanceNavigationTiming(PerformanceTiming* aPerformanceTiming,
Performance* aPerformance,
nsIHttpChannel* aChannel)