mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 08:13:35 +00:00
Bug 800952 - Make sure that the privacy override information on a channel is correctly transferred to a channel when we setup a replacement channel for it; f=jdm r=jduell
This is required when a channel with an overridden privacy status (such as a favicon HTTP load channel) gets redirected, for example.
This commit is contained in:
parent
47ea65c276
commit
bcd437d0de
@ -77,6 +77,15 @@ nsBaseChannel::Redirect(nsIChannel *newChannel, uint32_t redirectFlags,
|
||||
newChannel->SetNotificationCallbacks(mCallbacks);
|
||||
newChannel->SetLoadFlags(mLoadFlags | LOAD_REPLACE);
|
||||
|
||||
// Try to preserve the privacy bit if it has been overridden
|
||||
if (mPrivateBrowsingOverriden) {
|
||||
nsCOMPtr<nsIPrivateBrowsingChannel> newPBChannel =
|
||||
do_QueryInterface(newChannel);
|
||||
if (newPBChannel) {
|
||||
newPBChannel->SetPrivate(mPrivateBrowsing);
|
||||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIWritablePropertyBag> bag = ::do_QueryInterface(newChannel);
|
||||
if (bag)
|
||||
mPropertyHash.EnumerateRead(CopyProperties, bag.get());
|
||||
|
@ -1542,6 +1542,15 @@ HttpBaseChannel::SetupReplacementChannel(nsIURI *newURI,
|
||||
newChannel->SetNotificationCallbacks(mCallbacks);
|
||||
newChannel->SetLoadFlags(newLoadFlags);
|
||||
|
||||
// Try to preserve the privacy bit if it has been overridden
|
||||
if (mPrivateBrowsingOverriden) {
|
||||
nsCOMPtr<nsIPrivateBrowsingChannel> newPBChannel =
|
||||
do_QueryInterface(newChannel);
|
||||
if (newPBChannel) {
|
||||
newPBChannel->SetPrivate(mPrivateBrowsing);
|
||||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(newChannel);
|
||||
if (!httpChannel)
|
||||
return NS_OK; // no other options to set
|
||||
|
Loading…
Reference in New Issue
Block a user