Commit 245b8785 authored by Sebastian Streich's avatar Sebastian Streich
Browse files

Bug 1583932 - Remove aRequestOrigin from nsCSPContext::ShouldLoad r=ckerschb

Differential Revision: https://phabricator.services.mozilla.com/D47125

--HG--
extra : moz-landing-system : lando
parent 39d980d6
......@@ -329,7 +329,6 @@ interface nsIContentSecurityPolicy : nsISerializable
short shouldLoad(in nsContentPolicyType aContentType,
in nsICSPEventListener aCSPEventListener,
in nsIURI aContentLocation,
in nsIURI aRequestOrigin,
in nsISupports aContext,
in ACString aMimeTypeGuess,
in nsIURI aOriginalURIIfRedirect,
......
......@@ -117,8 +117,7 @@ static void BlockedContentSourceToString(
NS_IMETHODIMP
nsCSPContext::ShouldLoad(nsContentPolicyType aContentType,
nsICSPEventListener* aCSPEventListener,
nsIURI* aContentLocation, nsIURI* aRequestOrigin,
nsISupports* aRequestContext,
nsIURI* aContentLocation, nsISupports* aRequestContext,
const nsACString& aMimeTypeGuess,
nsIURI* aOriginalURIIfRedirect,
bool aSendViolationReports, const nsAString& aNonce,
......
......@@ -107,11 +107,6 @@ bool subjectToCSP(nsIURI* aURI, nsContentPolicyType aContentType) {
uint32_t contentType = aLoadInfo->InternalContentPolicyType();
nsCOMPtr<nsISupports> requestContext = aLoadInfo->GetLoadingContext();
nsCOMPtr<nsIURI> requestOrigin;
nsCOMPtr<nsIPrincipal> loadingPrincipal = aLoadInfo->LoadingPrincipal();
if (loadingPrincipal) {
loadingPrincipal->GetURI(getter_AddRefs(requestOrigin));
}
nsCOMPtr<nsICSPEventListener> cspEventListener;
nsresult rv =
......@@ -149,8 +144,8 @@ bool subjectToCSP(nsIURI* aURI, nsContentPolicyType aContentType) {
if (preloadCsp) {
// obtain the enforcement decision
rv = preloadCsp->ShouldLoad(
contentType, cspEventListener, aContentLocation, requestOrigin,
requestContext, aMimeTypeGuess,
contentType, cspEventListener, aContentLocation, requestContext,
aMimeTypeGuess,
nullptr, // no redirect, aOriginal URL is null.
aLoadInfo->GetSendCSPViolationEvents(), cspNonce, aDecision);
NS_ENSURE_SUCCESS(rv, rv);
......@@ -175,7 +170,7 @@ bool subjectToCSP(nsIURI* aURI, nsContentPolicyType aContentType) {
if (csp) {
// obtain the enforcement decision
rv = csp->ShouldLoad(contentType, cspEventListener, aContentLocation,
requestOrigin, requestContext, aMimeTypeGuess,
requestContext, aMimeTypeGuess,
nullptr, // no redirect, aOriginal URL is null.
aLoadInfo->GetSendCSPViolationEvents(), cspNonce,
aDecision);
......@@ -342,7 +337,6 @@ nsresult CSPService::ConsultCSPForRedirect(nsIURI* aOriginalURI,
policyType, // load type per nsIContentPolicy (uint32_t)
cspEventListener,
aNewURI, // nsIURI
nullptr, // nsIURI
requestContext, // nsISupports
EmptyCString(), // ACString - MIME guess
aOriginalURI, // Original nsIURI
......@@ -366,7 +360,6 @@ nsresult CSPService::ConsultCSPForRedirect(nsIURI* aOriginalURI,
csp->ShouldLoad(policyType, // load type per nsIContentPolicy (uint32_t)
cspEventListener,
aNewURI, // nsIURI
nullptr, // nsIURI
requestContext, // nsISupports
EmptyCString(), // ACString - MIME guess
aOriginalURI, // Original nsIURI
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment