зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1583932 - Remove aRequestOrigin from nsCSPContext::ShouldLoad r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D47125 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
653894ec31
Коммит
c494962b4b
|
@ -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
|
||||
|
|
|
@ -184,7 +184,6 @@ function run_test() {
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
true,
|
||||
null
|
||||
);
|
||||
|
@ -246,7 +245,6 @@ function run_test() {
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
true,
|
||||
null
|
||||
);
|
||||
|
@ -262,7 +260,6 @@ function run_test() {
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
true,
|
||||
null
|
||||
);
|
||||
|
@ -280,7 +277,6 @@ function run_test() {
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
true,
|
||||
null
|
||||
);
|
||||
|
@ -300,7 +296,6 @@ function run_test() {
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
true,
|
||||
null
|
||||
);
|
||||
|
|
Загрузка…
Ссылка в новой задаче