mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-27 07:34:20 +00:00
Bug 877961 - PrivateBrowsingChannel: Allow SetPrivate on a channel with a load group but no load context; r=ehsan, r=jduell
This commit is contained in:
parent
7ea082d4cc
commit
be1d4ceb3b
@ -29,17 +29,14 @@ public:
|
||||
|
||||
NS_IMETHOD SetPrivate(bool aPrivate)
|
||||
{
|
||||
// Make sure that we don't have a load group or a load context
|
||||
// Make sure that we don't have a load context
|
||||
// This is a fatal error in debug builds, and a runtime error in release
|
||||
// builds.
|
||||
nsILoadGroup* loadGroup = static_cast<Channel*>(this)->mLoadGroup;
|
||||
nsCOMPtr<nsILoadContext> loadContext;
|
||||
if (!loadGroup) {
|
||||
NS_QueryNotificationCallbacks(static_cast<Channel*>(this), loadContext);
|
||||
}
|
||||
MOZ_ASSERT(!loadGroup && !loadContext);
|
||||
if (loadGroup || loadContext) {
|
||||
return NS_ERROR_FAILURE;
|
||||
NS_QueryNotificationCallbacks(static_cast<Channel*>(this), loadContext);
|
||||
MOZ_ASSERT(!loadContext);
|
||||
if (loadContext) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
mPrivateBrowsingOverriden = true;
|
||||
|
@ -24,6 +24,7 @@ function run_test() {
|
||||
httpserver.start(4444);
|
||||
|
||||
var channel = setupChannel(testpath);
|
||||
channel.loadGroup = Cc["@mozilla.org/network/load-group;1"].createInstance();
|
||||
|
||||
channel.QueryInterface(Ci.nsIPrivateBrowsingChannel);
|
||||
channel.setPrivate(true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user