Bug 1603187 - P3. Add Anonymize method. r=smaug

This method will be used by the DocumentLoadListener on the timing information object before sending it to the new content process following a cross-origin redirect.

Differential Revision: https://phabricator.services.mozilla.com/D57939

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jean-Yves Avenard 2020-01-05 05:44:31 +00:00
Родитель a0bcbb1eff
Коммит 1a27f6f0f6
2 изменённых файлов: 12 добавлений и 0 удалений

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

@ -61,6 +61,14 @@ void nsDOMNavigationTiming::Clear() {
mDocShellHasBeenActiveSinceNavigationStart = false;
}
void nsDOMNavigationTiming::Anonymize(nsIURI* aFinalURI) {
mLoadedURI = aFinalURI;
mUnloadedURI = nullptr;
mBeforeUnloadStart = TimeStamp();
mUnloadStart = TimeStamp();
mUnloadEnd = TimeStamp();
}
DOMTimeMilliSec nsDOMNavigationTiming::TimeStampToDOM(TimeStamp aStamp) const {
if (aStamp.IsNull()) {
return 0;

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

@ -174,6 +174,10 @@ class nsDOMNavigationTiming final : public mozilla::RelativeTimeline {
return duration.ToMilliseconds();
}
// Called by the DocumentLoadListener before sending the timing information
// to the new content process.
void Anonymize(nsIURI* aFinalURI);
private:
friend class nsDocShell;
nsDOMNavigationTiming(nsDocShell* aDocShell, nsDOMNavigationTiming* aOther);