author | Ehsan Akhgari <ehsan@mozilla.com> |
Fri, 12 Oct 2012 14:59:39 -0400 (2012-10-12) | |
changeset 110342 | 007e45a1f6c9b05b52ea3e937c1baa5dd64b88c7 |
parent 110341 | e54a4777f65a41a9dac22a3091a6b90bba3aa1d2 |
child 110343 | 1cbaabb841d962f6a4c673fb5cd8b47f8add1c7c |
push id | 16489 |
push user | eakhgari@mozilla.com |
push date | Mon, 15 Oct 2012 22:29:27 +0000 (2012-10-15) |
treeherder | mozilla-inbound@007e45a1f6c9 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jduell |
bugs | 800952 |
milestone | 19.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
netwerk/base/src/nsBaseChannel.cpp | file | annotate | diff | comparison | revisions | |
netwerk/protocol/http/HttpBaseChannel.cpp | file | annotate | diff | comparison | revisions |
--- a/netwerk/base/src/nsBaseChannel.cpp +++ b/netwerk/base/src/nsBaseChannel.cpp @@ -72,16 +72,25 @@ nsBaseChannel::Redirect(nsIChannel *newC SUSPEND_PUMP_FOR_SCOPE(); // Transfer properties newChannel->SetLoadGroup(mLoadGroup); 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()); // Notify consumer, giving chance to cancel redirect. For backwards compat, // we support nsIHttpEventSink if we are an HTTP channel and if this is not // an internal redirect.
--- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -1537,16 +1537,25 @@ HttpBaseChannel::SetupReplacementChannel // Do not pass along LOAD_CHECK_OFFLINE_CACHE newLoadFlags &= ~nsICachingChannel::LOAD_CHECK_OFFLINE_CACHE; newChannel->SetLoadGroup(mLoadGroup); 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 if (preserveMethod) { nsCOMPtr<nsIUploadChannel> uploadChannel = do_QueryInterface(httpChannel); nsCOMPtr<nsIUploadChannel2> uploadChannel2 =