Bug 1683464 - Reduce nsContentPolicyType usage. r=ckerschb

Differential Revision: https://phabricator.services.mozilla.com/D100181
This commit is contained in:
Masatoshi Kimura
2021-01-07 15:18:52 +00:00
parent 204b199fde
commit d7e7aeef59
10 changed files with 62 additions and 119 deletions

View File

@@ -1643,11 +1643,11 @@ static bool CSPAllowsInlineScript(nsIScriptElement* aElement,
aElement->GetParserCreated() != mozilla::dom::NOT_FROM_PARSER;
bool allowInlineScript = false;
rv = csp->GetAllowsInline(nsIContentPolicy::TYPE_SCRIPT, nonce, parserCreated,
scriptContent, nullptr /* nsICSPEventListener */,
u""_ns, aElement->GetScriptLineNumber(),
aElement->GetScriptColumnNumber(),
&allowInlineScript);
rv = csp->GetAllowsInline(
nsIContentSecurityPolicy::SCRIPT_SRC_DIRECTIVE, nonce, parserCreated,
scriptContent, nullptr /* nsICSPEventListener */, u""_ns,
aElement->GetScriptLineNumber(), aElement->GetScriptColumnNumber(),
&allowInlineScript);
return NS_SUCCEEDED(rv) && allowInlineScript;
}