Bug 1589270 - Part 1: Allow passing a specific status when disconnecting the child side, but only pass it to nsDocumentOpenInfo, not the load group. r=bzbarsky

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Matt Woodrow 2019-11-11 21:02:46 +00:00
Родитель ea5ca4b650
Коммит 3f876da3c7
4 изменённых файлов: 16 добавлений и 5 удалений

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

@ -243,8 +243,18 @@ void DocumentChannelChild::ShutdownListeners(nsresult aStatusCode) {
} }
} }
IPCResult DocumentChannelChild::RecvCancelForProcessSwitch() { IPCResult DocumentChannelChild::RecvDisconnectChildListeners(
ShutdownListeners(NS_BINDING_ABORTED); const nsresult& aStatus) {
MOZ_ASSERT(NS_FAILED(aStatus));
// Make sure we remove from the load group before
// setting mStatus, as existing tests expect the
// status to be successful when we disconnect.
if (mLoadGroup) {
mLoadGroup->RemoveRequest(this, nullptr, aStatus);
mLoadGroup = nullptr;
}
ShutdownListeners(aStatus);
return IPC_OK(); return IPC_OK();
} }

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

@ -57,7 +57,7 @@ class DocumentChannelChild final : public PDocumentChannelChild,
mozilla::ipc::IPCResult RecvFailedAsyncOpen(const nsresult& aStatusCode); mozilla::ipc::IPCResult RecvFailedAsyncOpen(const nsresult& aStatusCode);
mozilla::ipc::IPCResult RecvCancelForProcessSwitch(); mozilla::ipc::IPCResult RecvDisconnectChildListeners(const nsresult& aStatus);
mozilla::ipc::IPCResult RecvDeleteSelf(); mozilla::ipc::IPCResult RecvDeleteSelf();

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

@ -218,7 +218,7 @@ void DocumentChannelParent::FinishReplacementChannelSetup(bool aSucceeded) {
nsresult rv; nsresult rv;
if (mDoingProcessSwitch && CanSend()) { if (mDoingProcessSwitch && CanSend()) {
Unused << SendCancelForProcessSwitch(); Unused << SendDisconnectChildListeners(NS_BINDING_ABORTED);
} }
nsCOMPtr<nsIParentChannel> redirectChannel; nsCOMPtr<nsIParentChannel> redirectChannel;

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

@ -64,7 +64,8 @@ isThirdParty);
// This message is sent to a child that has been redirected to another process. // This message is sent to a child that has been redirected to another process.
// As a consequence, it should cleanup the channel listeners and remove the // As a consequence, it should cleanup the channel listeners and remove the
// request from the loadGroup. // request from the loadGroup.
async CancelForProcessSwitch(); // aStatus must be an error result.
async DisconnectChildListeners(nsresult aStatus);
async RedirectToRealChannel(uint32_t aRegistrarId, async RedirectToRealChannel(uint32_t aRegistrarId,
nsIURI aURI, nsIURI aURI,