mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 04:09:50 +00:00
Bug 1462464 Copy reserved and initial ClientInfo over when HttpChannelParent sees the special InterceptedHttpChannel redirect. r=valentin
This commit is contained in:
parent
8048d5574f
commit
8e95453379
@ -1857,6 +1857,26 @@ HttpChannelParent::StartRedirect(uint32_t registrarId,
|
||||
MOZ_ASSERT(!oldIntercepted);
|
||||
#endif
|
||||
|
||||
// We need to move across the reserved and initial client information
|
||||
// to the new channel. Normally this would be handled by the child
|
||||
// ClientChannelHelper, but that is not notified of this redirect since
|
||||
// we're not propagating it back to the child process.
|
||||
nsCOMPtr<nsILoadInfo> oldLoadInfo;
|
||||
Unused << mChannel->GetLoadInfo(getter_AddRefs(oldLoadInfo));
|
||||
nsCOMPtr<nsILoadInfo> newLoadInfo;
|
||||
Unused << newChannel->GetLoadInfo(getter_AddRefs(newLoadInfo));
|
||||
if (oldLoadInfo && newLoadInfo) {
|
||||
Maybe<ClientInfo> reservedClientInfo(oldLoadInfo->GetReservedClientInfo());
|
||||
if (reservedClientInfo.isSome()) {
|
||||
newLoadInfo->SetReservedClientInfo(reservedClientInfo.ref());
|
||||
}
|
||||
|
||||
Maybe<ClientInfo> initialClientInfo(oldLoadInfo->GetInitialClientInfo());
|
||||
if (initialClientInfo.isSome()) {
|
||||
newLoadInfo->SetInitialClientInfo(initialClientInfo.ref());
|
||||
}
|
||||
}
|
||||
|
||||
// Re-link the HttpChannelParent to the new InterceptedHttpChannel.
|
||||
nsCOMPtr<nsIChannel> linkedChannel;
|
||||
rv = NS_LinkRedirectChannels(registrarId, this, getter_AddRefs(linkedChannel));
|
||||
|
Loading…
x
Reference in New Issue
Block a user