Bug 1590763 - Record the async open time for DocumentChannel in the content process, since consumers expect this to be the same as the navigation start. r=mayhemer

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Matt Woodrow 2019-11-01 20:00:17 +00:00
Родитель 966031d6f8
Коммит b9cfd1b167
4 изменённых файлов: 9 добавлений и 0 удалений

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

@ -68,6 +68,7 @@ DocumentChannelChild::DocumentChannelChild(
uint64_t channelId;
Unused << handler->NewChannelId(channelId);
mChannelId.emplace(channelId);
mAsyncOpenTime = TimeStamp::Now();
}
NS_IMETHODIMP
@ -151,6 +152,7 @@ DocumentChannelChild::AsyncOpen(nsIStreamListener* aListener) {
args.isTopLevelDoc() = mIsTopLevelDoc;
args.hasNonEmptySandboxingFlags() = mHasNonEmptySandboxingFlags;
args.channelId() = *mChannelId;
args.asyncOpenTime() = mAsyncOpenTime;
nsCOMPtr<nsILoadContext> loadContext;
NS_QueryNotificationCallbacks(this, loadContext);

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

@ -115,6 +115,7 @@ class DocumentChannelChild final : public PDocumentChannelChild,
RedirectToRealChannelResolver mRedirectResolver;
TimeStamp mAsyncOpenTime;
const RefPtr<nsDocShellLoadState> mLoadState;
const Maybe<nsString> mInitiatorType;
const uint32_t mLoadType;

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

@ -122,6 +122,11 @@ bool DocumentChannelParent::Init(const DocumentChannelCreationArgs& aArgs) {
httpChannelImpl->SetWarningReporter(this);
}
nsCOMPtr<nsITimedChannel> timedChannel = do_QueryInterface(mChannel);
if (timedChannel) {
timedChannel->SetAsyncOpen(aArgs.asyncOpenTime());
}
// Setup a ClientChannelHelper to watch for redirects, and copy
// across any serviceworker related data between channels as needed.
AddClientChannelHelperInParent(mChannel, GetMainThreadSerialEventTarget());

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

@ -357,6 +357,7 @@ struct DocumentChannelCreationArgs {
DocShellLoadStateInit loadState;
LoadInfoArgs loadInfo;
PrincipalInfo? contentBlockingAllowListPrincipal;
TimeStamp asyncOpenTime;
nsString? initiatorType;
nsString customUserAgent;
uint64_t channelId;