mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1175122 - Add more assertions to the in-tree content policy implementations to ensure that they receive external content policy types; r=baku
This commit is contained in:
parent
884a33fd5a
commit
e473d353b6
@ -30,6 +30,9 @@ nsNoDataProtocolContentPolicy::ShouldLoad(uint32_t aContentType,
|
||||
nsIPrincipal *aRequestPrincipal,
|
||||
int16_t *aDecision)
|
||||
{
|
||||
MOZ_ASSERT(aContentType == nsContentUtils::InternalContentPolicyTypeToExternal(aContentType),
|
||||
"We should only see external content policy types here.");
|
||||
|
||||
*aDecision = nsIContentPolicy::ACCEPT;
|
||||
|
||||
// Don't block for TYPE_OBJECT since such URIs are sometimes loaded by the
|
||||
|
@ -251,6 +251,9 @@ CSPService::ShouldProcess(uint32_t aContentType,
|
||||
nsIPrincipal *aRequestPrincipal,
|
||||
int16_t *aDecision)
|
||||
{
|
||||
MOZ_ASSERT(aContentType == nsContentUtils::InternalContentPolicyTypeToExternal(aContentType),
|
||||
"We should only see external content policy types here.");
|
||||
|
||||
if (!aContentLocation)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
|
@ -787,6 +787,9 @@ nsMixedContentBlocker::ShouldProcess(uint32_t aContentType,
|
||||
nsIPrincipal* aRequestPrincipal,
|
||||
int16_t* aDecision)
|
||||
{
|
||||
MOZ_ASSERT(aContentType == nsContentUtils::InternalContentPolicyTypeToExternal(aContentType),
|
||||
"We should only see external content policy types here.");
|
||||
|
||||
if (!aContentLocation) {
|
||||
// aContentLocation may be null when a plugin is loading without an associated URI resource
|
||||
if (aContentType == TYPE_OBJECT) {
|
||||
|
@ -34,6 +34,9 @@ nsWebBrowserContentPolicy::ShouldLoad(uint32_t aContentType,
|
||||
{
|
||||
NS_PRECONDITION(aShouldLoad, "Null out param");
|
||||
|
||||
MOZ_ASSERT(aContentType == nsContentUtils::InternalContentPolicyTypeToExternal(aContentType),
|
||||
"We should only see external content policy types here.");
|
||||
|
||||
*aShouldLoad = nsIContentPolicy::ACCEPT;
|
||||
|
||||
nsIDocShell* shell = NS_CP_GetDocShellFromContext(aRequestingContext);
|
||||
@ -84,6 +87,9 @@ nsWebBrowserContentPolicy::ShouldProcess(uint32_t aContentType,
|
||||
{
|
||||
NS_PRECONDITION(aShouldProcess, "Null out param");
|
||||
|
||||
MOZ_ASSERT(aContentType == nsContentUtils::InternalContentPolicyTypeToExternal(aContentType),
|
||||
"We should only see external content policy types here.");
|
||||
|
||||
*aShouldProcess = nsIContentPolicy::ACCEPT;
|
||||
|
||||
// Object tags will always open channels with TYPE_OBJECT, but may end up
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "nsContentPolicyUtils.h"
|
||||
#include "nsIObjectLoadingContent.h"
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
// Possible behavior pref values
|
||||
// Those map to the nsIPermissionManager values where possible
|
||||
@ -150,6 +151,9 @@ nsContentBlocker::ShouldLoad(uint32_t aContentType,
|
||||
nsIPrincipal *aRequestPrincipal,
|
||||
int16_t *aDecision)
|
||||
{
|
||||
MOZ_ASSERT(aContentType == nsContentUtils::InternalContentPolicyTypeToExternal(aContentType),
|
||||
"We should only see external content policy types here.");
|
||||
|
||||
*aDecision = nsIContentPolicy::ACCEPT;
|
||||
nsresult rv;
|
||||
|
||||
@ -201,6 +205,9 @@ nsContentBlocker::ShouldProcess(uint32_t aContentType,
|
||||
nsIPrincipal *aRequestPrincipal,
|
||||
int16_t *aDecision)
|
||||
{
|
||||
MOZ_ASSERT(aContentType == nsContentUtils::InternalContentPolicyTypeToExternal(aContentType),
|
||||
"We should only see external content policy types here.");
|
||||
|
||||
// For loads where aRequestingContext is chrome, we should just
|
||||
// accept. Those are most likely toplevel loads in windows, and
|
||||
// chrome generally knows what it's doing anyway.
|
||||
|
Loading…
Reference in New Issue
Block a user