Bug 1277803 - Part 4 : Make the NS_CompareLoadInfoAndLoadContext() skiping test if the request is the favicon loading from the XUL image. r=honzab
This commit is contained in:
@@ -2664,18 +2664,33 @@ HttpBaseChannel::ShouldIntercept(nsIURI* aURI)
|
||||
return shouldIntercept;
|
||||
}
|
||||
|
||||
void HttpBaseChannel::CheckPrivateBrowsing()
|
||||
#ifdef DEBUG
|
||||
void HttpBaseChannel::AssertPrivateBrowsingId()
|
||||
{
|
||||
nsCOMPtr<nsILoadContext> loadContext;
|
||||
NS_QueryNotificationCallbacks(this, loadContext);
|
||||
// For addons it's possible that mLoadInfo is null.
|
||||
if (mLoadInfo && loadContext) {
|
||||
DocShellOriginAttributes docShellAttrs;
|
||||
loadContext->GetOriginAttributes(docShellAttrs);
|
||||
MOZ_ASSERT(mLoadInfo->GetOriginAttributes().mPrivateBrowsingId == docShellAttrs.mPrivateBrowsingId,
|
||||
"PrivateBrowsingId values are not the same between LoadInfo and LoadContext.");
|
||||
if (!mLoadInfo) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!loadContext) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We skip testing of favicon loading here since it could be triggered by XUL image
|
||||
// which uses SystemPrincipal. The SystemPrincpal doesn't have mPrivateBrowsingId.
|
||||
if (nsContentUtils::IsSystemPrincipal(mLoadInfo->LoadingPrincipal()) &&
|
||||
mLoadInfo->InternalContentPolicyType() == nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON) {
|
||||
return;
|
||||
}
|
||||
|
||||
DocShellOriginAttributes docShellAttrs;
|
||||
loadContext->GetOriginAttributes(docShellAttrs);
|
||||
MOZ_ASSERT(mLoadInfo->GetOriginAttributes().mPrivateBrowsingId == docShellAttrs.mPrivateBrowsingId,
|
||||
"PrivateBrowsingId values are not the same between LoadInfo and LoadContext.");
|
||||
}
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// nsHttpChannel::nsITraceableChannel
|
||||
|
||||
Reference in New Issue
Block a user