Bug 1231211 P5 Add nsContentUtils::IsNonSubresourceInternalPolicyType() method. r=asuth

This commit is contained in:
Ben Kelly 2018-01-23 10:38:52 -05:00
Родитель 5a5a70b6f5
Коммит c0ed8a4f53
2 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@ -8867,8 +8867,18 @@ nsContentUtils::IsNonSubresourceRequest(nsIChannel* aChannel)
return false;
}
nsContentPolicyType type = loadInfo->InternalContentPolicyType();
return type == nsIContentPolicy::TYPE_INTERNAL_WORKER ||
type == nsIContentPolicy::TYPE_INTERNAL_SHARED_WORKER;
return IsNonSubresourceInternalPolicyType(type);
}
// static
bool
nsContentUtils::IsNonSubresourceInternalPolicyType(nsContentPolicyType aType)
{
return aType == nsIContentPolicy::TYPE_DOCUMENT ||
aType == nsIContentPolicy::TYPE_INTERNAL_IFRAME ||
aType == nsIContentPolicy::TYPE_INTERNAL_FRAME ||
aType == nsIContentPolicy::TYPE_INTERNAL_WORKER ||
aType == nsIContentPolicy::TYPE_INTERNAL_SHARED_WORKER;
}
// static, public

Просмотреть файл

@ -2907,6 +2907,8 @@ public:
static bool IsNonSubresourceRequest(nsIChannel* aChannel);
static bool IsNonSubresourceInternalPolicyType(nsContentPolicyType aType);
// The order of these entries matters, as we use std::min for total ordering
// of permissions. Private Browsing is considered to be more limiting
// then session scoping