diff --git a/content/base/public/nsIContentPolicy.idl b/content/base/public/nsIContentPolicy.idl index 68d6c188164..f206489f0b0 100644 --- a/content/base/public/nsIContentPolicy.idl +++ b/content/base/public/nsIContentPolicy.idl @@ -24,7 +24,7 @@ typedef unsigned long nsContentPolicyType; * by launching a dialog to prompt the user for something). */ -[scriptable,uuid(b6a71698-c117-441d-86b9-480cf06e3952)] +[scriptable,uuid(3e923bf6-a974-4f3b-91c4-b4fd48b37732)] interface nsIContentPolicy : nsISupports { /** diff --git a/content/base/public/nsIContentSecurityPolicy.idl b/content/base/public/nsIContentSecurityPolicy.idl index 37d7721de4a..5857bf00624 100644 --- a/content/base/public/nsIContentSecurityPolicy.idl +++ b/content/base/public/nsIContentSecurityPolicy.idl @@ -221,18 +221,6 @@ interface nsIContentSecurityPolicy : nsISerializable in ACString aMimeTypeGuess, in nsISupports aExtra); - /** - * Delegate method called by the service when sub-elements of the protected - * document are being processed. Given a bit of information about the request, - * decides whether or not the policy is satisfied. - */ - short shouldProcess(in nsContentPolicyType aContentType, - in nsIURI aContentLocation, - in nsIURI aRequestOrigin, - in nsISupports aContext, - in ACString aMimeType, - in nsISupports aExtra); - %{ C++ // nsIObserver topic to fire when the policy encounters a violation. #define CSP_VIOLATION_TOPIC "csp-on-violate-policy" diff --git a/content/base/src/nsCSPContext.cpp b/content/base/src/nsCSPContext.cpp index 8fdb07638a4..f7d6e400cb3 100644 --- a/content/base/src/nsCSPContext.cpp +++ b/content/base/src/nsCSPContext.cpp @@ -209,19 +209,6 @@ nsCSPContext::ShouldLoad(nsContentPolicyType aContentType, return NS_OK; } -NS_IMETHODIMP -nsCSPContext::ShouldProcess(nsContentPolicyType aContentType, - nsIURI* aContentLocation, - nsIURI* aRequestOrigin, - nsISupports* aRequestContext, - const nsACString& aMimeType, - nsISupports* aExtra, - int16_t* outDecision) -{ - *outDecision = nsIContentPolicy::ACCEPT; - return NS_OK; -} - /* ===== nsISupports implementation ========== */ NS_IMPL_CLASSINFO(nsCSPContext, diff --git a/content/base/src/nsCSPService.cpp b/content/base/src/nsCSPService.cpp index 178a17b0ee9..d48018b6b60 100644 --- a/content/base/src/nsCSPService.cpp +++ b/content/base/src/nsCSPService.cpp @@ -218,56 +218,7 @@ CSPService::ShouldProcess(uint32_t aContentType, if (!aContentLocation) return NS_ERROR_FAILURE; - // default decision is to accept the item *aDecision = nsIContentPolicy::ACCEPT; - - // No need to continue processing if CSP is disabled - if (!sCSPEnabled) - return NS_OK; - - // find the nsDocument that initiated this request and see if it has a - // CSP policy object - nsCOMPtr node(do_QueryInterface(aRequestContext)); - nsCOMPtr principal; - nsCOMPtr csp; - if (node) { - principal = node->NodePrincipal(); - principal->GetCsp(getter_AddRefs(csp)); - - if (csp) { -#ifdef PR_LOGGING - { - uint32_t numPolicies = 0; - nsresult rv = csp->GetPolicyCount(&numPolicies); - if (NS_SUCCEEDED(rv)) { - for (uint32_t i=0; iGetPolicy(i, policy); - PR_LOG(gCspPRLog, PR_LOG_DEBUG, - ("shouldProcess - document has policy[%d]: %s", i, - NS_ConvertUTF16toUTF8(policy).get())); - } - } - } -#endif - // obtain the enforcement decision - csp->ShouldProcess(aContentType, - aContentLocation, - aRequestOrigin, - aRequestContext, - aMimeTypeGuess, - aExtra, - aDecision); - } - } -#ifdef PR_LOGGING - else { - nsAutoCString uriSpec; - aContentLocation->GetSpec(uriSpec); - PR_LOG(gCspPRLog, PR_LOG_DEBUG, - ("COULD NOT get nsINode for location: %s", uriSpec.get())); - } -#endif return NS_OK; }