From 5a89bae2c9fbc2af03ce77e5d5021c44a6fcbd24 Mon Sep 17 00:00:00 2001 From: Christoph Kerschbaumer Date: Tue, 2 Feb 2016 20:35:02 -0800 Subject: [PATCH] Bug 1195173 - Use channel->ascynOpen2 layout/style/Loader.cpp (r=bz) --- dom/security/nsContentSecurityManager.cpp | 13 +- layout/style/Loader.cpp | 187 ++++++---------------- layout/style/Loader.h | 10 -- 3 files changed, 64 insertions(+), 146 deletions(-) diff --git a/dom/security/nsContentSecurityManager.cpp b/dom/security/nsContentSecurityManager.cpp index 12b0d800a02..9751c055af2 100644 --- a/dom/security/nsContentSecurityManager.cpp +++ b/dom/security/nsContentSecurityManager.cpp @@ -143,8 +143,17 @@ DoContentSecurityChecks(nsIURI* aURI, nsILoadInfo* aLoadInfo) break; } - case nsIContentPolicy::TYPE_IMAGE: - case nsIContentPolicy::TYPE_STYLESHEET: + case nsIContentPolicy::TYPE_IMAGE: { + MOZ_ASSERT(false, "contentPolicyType not supported yet"); + break; + } + + case nsIContentPolicy::TYPE_STYLESHEET: { + mimeTypeGuess = NS_LITERAL_CSTRING("text/css"); + requestingContext = aLoadInfo->LoadingNode(); + break; + } + case nsIContentPolicy::TYPE_OBJECT: case nsIContentPolicy::TYPE_DOCUMENT: { MOZ_ASSERT(false, "contentPolicyType not supported yet"); diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp index ec87c3a0220..f28bc44c044 100644 --- a/layout/style/Loader.cpp +++ b/layout/style/Loader.cpp @@ -48,7 +48,6 @@ #include "nsThreadUtils.h" #include "nsGkAtoms.h" #include "nsIThreadInternal.h" -#include "nsCORSListenerProxy.h" #include "nsINetworkPredictor.h" #include "mozilla/dom/ShadowRoot.h" #include "mozilla/dom/URL.h" @@ -75,16 +74,14 @@ using namespace mozilla::dom; * The CSS Loader gets requests to load various sorts of style sheets: * inline style from