зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1689601, Add DocumentChannel ID to DocumentLoadListener, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D105231
This commit is contained in:
Родитель
6122b9c018
Коммит
9343c38009
|
@ -39,7 +39,8 @@ bool DocumentChannelParent::Init(dom::CanonicalBrowsingContext* aContext,
|
|||
RefPtr<DocumentLoadListener::OpenPromise> promise;
|
||||
if (loadState->GetChannelInitialized()) {
|
||||
promise = DocumentLoadListener::ClaimParentLoad(
|
||||
getter_AddRefs(mDocumentLoadListener), loadState->GetLoadIdentifier());
|
||||
getter_AddRefs(mDocumentLoadListener), loadState->GetLoadIdentifier(),
|
||||
Some(aArgs.channelId()));
|
||||
}
|
||||
if (!promise) {
|
||||
bool isDocumentLoad =
|
||||
|
|
|
@ -520,6 +520,7 @@ auto DocumentLoadListener::Open(nsDocShellLoadState* aLoadState,
|
|||
if (identChannel && aChannelId) {
|
||||
Unused << identChannel->SetChannelId(*aChannelId);
|
||||
}
|
||||
mDocumentChannelId = aChannelId;
|
||||
|
||||
RefPtr<nsHttpChannel> httpChannelImpl = do_QueryObject(mChannel);
|
||||
if (httpChannelImpl) {
|
||||
|
@ -904,7 +905,8 @@ void DocumentLoadListener::CleanupParentLoadAttempt(uint64_t aLoadIdent) {
|
|||
}
|
||||
|
||||
auto DocumentLoadListener::ClaimParentLoad(DocumentLoadListener** aListener,
|
||||
uint64_t aLoadIdent)
|
||||
uint64_t aLoadIdent,
|
||||
Maybe<uint64_t> aChannelId)
|
||||
-> RefPtr<OpenPromise> {
|
||||
nsCOMPtr<nsIRedirectChannelRegistrar> registrar =
|
||||
RedirectChannelRegistrar::GetOrCreate();
|
||||
|
@ -920,6 +922,8 @@ auto DocumentLoadListener::ClaimParentLoad(DocumentLoadListener** aListener,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
loadListener->mDocumentChannelId = aChannelId;
|
||||
|
||||
MOZ_DIAGNOSTIC_ASSERT(loadListener->mOpenPromise);
|
||||
loadListener.forget(aListener);
|
||||
|
||||
|
|
|
@ -195,7 +195,8 @@ class DocumentLoadListener : public nsIInterfaceRequestor,
|
|||
|
||||
// Looks up aLoadIdent to find the associated, cleans up the registration
|
||||
static RefPtr<OpenPromise> ClaimParentLoad(DocumentLoadListener** aListener,
|
||||
uint64_t aLoadIdent);
|
||||
uint64_t aLoadIdent,
|
||||
Maybe<uint64_t> aChannelId);
|
||||
|
||||
// Called by the DocumentChannelParent if actor got destroyed or the parent
|
||||
// channel got deleted.
|
||||
|
@ -464,6 +465,8 @@ class DocumentLoadListener : public nsIInterfaceRequestor,
|
|||
|
||||
nsCOMPtr<nsIChannel> mChannel;
|
||||
|
||||
Maybe<uint64_t> mDocumentChannelId;
|
||||
|
||||
// An instance of ParentChannelListener that we use as a listener
|
||||
// between mChannel (and any future redirected mChannels) and us.
|
||||
// This handles service worker interception, and retargetting
|
||||
|
|
Загрузка…
Ссылка в новой задаче