Bug 1175114 - Translate the content policy type obtained in CSPService::AsyncOnChannelRedirect to an external one before invoking the content policy implementation; r=smaug
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 16 Jun 2015 08:49:04 -0400
changeset 279979 0086cb0ada91f77c6f0dcc115ca8b5051c2869ee
parent 279925 4f381552336d56fd7befc57dc9bfd08a1f2650bf
child 279980 f46a712edf7ee9088854b220661df6857453f69c
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1175114
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1175114 - Translate the content policy type obtained in CSPService::AsyncOnChannelRedirect to an external one before invoking the content policy implementation; r=smaug
dom/security/nsCSPService.cpp
--- a/dom/security/nsCSPService.cpp
+++ b/dom/security/nsCSPService.cpp
@@ -306,17 +306,18 @@ CSPService::AsyncOnChannelRedirect(nsICh
    * information set in the LoadInfo when channels are created.
    *
    * We check if the CSP permits this host for this type of load, if not,
    * we cancel the load now.
    */
   nsCOMPtr<nsIURI> originalUri;
   rv = oldChannel->GetOriginalURI(getter_AddRefs(originalUri));
   NS_ENSURE_SUCCESS(rv, rv);
-  nsContentPolicyType policyType = loadInfo->GetContentPolicyType();
+  nsContentPolicyType policyType =
+    nsContentUtils::InternalContentPolicyTypeToExternal(loadInfo->GetContentPolicyType());
 
   int16_t aDecision = nsIContentPolicy::ACCEPT;
   csp->ShouldLoad(policyType,     // load type per nsIContentPolicy (uint32_t)
                   newUri,         // nsIURI
                   nullptr,        // nsIURI
                   nullptr,        // nsISupports
                   EmptyCString(), // ACString - MIME guess
                   originalUri,    // aMimeTypeGuess