зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1633644 - P2. Do not call RedirectToRealChannel if the channel got cancelled. r=mattwoodrow.
Depends on D72795 Differential Revision: https://phabricator.services.mozilla.com/D72809
This commit is contained in:
Родитель
f7bbf64d0e
Коммит
94a3210fdf
|
@ -700,6 +700,8 @@ void DocumentLoadListener::Cancel(const nsresult& aStatusCode) {
|
||||||
("DocumentLoadListener Cancel [this=%p, "
|
("DocumentLoadListener Cancel [this=%p, "
|
||||||
"aStatusCode=%" PRIx32 " ]",
|
"aStatusCode=%" PRIx32 " ]",
|
||||||
this, static_cast<uint32_t>(aStatusCode)));
|
this, static_cast<uint32_t>(aStatusCode)));
|
||||||
|
mCancelled = true;
|
||||||
|
|
||||||
if (mDoingProcessSwitch) {
|
if (mDoingProcessSwitch) {
|
||||||
// If we've already initiated process-switching
|
// If we've already initiated process-switching
|
||||||
// then we can no longer be cancelled and we'll
|
// then we can no longer be cancelled and we'll
|
||||||
|
@ -1431,8 +1433,13 @@ DocumentLoadListener::RedirectToRealChannel(
|
||||||
|
|
||||||
return EnsureBridge()->Then(
|
return EnsureBridge()->Then(
|
||||||
GetCurrentThreadSerialEventTarget(), __func__,
|
GetCurrentThreadSerialEventTarget(), __func__,
|
||||||
[endpoints = std::move(aStreamFilterEndpoints), aRedirectFlags,
|
[self = RefPtr<DocumentLoadListener>(this),
|
||||||
|
endpoints = std::move(aStreamFilterEndpoints), aRedirectFlags,
|
||||||
aLoadFlags](ADocumentChannelBridge* aBridge) mutable {
|
aLoadFlags](ADocumentChannelBridge* aBridge) mutable {
|
||||||
|
if (self->mCancelled) {
|
||||||
|
return PDocumentChannelParent::RedirectToRealChannelPromise::
|
||||||
|
CreateAndResolve(NS_BINDING_ABORTED, __func__);
|
||||||
|
}
|
||||||
return aBridge->RedirectToRealChannel(std::move(endpoints),
|
return aBridge->RedirectToRealChannel(std::move(endpoints),
|
||||||
aRedirectFlags, aLoadFlags);
|
aRedirectFlags, aLoadFlags);
|
||||||
},
|
},
|
||||||
|
|
|
@ -434,6 +434,9 @@ class DocumentLoadListener : public nsIInterfaceRequestor,
|
||||||
// This identifier is set by MaybeTriggerProcessSwitch, and is later
|
// This identifier is set by MaybeTriggerProcessSwitch, and is later
|
||||||
// passed to the childChannel in order to identify it in the new process.
|
// passed to the childChannel in order to identify it in the new process.
|
||||||
uint64_t mCrossProcessRedirectIdentifier = 0;
|
uint64_t mCrossProcessRedirectIdentifier = 0;
|
||||||
|
|
||||||
|
// True if cancelled.
|
||||||
|
bool mCancelled = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_DEFINE_STATIC_IID_ACCESSOR(DocumentLoadListener, DOCUMENT_LOAD_LISTENER_IID)
|
NS_DEFINE_STATIC_IID_ACCESSOR(DocumentLoadListener, DOCUMENT_LOAD_LISTENER_IID)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче