зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1329521 - GetLoadContextInfo() should not compare originAttributes and privateBrowsing boolean when docShell is chrome type, r=smaug
This commit is contained in:
Родитель
8c3f52c48e
Коммит
4a461b1ce2
|
@ -5,6 +5,7 @@
|
|||
#include "LoadContextInfo.h"
|
||||
|
||||
#include "mozilla/dom/ToJSValue.h"
|
||||
#include "nsDocShell.h"
|
||||
#include "nsIChannel.h"
|
||||
#include "nsILoadContext.h"
|
||||
#include "nsIWebNavigation.h"
|
||||
|
@ -143,12 +144,17 @@ GetLoadContextInfo(nsILoadContext *aLoadContext, bool aIsAnonymous)
|
|||
return new LoadContextInfo(aIsAnonymous, OriginAttributes());
|
||||
}
|
||||
|
||||
DebugOnly<bool> pb = aLoadContext->UsePrivateBrowsing();
|
||||
OriginAttributes oa;
|
||||
aLoadContext->GetOriginAttributes(oa);
|
||||
oa.StripAttributes(OriginAttributes::STRIP_ADDON_ID);
|
||||
|
||||
MOZ_ASSERT(pb == (oa.mPrivateBrowsingId > 0));
|
||||
#ifdef DEBUG
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShell = do_QueryInterface(aLoadContext);
|
||||
if (!docShell || docShell->ItemType() != nsIDocShellTreeItem::typeChrome) {
|
||||
MOZ_ASSERT(aLoadContext->UsePrivateBrowsing() == (oa.mPrivateBrowsingId > 0));
|
||||
}
|
||||
#endif
|
||||
|
||||
return new LoadContextInfo(aIsAnonymous, oa);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче