diff --git a/content/base/src/EventSource.cpp b/content/base/src/EventSource.cpp index a9138c5982c2..54212e889769 100644 --- a/content/base/src/EventSource.cpp +++ b/content/base/src/EventSource.cpp @@ -28,7 +28,6 @@ #include "nsIAsyncVerifyRedirectCallback.h" #include "nsIScriptError.h" #include "mozilla/dom/EncodingUtils.h" -#include "nsIChannelPolicy.h" #include "nsIContentSecurityPolicy.h" #include "nsContentUtils.h" #include "mozilla/Preferences.h" @@ -738,17 +737,7 @@ EventSource::InitChannelAndRequestEventSource() nsLoadFlags loadFlags; loadFlags = nsIRequest::LOAD_BACKGROUND | nsIRequest::LOAD_BYPASS_CACHE; - // get Content Security Policy from principal to pass into channel - nsCOMPtr channelPolicy; - nsCOMPtr csp; - nsresult rv = mPrincipal->GetCsp(getter_AddRefs(csp)); - NS_ENSURE_SUCCESS(rv, rv); - if (csp) { - channelPolicy = do_CreateInstance("@mozilla.org/nschannelpolicy;1"); - channelPolicy->SetContentSecurityPolicy(csp); - channelPolicy->SetLoadType(nsIContentPolicy::TYPE_DATAREQUEST); - } - + nsresult rv; nsIScriptContext* sc = GetContextForEventHandlers(&rv); nsCOMPtr doc = nsContentUtils::GetDocumentFromScriptContext(sc); @@ -761,7 +750,6 @@ EventSource::InitChannelAndRequestEventSource() doc, nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL, nsIContentPolicy::TYPE_DATAREQUEST, - channelPolicy, // aChannelPolicy mLoadGroup, // loadGroup nullptr, // aCallbacks loadFlags); // aLoadFlags @@ -772,7 +760,6 @@ EventSource::InitChannelAndRequestEventSource() mPrincipal, nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL, nsIContentPolicy::TYPE_DATAREQUEST, - channelPolicy, // aChannelPolicy mLoadGroup, // loadGroup nullptr, // aCallbacks loadFlags); // aLoadFlags diff --git a/content/base/src/ImportManager.cpp b/content/base/src/ImportManager.cpp index a539b3dd27f7..3567a10d827e 100644 --- a/content/base/src/ImportManager.cpp +++ b/content/base/src/ImportManager.cpp @@ -12,7 +12,6 @@ #include "nsContentUtils.h" #include "nsCrossSiteListenerProxy.h" #include "nsIChannel.h" -#include "nsIChannelPolicy.h" #include "nsIContentPolicy.h" #include "nsIContentSecurityPolicy.h" #include "nsIDocument.h" @@ -229,23 +228,13 @@ ImportLoader::Open() NS_ENSURE_SUCCESS_VOID(rv); nsCOMPtr loadGroup = mImportParent->GetDocumentLoadGroup(); - nsCOMPtr channelPolicy; - nsCOMPtr csp; - rv = principal->GetCsp(getter_AddRefs(csp)); - NS_ENSURE_SUCCESS_VOID(rv); - if (csp) { - channelPolicy = do_CreateInstance("@mozilla.org/nschannelpolicy;1"); - channelPolicy->SetContentSecurityPolicy(csp); - channelPolicy->SetLoadType(nsIContentPolicy::TYPE_SUBDOCUMENT); - } nsCOMPtr channel; rv = NS_NewChannel(getter_AddRefs(channel), mURI, mImportParent, nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_SUBDOCUMENT, - channelPolicy, loadGroup, nullptr, // aCallbacks nsIRequest::LOAD_BACKGROUND); diff --git a/content/base/src/moz.build b/content/base/src/moz.build index a660ba44cbc5..f59c117101ae 100644 --- a/content/base/src/moz.build +++ b/content/base/src/moz.build @@ -109,7 +109,6 @@ UNIFIED_SOURCES += [ 'nsAttrValue.cpp', 'nsAttrValueOrString.cpp', 'nsCCUncollectableMarker.cpp', - 'nsChannelPolicy.cpp', 'nsContentAreaDragDrop.cpp', 'nsContentIterator.cpp', 'nsContentList.cpp', diff --git a/content/base/src/nsCSPContext.cpp b/content/base/src/nsCSPContext.cpp index b7e67d59e129..795a41c3b156 100644 --- a/content/base/src/nsCSPContext.cpp +++ b/content/base/src/nsCSPContext.cpp @@ -11,7 +11,6 @@ #include "nsCSPService.h" #include "nsError.h" #include "nsIAsyncVerifyRedirectCallback.h" -#include "nsIChannelPolicy.h" #include "nsIClassInfoImpl.h" #include "nsIDocShell.h" #include "nsIDocShellTreeItem.h" @@ -26,12 +25,10 @@ #include "nsIObjectOutputStream.h" #include "nsIObserver.h" #include "nsIObserverService.h" -#include "nsIPropertyBag2.h" #include "nsIStringStream.h" #include "nsIUploadChannel.h" #include "nsIScriptError.h" #include "nsIWebNavigation.h" -#include "nsIWritablePropertyBag2.h" #include "nsNetUtil.h" #include "nsNullPrincipal.h" #include "nsIContentPolicy.h" diff --git a/content/base/src/nsCSPService.cpp b/content/base/src/nsCSPService.cpp index f59ba5aa999b..d550d462bf28 100644 --- a/content/base/src/nsCSPService.cpp +++ b/content/base/src/nsCSPService.cpp @@ -12,12 +12,7 @@ #include "nsIContent.h" #include "nsCSPService.h" #include "nsIContentSecurityPolicy.h" -#include "nsIChannelPolicy.h" -#include "nsIChannelEventSink.h" -#include "nsIPropertyBag2.h" -#include "nsIWritablePropertyBag2.h" #include "nsError.h" -#include "nsChannelProperties.h" #include "nsIAsyncVerifyRedirectCallback.h" #include "nsAsyncRedirectVerifyHelper.h" #include "mozilla/Preferences.h" diff --git a/content/base/src/nsChannelPolicy.cpp b/content/base/src/nsChannelPolicy.cpp deleted file mode 100644 index 7d647695bbe6..000000000000 --- a/content/base/src/nsChannelPolicy.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsChannelPolicy.h" - -nsChannelPolicy::nsChannelPolicy() - : mLoadType(0) -{ -} - -nsChannelPolicy::~nsChannelPolicy() -{ -} - -NS_IMPL_ISUPPORTS(nsChannelPolicy, nsIChannelPolicy) - -NS_IMETHODIMP -nsChannelPolicy::GetLoadType(uint32_t *aLoadType) -{ - *aLoadType = mLoadType; - return NS_OK; -} - -NS_IMETHODIMP -nsChannelPolicy::SetLoadType(uint32_t aLoadType) -{ - mLoadType = aLoadType; - return NS_OK; -} - -NS_IMETHODIMP -nsChannelPolicy::GetContentSecurityPolicy(nsISupports **aCSP) -{ - *aCSP = mCSP; - NS_IF_ADDREF(*aCSP); - return NS_OK; -} - -NS_IMETHODIMP -nsChannelPolicy::SetContentSecurityPolicy(nsISupports *aCSP) -{ - mCSP = aCSP; - return NS_OK; -} diff --git a/content/base/src/nsChannelPolicy.h b/content/base/src/nsChannelPolicy.h deleted file mode 100644 index f5a0ba29f0e0..000000000000 --- a/content/base/src/nsChannelPolicy.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nsChannelPolicy_h___ -#define nsChannelPolicy_h___ - -#include "nsCOMPtr.h" -#include "nsIChannelPolicy.h" - -#define NSCHANNELPOLICY_CONTRACTID "@mozilla.org/nschannelpolicy;1" -#define NSCHANNELPOLICY_CID \ -{ 0xd396b3cd, 0xf164, 0x4ce8, \ - { 0x93, 0xa7, 0xe3, 0x85, 0xe1, 0x46, 0x56, 0x3c } } - -class nsChannelPolicy : public nsIChannelPolicy -{ -public: - NS_DECL_ISUPPORTS - NS_DECL_NSICHANNELPOLICY - - nsChannelPolicy(); - -protected: - virtual ~nsChannelPolicy(); - - /* Represents the type of content being loaded in the channel per - * nsIContentPolicy, e.g. TYPE_IMAGE, TYPE_SCRIPT - */ - unsigned long mLoadType; - - /* pointer to a Content Security Policy object if available */ - nsCOMPtr mCSP; -}; - -#endif /* nsChannelPolicy_h___ */ diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp index 33358827edd1..62630be50ffb 100644 --- a/content/base/src/nsContentUtils.cpp +++ b/content/base/src/nsContentUtils.cpp @@ -60,7 +60,6 @@ #include "nsAttrValueInlines.h" #include "nsBindingManager.h" #include "nsCCUncollectableMarker.h" -#include "nsChannelPolicy.h" #include "nsCharSeparatedTokenizer.h" #include "nsCOMPtr.h" #include "nsContentCreatorFunctions.h" @@ -89,7 +88,6 @@ #include "nsIAsyncVerifyRedirectCallback.h" #include "nsICategoryManager.h" #include "nsIChannelEventSink.h" -#include "nsIChannelPolicy.h" #include "nsIChromeRegistry.h" #include "nsIConsoleService.h" #include "nsIContent.h" @@ -3007,20 +3005,6 @@ nsContentUtils::LoadImage(nsIURI* aURI, nsIDocument* aLoadingDocument, NS_ASSERTION(loadGroup || IsFontTableURI(documentURI), "Could not get loadgroup; onload may fire too early"); - // check for a Content Security Policy to pass down to the channel that - // will get created to load the image - nsCOMPtr channelPolicy; - nsCOMPtr csp; - if (aLoadingPrincipal) { - nsresult rv = aLoadingPrincipal->GetCsp(getter_AddRefs(csp)); - NS_ENSURE_SUCCESS(rv, rv); - if (csp) { - channelPolicy = do_CreateInstance("@mozilla.org/nschannelpolicy;1"); - channelPolicy->SetContentSecurityPolicy(csp); - channelPolicy->SetLoadType(nsIContentPolicy::TYPE_IMAGE); - } - } - // Make the URI immutable so people won't change it under us NS_TryToSetImmutable(aURI); @@ -3035,7 +3019,6 @@ nsContentUtils::LoadImage(nsIURI* aURI, nsIDocument* aLoadingDocument, aLoadingDocument, /* uniquification key */ aLoadFlags, /* load flags */ nullptr, /* cache key */ - channelPolicy, /* CSP info */ initiatorType, /* the load initiator */ aRequest); } diff --git a/content/base/src/nsCrossSiteListenerProxy.cpp b/content/base/src/nsCrossSiteListenerProxy.cpp index ab238ea0bfc3..92e15f7f2e1b 100644 --- a/content/base/src/nsCrossSiteListenerProxy.cpp +++ b/content/base/src/nsCrossSiteListenerProxy.cpp @@ -1140,7 +1140,6 @@ NS_StartCORSPreflight(nsIChannel* aRequestChannel, rv = NS_NewChannelInternal(getter_AddRefs(preflightChannel), uri, loadInfo, - nullptr, // aChannelPolicy loadGroup, nullptr, // aCallbacks loadFlags); @@ -1152,7 +1151,6 @@ NS_StartCORSPreflight(nsIChannel* aRequestChannel, nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy loadGroup, nullptr, // aCallbacks loadFlags); diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 8b724ac0f321..0bf6c45da2df 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -1333,7 +1333,6 @@ nsExternalResourceMap::PendingLoad::StartLoad(nsIURI* aURI, aRequestingNode, nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy loadGroup, req); // aCallbacks diff --git a/content/base/src/nsObjectLoadingContent.cpp b/content/base/src/nsObjectLoadingContent.cpp index 3efe85db3d7b..747dfe98343b 100644 --- a/content/base/src/nsObjectLoadingContent.cpp +++ b/content/base/src/nsObjectLoadingContent.cpp @@ -65,8 +65,6 @@ #include "nsObjectLoadingContent.h" #include "mozAutoDocUpdate.h" #include "nsIContentSecurityPolicy.h" -#include "nsIChannelPolicy.h" -#include "nsChannelPolicy.h" #include "GeckoProfiler.h" #include "nsObjectFrame.h" #include "nsDOMClassInfo.h" @@ -2492,15 +2490,6 @@ nsObjectLoadingContent::OpenChannel() nsCOMPtr group = doc->GetDocumentLoadGroup(); nsCOMPtr chan; - nsCOMPtr channelPolicy; - nsCOMPtr csp; - rv = doc->NodePrincipal()->GetCsp(getter_AddRefs(csp)); - NS_ENSURE_SUCCESS(rv, rv); - if (csp) { - channelPolicy = do_CreateInstance("@mozilla.org/nschannelpolicy;1"); - channelPolicy->SetContentSecurityPolicy(csp); - channelPolicy->SetLoadType(nsIContentPolicy::TYPE_OBJECT); - } nsRefPtr shim = new ObjectInterfaceRequestorShim(this); @@ -2522,7 +2511,6 @@ nsObjectLoadingContent::OpenChannel() thisContent, securityFlags, nsIContentPolicy::TYPE_OBJECT, - channelPolicy, group, // aLoadGroup shim, // aCallbacks nsIChannel::LOAD_CALL_CONTENT_SNIFFERS | diff --git a/content/base/src/nsScriptLoader.cpp b/content/base/src/nsScriptLoader.cpp index 357a5139df81..4710cb70b652 100644 --- a/content/base/src/nsScriptLoader.cpp +++ b/content/base/src/nsScriptLoader.cpp @@ -41,8 +41,6 @@ #include "nsDocShellCID.h" #include "nsIContentSecurityPolicy.h" #include "prlog.h" -#include "nsIChannelPolicy.h" -#include "nsChannelPolicy.h" #include "nsCRT.h" #include "nsContentCreatorFunctions.h" #include "nsCrossSiteListenerProxy.h" @@ -305,25 +303,12 @@ nsScriptLoader::StartLoad(nsScriptLoadRequest *aRequest, const nsAString &aType, return NS_OK; } - // check for a Content Security Policy to pass down to the channel - // that will be created to load the script - nsCOMPtr channelPolicy; - nsCOMPtr csp; - rv = mDocument->NodePrincipal()->GetCsp(getter_AddRefs(csp)); - NS_ENSURE_SUCCESS(rv, rv); - if (csp) { - channelPolicy = do_CreateInstance("@mozilla.org/nschannelpolicy;1"); - channelPolicy->SetContentSecurityPolicy(csp); - channelPolicy->SetLoadType(nsIContentPolicy::TYPE_SCRIPT); - } - nsCOMPtr channel; rv = NS_NewChannel(getter_AddRefs(channel), aRequest->mURI, mDocument, nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_SCRIPT, - channelPolicy, loadGroup, prompter, nsIRequest::LOAD_NORMAL | diff --git a/content/base/src/nsSyncLoadService.cpp b/content/base/src/nsSyncLoadService.cpp index 3a675e1a8d6e..6805aca44df9 100644 --- a/content/base/src/nsSyncLoadService.cpp +++ b/content/base/src/nsSyncLoadService.cpp @@ -315,7 +315,6 @@ nsSyncLoadService::LoadDocument(nsIURI *aURI, nsIPrincipal *aLoaderPrincipal, aLoaderPrincipal, nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy aLoadGroup); NS_ENSURE_SUCCESS(rv, rv); diff --git a/content/base/src/nsXMLHttpRequest.cpp b/content/base/src/nsXMLHttpRequest.cpp index 4ae5d1ffb25b..bc4bafa01667 100644 --- a/content/base/src/nsXMLHttpRequest.cpp +++ b/content/base/src/nsXMLHttpRequest.cpp @@ -51,8 +51,6 @@ #include "nsIPromptFactory.h" #include "nsIWindowWatcher.h" #include "nsIConsoleService.h" -#include "nsIChannelPolicy.h" -#include "nsChannelPolicy.h" #include "nsIContentSecurityPolicy.h" #include "nsAsyncRedirectVerifyHelper.h" #include "nsStringBuffer.h" @@ -1724,17 +1722,6 @@ nsXMLHttpRequest::Open(const nsACString& inMethod, const nsACString& url, // will be automatically aborted if the user leaves the page. nsCOMPtr loadGroup = GetLoadGroup(); - // get Content Security Policy from principal to pass into channel - nsCOMPtr channelPolicy; - nsCOMPtr csp; - rv = mPrincipal->GetCsp(getter_AddRefs(csp)); - NS_ENSURE_SUCCESS(rv, rv); - if (csp) { - channelPolicy = do_CreateInstance("@mozilla.org/nschannelpolicy;1"); - channelPolicy->SetContentSecurityPolicy(csp); - channelPolicy->SetLoadType(nsIContentPolicy::TYPE_XMLHTTPREQUEST); - } - nsSecurityFlags secFlags = nsILoadInfo::SEC_NORMAL; if (IsSystemXHR()) { // Don't give this document the system principal. We need to keep track of @@ -1754,7 +1741,6 @@ nsXMLHttpRequest::Open(const nsACString& inMethod, const nsACString& url, doc, secFlags, nsIContentPolicy::TYPE_XMLHTTPREQUEST, - channelPolicy, loadGroup, nullptr, // aCallbacks nsIRequest::LOAD_BACKGROUND); @@ -1765,7 +1751,6 @@ nsXMLHttpRequest::Open(const nsACString& inMethod, const nsACString& url, mPrincipal, secFlags, nsIContentPolicy::TYPE_XMLHTTPREQUEST, - channelPolicy, loadGroup, nullptr, // aCallbacks nsIRequest::LOAD_BACKGROUND); diff --git a/content/html/content/src/HTMLMediaElement.cpp b/content/html/content/src/HTMLMediaElement.cpp index 91f47a39d5eb..91522f12f3b9 100755 --- a/content/html/content/src/HTMLMediaElement.cpp +++ b/content/html/content/src/HTMLMediaElement.cpp @@ -99,8 +99,6 @@ static PRLogModuleInfo* gMediaElementEventsLog; #endif #include "nsIContentSecurityPolicy.h" -#include "nsIChannelPolicy.h" -#include "nsChannelPolicy.h" #include "mozilla/Preferences.h" @@ -1182,25 +1180,12 @@ nsresult HTMLMediaElement::LoadResource() } nsCOMPtr loadGroup = GetDocumentLoadGroup(); - - // check for a Content Security Policy to pass down to the channel - // created to load the media content - nsCOMPtr channelPolicy; - nsCOMPtr csp; - rv = NodePrincipal()->GetCsp(getter_AddRefs(csp)); - NS_ENSURE_SUCCESS(rv,rv); - if (csp) { - channelPolicy = do_CreateInstance("@mozilla.org/nschannelpolicy;1"); - channelPolicy->SetContentSecurityPolicy(csp); - channelPolicy->SetLoadType(nsIContentPolicy::TYPE_MEDIA); - } nsCOMPtr channel; rv = NS_NewChannel(getter_AddRefs(channel), mLoadingSrc, static_cast(this), nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_MEDIA, - channelPolicy, loadGroup, nullptr, // aCallbacks nsICachingChannel::LOAD_BYPASS_LOCAL_CACHE_IF_BUSY | diff --git a/content/html/content/src/HTMLTrackElement.cpp b/content/html/content/src/HTMLTrackElement.cpp index 5c21c4cc6f59..db01a4d5608c 100644 --- a/content/html/content/src/HTMLTrackElement.cpp +++ b/content/html/content/src/HTMLTrackElement.cpp @@ -21,7 +21,6 @@ #include "nsIAsyncVerifyRedirectCallback.h" #include "nsICachingChannel.h" #include "nsIChannelEventSink.h" -#include "nsIChannelPolicy.h" #include "nsIContentPolicy.h" #include "nsIContentSecurityPolicy.h" #include "nsIDocument.h" @@ -237,20 +236,6 @@ HTMLTrackElement::LoadResource() CreateTextTrack(); } - // Check for a Content Security Policy to pass down to the channel - // created to load the media content. - nsCOMPtr channelPolicy; - nsCOMPtr csp; - rv = NodePrincipal()->GetCsp(getter_AddRefs(csp)); - NS_ENSURE_TRUE_VOID(NS_SUCCEEDED(rv)); - if (csp) { - channelPolicy = do_CreateInstance("@mozilla.org/nschannelpolicy;1"); - if (!channelPolicy) { - return; - } - channelPolicy->SetContentSecurityPolicy(csp); - channelPolicy->SetLoadType(nsIContentPolicy::TYPE_MEDIA); - } nsCOMPtr channel; nsCOMPtr loadGroup = OwnerDoc()->GetDocumentLoadGroup(); rv = NS_NewChannel(getter_AddRefs(channel), @@ -258,7 +243,6 @@ HTMLTrackElement::LoadResource() static_cast(this), nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_MEDIA, - channelPolicy, loadGroup); NS_ENSURE_TRUE_VOID(NS_SUCCEEDED(rv)); diff --git a/content/html/document/src/nsHTMLDocument.cpp b/content/html/document/src/nsHTMLDocument.cpp index 0678c81353db..e1de1ccb2793 100644 --- a/content/html/document/src/nsHTMLDocument.cpp +++ b/content/html/document/src/nsHTMLDocument.cpp @@ -1516,7 +1516,6 @@ nsHTMLDocument::Open(JSContext* cx, callerDoc, nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy group); if (rv.Failed()) { diff --git a/content/media/MediaResource.cpp b/content/media/MediaResource.cpp index 7f391861d8c3..6502a31ebd62 100644 --- a/content/media/MediaResource.cpp +++ b/content/media/MediaResource.cpp @@ -936,7 +936,6 @@ ChannelMediaResource::RecreateChannel() element, nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_MEDIA, - nullptr, // aChannelPolicy loadGroup, nullptr, // aCallbacks loadFlags); @@ -1443,7 +1442,6 @@ already_AddRefed FileMediaResource::CloneData(MediaDecoder* aDeco element, nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_MEDIA, - nullptr, // aChannelPolicy loadGroup); if (NS_FAILED(rv)) diff --git a/content/xul/document/src/XULDocument.cpp b/content/xul/document/src/XULDocument.cpp index 4c84440ba0a1..8d34b18d09c1 100644 --- a/content/xul/document/src/XULDocument.cpp +++ b/content/xul/document/src/XULDocument.cpp @@ -2701,7 +2701,6 @@ XULDocument::LoadOverlayInternal(nsIURI* aURI, bool aIsDynamic, NodePrincipal(), nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy group); if (NS_SUCCEEDED(rv)) { diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 27f00a87bf15..5ab982ce4e19 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -173,7 +173,6 @@ #endif #include "nsContentUtils.h" -#include "nsIChannelPolicy.h" #include "nsIContentSecurityPolicy.h" #include "nsILoadInfo.h" #include "nsSandboxFlags.h" @@ -10094,27 +10093,7 @@ nsDocShell::DoURILoad(nsIURI * aURI, loadFlags |= nsIChannel::LOAD_BACKGROUND; } - // check for Content Security Policy to pass along with the - // new channel we are creating - nsCOMPtr channelPolicy; if (IsFrame()) { - // check the parent docshell for a CSP - nsCOMPtr csp; - nsCOMPtr parentItem; - GetSameTypeParent(getter_AddRefs(parentItem)); - if (parentItem) { - nsCOMPtr doc = parentItem->GetDocument(); - if (doc) { - rv = doc->NodePrincipal()->GetCsp(getter_AddRefs(csp)); - NS_ENSURE_SUCCESS(rv, rv); - if (csp) { - channelPolicy = do_CreateInstance("@mozilla.org/nschannelpolicy;1"); - channelPolicy->SetContentSecurityPolicy(csp); - channelPolicy->SetLoadType(nsIContentPolicy::TYPE_SUBDOCUMENT); - } - } - } - // Only allow view-source scheme in top-level docshells. view-source is // the only scheme to which this applies at the moment due to potential // timing attacks to read data from cross-origin iframes. If this widens @@ -10183,7 +10162,6 @@ nsDocShell::DoURILoad(nsIURI * aURI, requestingPrincipal, securityFlags, aContentPolicyType, - channelPolicy, nullptr, // loadGroup static_cast(this), loadFlags); diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index e962cf06f43b..663e607fb860 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -66,7 +66,6 @@ #include "mozIApplication.h" #include "WidgetUtils.h" #include "mozIThirdPartyUtil.h" -#include "nsChannelPolicy.h" #ifdef MOZ_MEDIA_NAVIGATOR #include "MediaManager.h" @@ -1059,26 +1058,11 @@ Navigator::SendBeacon(const nsAString& aUrl, } nsCOMPtr channel; - nsCOMPtr channelPolicy; - nsCOMPtr csp; - rv = principal->GetCsp(getter_AddRefs(csp)); - if (NS_FAILED(rv)) { - aRv.Throw(NS_ERROR_FAILURE); - return false; - } - - if (csp) { - channelPolicy = do_CreateInstance(NSCHANNELPOLICY_CONTRACTID); - channelPolicy->SetContentSecurityPolicy(csp); - channelPolicy->SetLoadType(nsIContentPolicy::TYPE_BEACON); - } - rv = NS_NewChannel(getter_AddRefs(channel), uri, doc, nsILoadInfo::SEC_NORMAL, - nsIContentPolicy::TYPE_BEACON, - channelPolicy); + nsIContentPolicy::TYPE_BEACON); if (NS_FAILED(rv)) { aRv.Throw(rv); diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp index d8fc59477428..ec70c22afa0c 100644 --- a/dom/plugins/base/nsPluginHost.cpp +++ b/dom/plugins/base/nsPluginHost.cpp @@ -2857,7 +2857,6 @@ nsresult nsPluginHost::NewPluginURLStream(const nsString& aURL, principal, nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL, nsIContentPolicy::TYPE_OBJECT_SUBREQUEST, - nullptr, // aChannelPolicy nullptr, // aLoadGroup listenerPeer); diff --git a/dom/plugins/base/nsPluginStreamListenerPeer.cpp b/dom/plugins/base/nsPluginStreamListenerPeer.cpp index 54f2afb92a0a..ab00a1d97216 100644 --- a/dom/plugins/base/nsPluginStreamListenerPeer.cpp +++ b/dom/plugins/base/nsPluginStreamListenerPeer.cpp @@ -662,7 +662,6 @@ nsPluginStreamListenerPeer::RequestRead(NPByteRange* rangeList) principal, nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy loadGroup, callbacks); diff --git a/dom/workers/ScriptLoader.cpp b/dom/workers/ScriptLoader.cpp index c4f6aa37c082..1f4b4b6841b8 100644 --- a/dom/workers/ScriptLoader.cpp +++ b/dom/workers/ScriptLoader.cpp @@ -6,7 +6,6 @@ #include "ScriptLoader.h" #include "nsIChannel.h" -#include "nsIChannelPolicy.h" #include "nsIContentPolicy.h" #include "nsIContentSecurityPolicy.h" #include "nsIHttpChannel.h" @@ -17,7 +16,6 @@ #include "nsIURI.h" #include "jsapi.h" -#include "nsChannelPolicy.h" #include "nsError.h" #include "nsContentPolicyUtils.h" #include "nsContentUtils.h" @@ -104,23 +102,6 @@ ChannelFromScriptURL(nsIPrincipal* principal, NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_SECURITY_ERR); } - // Get Content Security Policy from parent document to pass into channel. - nsCOMPtr csp; - rv = principal->GetCsp(getter_AddRefs(csp)); - NS_ENSURE_SUCCESS(rv, rv); - - nsCOMPtr channelPolicy; - if (csp) { - channelPolicy = do_CreateInstance(NSCHANNELPOLICY_CONTRACTID, &rv); - NS_ENSURE_SUCCESS(rv, rv); - - rv = channelPolicy->SetContentSecurityPolicy(csp); - NS_ENSURE_SUCCESS(rv, rv); - - rv = channelPolicy->SetLoadType(nsIContentPolicy::TYPE_SCRIPT); - NS_ENSURE_SUCCESS(rv, rv); - } - uint32_t flags = nsIRequest::LOAD_NORMAL | nsIChannel::LOAD_CLASSIFY_URI; nsCOMPtr channel; @@ -131,7 +112,6 @@ ChannelFromScriptURL(nsIPrincipal* principal, parentDoc, nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_SCRIPT, - channelPolicy, loadGroup, nullptr, // aCallbacks flags, @@ -148,7 +128,6 @@ ChannelFromScriptURL(nsIPrincipal* principal, nullPrincipal, nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_SCRIPT, - channelPolicy, loadGroup, nullptr, // aCallbacks flags, diff --git a/dom/xbl/nsXBLService.cpp b/dom/xbl/nsXBLService.cpp index 22d2b07d370b..eac4d6c9fa03 100644 --- a/dom/xbl/nsXBLService.cpp +++ b/dom/xbl/nsXBLService.cpp @@ -1076,7 +1076,6 @@ nsXBLService::FetchBindingDocument(nsIContent* aBoundElement, nsIDocument* aBoun requestingPrincipal, nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy loadGroup); NS_ENSURE_SUCCESS(rv, rv); diff --git a/dom/xml/XMLDocument.cpp b/dom/xml/XMLDocument.cpp index ebd093a5f548..2d1bc1d20974 100644 --- a/dom/xml/XMLDocument.cpp +++ b/dom/xml/XMLDocument.cpp @@ -449,7 +449,6 @@ XMLDocument::Load(const nsAString& aUrl, ErrorResult& aRv) static_cast(this), nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_XMLHTTPREQUEST, - nullptr, // aChannelPolicy loadGroup, req, nsIRequest::LOAD_BACKGROUND); diff --git a/dom/xslt/base/txURIUtils.cpp b/dom/xslt/base/txURIUtils.cpp index ebcc484d21d6..b2a78db2e47d 100644 --- a/dom/xslt/base/txURIUtils.cpp +++ b/dom/xslt/base/txURIUtils.cpp @@ -64,7 +64,6 @@ URIUtils::ResetWithSource(nsIDocument *aNewDoc, nsIDOMNode *aSourceNode) sourceDoc, nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy loadGroup); if (NS_FAILED(rv)) { diff --git a/embedding/browser/nsContextMenuInfo.cpp b/embedding/browser/nsContextMenuInfo.cpp index 6a15401444b2..0b4733071c0b 100644 --- a/embedding/browser/nsContextMenuInfo.cpp +++ b/embedding/browser/nsContextMenuInfo.cpp @@ -23,7 +23,6 @@ #include "nsUnicharUtils.h" #include "nsIDocument.h" #include "nsIPrincipal.h" -#include "nsIChannelPolicy.h" #include "nsIContentSecurityPolicy.h" #include "nsIContentPolicy.h" #include "nsAutoPtr.h" @@ -268,22 +267,9 @@ nsContextMenuInfo::GetBackgroundImageRequestInternal(nsIDOMNode *aDOMNode, imgRe nsCOMPtr primitiveValue; nsAutoString bgStringValue; - // get Content Security Policy to pass to LoadImage nsCOMPtr doc(do_QueryInterface(document)); - nsCOMPtr principal; - nsCOMPtr channelPolicy; - nsCOMPtr csp; - if (doc) { - principal = doc->NodePrincipal(); - nsresult rv = principal->GetCsp(getter_AddRefs(csp)); - NS_ENSURE_SUCCESS(rv, rv); - if (csp) { - channelPolicy = do_CreateInstance("@mozilla.org/nschannelpolicy;1"); - channelPolicy->SetContentSecurityPolicy(csp); - channelPolicy->SetLoadType(nsIContentPolicy::TYPE_IMAGE); - } - } - + nsCOMPtr principal = doc ? doc->NodePrincipal() : nullptr; + while (true) { nsCOMPtr domElement(do_QueryInterface(domNode)); // bail for the parent node of the root element or null argument @@ -310,7 +296,7 @@ nsContextMenuInfo::GetBackgroundImageRequestInternal(nsIDOMNode *aDOMNode, imgRe return il->LoadImage(bgUri, nullptr, nullptr, principal, nullptr, nullptr, nullptr, nsIRequest::LOAD_NORMAL, - nullptr, channelPolicy, EmptyString(), aRequest); + nullptr, EmptyString(), aRequest); } } diff --git a/embedding/components/webbrowserpersist/nsWebBrowserPersist.cpp b/embedding/components/webbrowserpersist/nsWebBrowserPersist.cpp index cbfef03aa9fa..dad12ded7f69 100644 --- a/embedding/components/webbrowserpersist/nsWebBrowserPersist.cpp +++ b/embedding/components/webbrowserpersist/nsWebBrowserPersist.cpp @@ -1205,7 +1205,6 @@ nsresult nsWebBrowserPersist::SaveURIInternal( nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy nullptr, // aLoadGroup static_cast(this), loadFlags); diff --git a/extensions/pref/autoconfig/src/nsAutoConfig.cpp b/extensions/pref/autoconfig/src/nsAutoConfig.cpp index 565bdb20ca25..8b81bbef5e3c 100644 --- a/extensions/pref/autoconfig/src/nsAutoConfig.cpp +++ b/extensions/pref/autoconfig/src/nsAutoConfig.cpp @@ -285,7 +285,6 @@ nsresult nsAutoConfig::downloadAutoConfig() nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy nullptr, // loadGroup nullptr, // aCallbacks nsIRequest::INHIBIT_PERSISTENT_CACHING | diff --git a/image/public/imgILoader.idl b/image/public/imgILoader.idl index cf751632aae7..b47c34b092da 100644 --- a/image/public/imgILoader.idl +++ b/image/public/imgILoader.idl @@ -16,7 +16,6 @@ interface nsIStreamListener; interface nsIURI; interface nsISimpleEnumerator; -interface nsIChannelPolicy; #include "nsIRequest.idl" // for nsLoadFlags @@ -62,8 +61,7 @@ interface imgILoader : nsISupports in imgINotificationObserver aObserver, in nsISupports aCX, in nsLoadFlags aLoadFlags, - in nsISupports cacheKey, - in nsIChannelPolicy channelPolicy); + in nsISupports cacheKey); /** * Start the load and decode of an image. diff --git a/image/src/imgLoader.cpp b/image/src/imgLoader.cpp index 066878e395c9..3659565cd952 100644 --- a/image/src/imgLoader.cpp +++ b/image/src/imgLoader.cpp @@ -634,7 +634,6 @@ static nsresult NewImageChannel(nsIChannel **aResult, nsILoadGroup *aLoadGroup, const nsCString& aAcceptHeader, nsLoadFlags aLoadFlags, - nsIChannelPolicy *aPolicy, nsIPrincipal *aLoadingPrincipal, nsISupports *aRequestingContext) { @@ -690,7 +689,6 @@ static nsresult NewImageChannel(nsIChannel **aResult, requestingPrincipal, securityFlags, nsIContentPolicy::TYPE_IMAGE, - aPolicy, nullptr, // loadGroup callbacks, aLoadFlags); @@ -1454,7 +1452,6 @@ bool imgLoader::ValidateRequestWithNewChannel(imgRequest *request, nsISupports *aCX, nsLoadFlags aLoadFlags, imgRequestProxy **aProxyRequest, - nsIChannelPolicy *aPolicy, nsIPrincipal* aLoadingPrincipal, int32_t aCORSMode) { @@ -1502,7 +1499,6 @@ bool imgLoader::ValidateRequestWithNewChannel(imgRequest *request, aLoadGroup, mAcceptHeader, aLoadFlags, - aPolicy, aLoadingPrincipal, aCX); if (NS_FAILED(rv)) { @@ -1582,7 +1578,6 @@ bool imgLoader::ValidateEntry(imgCacheEntry *aEntry, nsLoadFlags aLoadFlags, bool aCanMakeNewChannel, imgRequestProxy **aProxyRequest, - nsIChannelPolicy *aPolicy, nsIPrincipal* aLoadingPrincipal, int32_t aCORSMode) { @@ -1687,7 +1682,7 @@ bool imgLoader::ValidateEntry(imgCacheEntry *aEntry, return ValidateRequestWithNewChannel(request, aURI, aInitialDocumentURI, aReferrerURI, aLoadGroup, aObserver, - aCX, aLoadFlags, aProxyRequest, aPolicy, + aCX, aLoadFlags, aProxyRequest, aLoadingPrincipal, aCORSMode); } @@ -1862,7 +1857,6 @@ NS_IMETHODIMP imgLoader::LoadImageXPCOM(nsIURI *aURI, nsISupports *aCX, nsLoadFlags aLoadFlags, nsISupports *aCacheKey, - nsIChannelPolicy *aPolicy, imgIRequest **_retval) { imgRequestProxy *proxy; @@ -1875,29 +1869,32 @@ NS_IMETHODIMP imgLoader::LoadImageXPCOM(nsIURI *aURI, aCX, aLoadFlags, aCacheKey, - aPolicy, EmptyString(), &proxy); *_retval = proxy; return result; } - - -/* imgIRequest loadImage(in nsIURI aURI, in nsIURI aInitialDocumentURL, in nsIURI aReferrerURI, in nsIPrincipal aLoadingPrincipal, in nsILoadGroup aLoadGroup, in imgINotificationObserver aObserver, in nsISupports aCX, in nsLoadFlags aLoadFlags, in nsISupports cacheKey, in nsIChannelPolicy channelPolicy); */ - +// imgIRequest loadImage(in nsIURI aURI, +// in nsIURI aInitialDocumentURL, +// in nsIURI aReferrerURI, +// in nsIPrincipal aLoadingPrincipal, +// in nsILoadGroup aLoadGroup, +// in imgINotificationObserver aObserver, +// in nsISupports aCX, +// in nsLoadFlags aLoadFlags, +// in nsISupports cacheKey); nsresult imgLoader::LoadImage(nsIURI *aURI, - nsIURI *aInitialDocumentURI, - nsIURI *aReferrerURI, - nsIPrincipal* aLoadingPrincipal, - nsILoadGroup *aLoadGroup, - imgINotificationObserver *aObserver, - nsISupports *aCX, - nsLoadFlags aLoadFlags, - nsISupports *aCacheKey, - nsIChannelPolicy *aPolicy, - const nsAString& initiatorType, - imgRequestProxy **_retval) + nsIURI *aInitialDocumentURI, + nsIURI *aReferrerURI, + nsIPrincipal* aLoadingPrincipal, + nsILoadGroup *aLoadGroup, + imgINotificationObserver *aObserver, + nsISupports *aCX, + nsLoadFlags aLoadFlags, + nsISupports *aCacheKey, + const nsAString& initiatorType, + imgRequestProxy **_retval) { VerifyCacheSizes(); @@ -1975,7 +1972,7 @@ nsresult imgLoader::LoadImage(nsIURI *aURI, if (cache.Get(spec, getter_AddRefs(entry)) && entry) { if (ValidateEntry(entry, aURI, aInitialDocumentURI, aReferrerURI, aLoadGroup, aObserver, aCX, requestFlags, true, - _retval, aPolicy, aLoadingPrincipal, corsmode)) { + _retval, aLoadingPrincipal, corsmode)) { request = entry->GetRequest(); // If this entry has no proxies, its request has no reference to the entry. @@ -2017,7 +2014,6 @@ nsresult imgLoader::LoadImage(nsIURI *aURI, aLoadGroup, mAcceptHeader, requestFlags, - aPolicy, aLoadingPrincipal, aCX); if (NS_FAILED(rv)) @@ -2201,7 +2197,7 @@ nsresult imgLoader::LoadImageWithChannel(nsIChannel *channel, imgINotificationOb // XXX -- should this be changed? it's pretty much verbatim from the old // code, but seems nonsensical. if (ValidateEntry(entry, uri, nullptr, nullptr, nullptr, aObserver, aCX, - requestFlags, false, nullptr, nullptr, nullptr, + requestFlags, false, nullptr, nullptr, imgIRequest::CORS_NONE)) { request = entry->GetRequest(); } else { diff --git a/image/src/imgLoader.h b/image/src/imgLoader.h index 334a3a16b260..620457651086 100644 --- a/image/src/imgLoader.h +++ b/image/src/imgLoader.h @@ -29,7 +29,6 @@ class imgINotificationObserver; class nsILoadGroup; class imgCacheExpirationTracker; class imgMemoryReporter; -class nsIChannelPolicy; namespace mozilla { namespace image { @@ -258,7 +257,6 @@ public: nsISupports *aCX, nsLoadFlags aLoadFlags, nsISupports *aCacheKey, - nsIChannelPolicy *aPolicy, const nsAString& initiatorType, imgRequestProxy **_retval); nsresult LoadImageWithChannel(nsIChannel *channel, @@ -340,7 +338,6 @@ private: // methods imgINotificationObserver *aObserver, nsISupports *aCX, nsLoadFlags aLoadFlags, bool aCanMakeNewChannel, imgRequestProxy **aProxyRequest, - nsIChannelPolicy *aPolicy, nsIPrincipal* aLoadingPrincipal, int32_t aCORSMode); @@ -351,7 +348,6 @@ private: // methods imgINotificationObserver *aObserver, nsISupports *aCX, nsLoadFlags aLoadFlags, imgRequestProxy **aProxyRequest, - nsIChannelPolicy *aPolicy, nsIPrincipal* aLoadingPrincipal, int32_t aCORSMode); diff --git a/js/xpconnect/loader/mozJSSubScriptLoader.cpp b/js/xpconnect/loader/mozJSSubScriptLoader.cpp index ce6c072c1a72..9cbec3d8e05a 100644 --- a/js/xpconnect/loader/mozJSSubScriptLoader.cpp +++ b/js/xpconnect/loader/mozJSSubScriptLoader.cpp @@ -113,7 +113,6 @@ mozJSSubScriptLoader::ReadScript(nsIURI *uri, JSContext *cx, JSObject *targetObj nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy nullptr, // aLoadGroup nullptr, // aCallbacks nsIRequest::LOAD_NORMAL, diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp index 09e2e3dda387..e6ed90d804ec 100644 --- a/layout/build/nsLayoutModule.cpp +++ b/layout/build/nsLayoutModule.cpp @@ -61,7 +61,6 @@ #include "mozilla/dom/DOMParser.h" #include "nsDOMSerializer.h" #include "nsXMLHttpRequest.h" -#include "nsChannelPolicy.h" // view stuff #include "nsContentCreatorFunctions.h" @@ -281,7 +280,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(DOMParser) NS_GENERIC_FACTORY_CONSTRUCTOR(Exception) NS_GENERIC_FACTORY_CONSTRUCTOR(DOMSessionStorageManager) NS_GENERIC_FACTORY_CONSTRUCTOR(DOMLocalStorageManager) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsChannelPolicy) NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(DOMRequestService, DOMRequestService::FactoryCreate) NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(QuotaManager, @@ -747,7 +745,6 @@ NS_DEFINE_NAMED_CID(NS_EVENTLISTENERSERVICE_CID); NS_DEFINE_NAMED_CID(NS_GLOBALMESSAGEMANAGER_CID); NS_DEFINE_NAMED_CID(NS_PARENTPROCESSMESSAGEMANAGER_CID); NS_DEFINE_NAMED_CID(NS_CHILDPROCESSMESSAGEMANAGER_CID); -NS_DEFINE_NAMED_CID(NSCHANNELPOLICY_CID); NS_DEFINE_NAMED_CID(NS_SCRIPTSECURITYMANAGER_CID); NS_DEFINE_NAMED_CID(NS_PRINCIPAL_CID); NS_DEFINE_NAMED_CID(NS_SYSTEMPRINCIPAL_CID); @@ -1040,7 +1037,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = { { &kNS_GLOBALMESSAGEMANAGER_CID, false, nullptr, CreateGlobalMessageManager }, { &kNS_PARENTPROCESSMESSAGEMANAGER_CID, false, nullptr, CreateParentMessageManager }, { &kNS_CHILDPROCESSMESSAGEMANAGER_CID, false, nullptr, CreateChildMessageManager }, - { &kNSCHANNELPOLICY_CID, false, nullptr, nsChannelPolicyConstructor }, { &kNS_SCRIPTSECURITYMANAGER_CID, false, nullptr, Construct_nsIScriptSecurityManager }, { &kNS_PRINCIPAL_CID, false, nullptr, nsPrincipalConstructor }, { &kNS_SYSTEMPRINCIPAL_CID, false, nullptr, nsSystemPrincipalConstructor }, @@ -1196,7 +1192,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = { { NS_GLOBALMESSAGEMANAGER_CONTRACTID, &kNS_GLOBALMESSAGEMANAGER_CID }, { NS_PARENTPROCESSMESSAGEMANAGER_CONTRACTID, &kNS_PARENTPROCESSMESSAGEMANAGER_CID }, { NS_CHILDPROCESSMESSAGEMANAGER_CONTRACTID, &kNS_CHILDPROCESSMESSAGEMANAGER_CID }, - { NSCHANNELPOLICY_CONTRACTID, &kNSCHANNELPOLICY_CID }, { NS_SCRIPTSECURITYMANAGER_CONTRACTID, &kNS_SCRIPTSECURITYMANAGER_CID }, { NS_GLOBAL_CHANNELEVENTSINK_CONTRACTID, &kNS_SCRIPTSECURITYMANAGER_CID }, { NS_PRINCIPAL_CONTRACTID, &kNS_PRINCIPAL_CID }, diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index c742c78225b0..6b67ee2d55f9 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -1931,7 +1931,6 @@ nsImageFrame::LoadIcon(const nsAString& aSpec, nullptr, /* Not associated with any particular document */ loadFlags, nullptr, - nullptr, /* channel policy not needed */ EmptyString(), aRequest); } diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp index 4e82b4e83b0a..e0f480c2f6e6 100644 --- a/layout/style/Loader.cpp +++ b/layout/style/Loader.cpp @@ -60,7 +60,6 @@ #include "nsIDOMStyleSheet.h" #include "nsError.h" -#include "nsIChannelPolicy.h" #include "nsIContentSecurityPolicy.h" #include "mozilla/dom/EncodingUtils.h" @@ -1552,20 +1551,10 @@ Loader::LoadSheet(SheetLoadData* aLoadData, StyleSheetState aSheetState) mSyncCallback = true; #endif nsCOMPtr loadGroup; - // Content Security Policy information to pass into channel - nsCOMPtr channelPolicy; if (mDocument) { loadGroup = mDocument->GetDocumentLoadGroup(); NS_ASSERTION(loadGroup, "No loadgroup for stylesheet; onload will fire early"); - nsCOMPtr csp; - rv = mDocument->NodePrincipal()->GetCsp(getter_AddRefs(csp)); - NS_ENSURE_SUCCESS(rv, rv); - if (csp) { - channelPolicy = do_CreateInstance("@mozilla.org/nschannelpolicy;1"); - channelPolicy->SetContentSecurityPolicy(csp); - channelPolicy->SetLoadType(nsIContentPolicy::TYPE_STYLESHEET); - } } nsLoadFlags securityFlags = nsILoadInfo::SEC_NORMAL; @@ -1584,7 +1573,6 @@ Loader::LoadSheet(SheetLoadData* aLoadData, StyleSheetState aSheetState) requestingPrincipal, securityFlags, nsIContentPolicy::TYPE_STYLESHEET, - channelPolicy, loadGroup, nullptr, // aCallbacks nsIChannel::LOAD_NORMAL | diff --git a/layout/style/nsFontFaceLoader.cpp b/layout/style/nsFontFaceLoader.cpp index 8f4be37736a7..b6f11c874a59 100644 --- a/layout/style/nsFontFaceLoader.cpp +++ b/layout/style/nsFontFaceLoader.cpp @@ -330,16 +330,6 @@ nsUserFontSet::StartLoad(gfxUserFontEntry* aUserFontEntry, nsCOMPtr loadGroup(ps->GetDocument()->GetDocumentLoadGroup()); nsCOMPtr channel; - // get Content Security Policy from principal to pass into channel - nsCOMPtr channelPolicy; - nsCOMPtr csp; - rv = aUserFontEntry->mPrincipal->GetCsp(getter_AddRefs(csp)); - NS_ENSURE_SUCCESS(rv, rv); - if (csp) { - channelPolicy = do_CreateInstance("@mozilla.org/nschannelpolicy;1"); - channelPolicy->SetContentSecurityPolicy(csp); - channelPolicy->SetLoadType(nsIContentPolicy::TYPE_FONT); - } // Note we are calling NS_NewChannelInternal() with both a node and a // principal. This is because the document where the font is being loaded // might have a different origin from the principal of the stylesheet @@ -350,7 +340,6 @@ nsUserFontSet::StartLoad(gfxUserFontEntry* aUserFontEntry, aUserFontEntry->mPrincipal, nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_FONT, - channelPolicy, loadGroup); NS_ENSURE_SUCCESS(rv, rv); @@ -950,17 +939,6 @@ nsUserFontSet::SyncLoadFontData(gfxUserFontEntry* aFontToLoad, nsresult rv; nsCOMPtr channel; - // get Content Security Policy from principal to pass into channel - nsCOMPtr channelPolicy; - nsCOMPtr csp; - rv = aFontToLoad->mPrincipal->GetCsp(getter_AddRefs(csp)); - NS_ENSURE_SUCCESS(rv, rv); - if (csp) { - channelPolicy = do_CreateInstance("@mozilla.org/nschannelpolicy;1"); - channelPolicy->SetContentSecurityPolicy(csp); - channelPolicy->SetLoadType(nsIContentPolicy::TYPE_FONT); - } - nsIPresShell* ps = mPresContext->PresShell(); if (!ps) { return NS_ERROR_FAILURE; @@ -974,8 +952,7 @@ nsUserFontSet::SyncLoadFontData(gfxUserFontEntry* aFontToLoad, ps->GetDocument(), aFontToLoad->mPrincipal, nsILoadInfo::SEC_NORMAL, - nsIContentPolicy::TYPE_FONT, - channelPolicy); + nsIContentPolicy::TYPE_FONT); NS_ENSURE_SUCCESS(rv, rv); diff --git a/modules/libjar/nsJARChannel.cpp b/modules/libjar/nsJARChannel.cpp index 5ea9bcc24342..4533cf605763 100644 --- a/modules/libjar/nsJARChannel.cpp +++ b/modules/libjar/nsJARChannel.cpp @@ -13,7 +13,6 @@ #include "nsIPrefService.h" #include "nsIPrefBranch.h" #include "nsIViewSourceChannel.h" -#include "nsChannelProperties.h" #include "nsContentUtils.h" #include "nsIScriptSecurityManager.h" diff --git a/netwerk/base/public/moz.build b/netwerk/base/public/moz.build index 9bde21513032..ecba3e7344bb 100644 --- a/netwerk/base/public/moz.build +++ b/netwerk/base/public/moz.build @@ -29,7 +29,6 @@ XPIDL_SOURCES += [ 'nsICancelable.idl', 'nsIChannel.idl', 'nsIChannelEventSink.idl', - 'nsIChannelPolicy.idl', 'nsIChildChannel.idl', 'nsIContentSniffer.idl', 'nsICryptoFIPSInfo.idl', @@ -137,8 +136,6 @@ EXPORTS += [ 'netCore.h', 'nsASocketHandler.h', 'nsAsyncRedirectVerifyHelper.h', - 'nsChannelProperties.h', - 'nsNetStrings.h', 'nsNetUtil.h', 'nsReadLine.h', 'nsStreamListenerWrapper.h', diff --git a/netwerk/base/public/nsChannelProperties.h b/netwerk/base/public/nsChannelProperties.h deleted file mode 100644 index 0323a6f39d13..000000000000 --- a/netwerk/base/public/nsChannelProperties.h +++ /dev/null @@ -1,35 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nsChannelProperties_h__ -#define nsChannelProperties_h__ - -#include "nsStringGlue.h" -#ifdef IMPL_LIBXUL -#include "nsNetStrings.h" -#endif - -/** - * @file - * This file contains constants for properties channels can expose. - * They can be accessed by using QueryInterface to access the nsIPropertyBag - * or nsIPropertyBag2 interface on a channel and reading the value. - */ - - -/** - * Exists to allow content policy mechanism to function properly during channel - * redirects. Contains security contextual information about the load. - * Type: nsIChannelPolicy - */ -#define NS_CHANNEL_PROP_CHANNEL_POLICY_STR "channel-policy" - -#ifdef IMPL_LIBXUL -#define NS_CHANNEL_PROP_CHANNEL_POLICY gNetStrings->kChannelPolicy -#else -#define NS_CHANNEL_PROP_CHANNEL_POLICY \ - NS_LITERAL_STRING(NS_CHANNEL_PROP_CHANNEL_POLICY_STR) -#endif - -#endif diff --git a/netwerk/base/public/nsIChannelPolicy.idl b/netwerk/base/public/nsIChannelPolicy.idl deleted file mode 100644 index 5894db08fcc0..000000000000 --- a/netwerk/base/public/nsIChannelPolicy.idl +++ /dev/null @@ -1,29 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsISupports.idl" - -/** - * A container for policy information to be used during channel creation. - * - * This interface exists to allow the content policy mechanism to function - * properly during channel redirects. Channels can be created with this - * interface placed in the property bag and upon redirect, the interface can - * be transferred from the old channel to the new channel. - */ -[scriptable, uuid(18045e96-1afe-4162-837a-04691267158c)] -interface nsIChannelPolicy : nsISupports -{ - /** - * Indicates what type of content is being loaded, e.g. - * nsIContentPolicy::TYPE_IMAGE - */ - attribute unsigned long loadType; - - /** - * A nsIContentSecurityPolicy object to determine if the load should - * be allowed. - */ - attribute nsISupports contentSecurityPolicy; -}; diff --git a/netwerk/base/public/nsNetStrings.h b/netwerk/base/public/nsNetStrings.h deleted file mode 100644 index 653c34dc3f77..000000000000 --- a/netwerk/base/public/nsNetStrings.h +++ /dev/null @@ -1,24 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nsNetStrings_h__ -#define nsNetStrings_h__ - -#include "nsLiteralString.h" - -/** - * Class on which wide strings are available, to avoid constructing strings - * wherever these strings are used. - */ -class nsNetStrings { -public: - nsNetStrings(); - - const nsLiteralString kChannelPolicy; -}; - -extern nsNetStrings* gNetStrings; - - -#endif diff --git a/netwerk/base/public/nsNetUtil.h b/netwerk/base/public/nsNetUtil.h index a27d01f19613..60cf2e1ee7d6 100644 --- a/netwerk/base/public/nsNetUtil.h +++ b/netwerk/base/public/nsNetUtil.h @@ -32,7 +32,6 @@ #include "nsIIOService.h" #include "nsIServiceManager.h" #include "nsIChannel.h" -#include "nsChannelProperties.h" #include "nsIInputStreamChannel.h" #include "nsITransport.h" #include "nsIStreamTransportService.h" @@ -69,7 +68,6 @@ #include "nsIWritablePropertyBag2.h" #include "nsIIDNService.h" #include "nsIChannelEventSink.h" -#include "nsIChannelPolicy.h" #include "nsISocketProviderService.h" #include "nsISocketProvider.h" #include "nsIRedirectChannelRegistrar.h" @@ -202,7 +200,6 @@ inline nsresult NS_NewChannelInternal(nsIChannel** outChannel, nsIURI* aUri, nsILoadInfo* aLoadInfo, - nsIChannelPolicy* aChannelPolicy = nullptr, nsILoadGroup* aLoadGroup = nullptr, nsIInterfaceRequestor* aCallbacks = nullptr, nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL, @@ -236,14 +233,6 @@ NS_NewChannelInternal(nsIChannel** outChannel, rv = channel->SetLoadFlags(aLoadFlags | (normalLoadFlags & nsIChannel::LOAD_REPLACE)); NS_ENSURE_SUCCESS(rv, rv); } - - if (aChannelPolicy) { - nsCOMPtr props = do_QueryInterface(channel); - if (props) { - props->SetPropertyAsInterface(NS_CHANNEL_PROP_CHANNEL_POLICY, aChannelPolicy); - } - } - channel->SetLoadInfo(aLoadInfo); // If we're sandboxed, make sure to clear any owner the channel @@ -263,7 +252,6 @@ NS_NewChannelInternal(nsIChannel** outChannel, nsIPrincipal* aRequestingPrincipal, nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType, - nsIChannelPolicy* aChannelPolicy = nullptr, nsILoadGroup* aLoadGroup = nullptr, nsIInterfaceRequestor* aCallbacks = nullptr, nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL, @@ -282,7 +270,6 @@ NS_NewChannelInternal(nsIChannel** outChannel, return NS_NewChannelInternal(outChannel, aUri, loadInfo, - aChannelPolicy, aLoadGroup, aCallbacks, aLoadFlags, @@ -295,7 +282,6 @@ NS_NewChannel(nsIChannel** outChannel, nsINode* aRequestingNode, nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType, - nsIChannelPolicy* aChannelPolicy = nullptr, nsILoadGroup* aLoadGroup = nullptr, nsIInterfaceRequestor* aCallbacks = nullptr, nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL, @@ -308,7 +294,6 @@ NS_NewChannel(nsIChannel** outChannel, aRequestingNode->NodePrincipal(), aSecurityFlags, aContentPolicyType, - aChannelPolicy, aLoadGroup, aCallbacks, aLoadFlags, @@ -321,7 +306,6 @@ NS_NewChannel(nsIChannel** outChannel, nsIPrincipal* aRequestingPrincipal, nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType, - nsIChannelPolicy* aChannelPolicy = nullptr, nsILoadGroup* aLoadGroup = nullptr, nsIInterfaceRequestor* aCallbacks = nullptr, nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL, @@ -333,7 +317,6 @@ NS_NewChannel(nsIChannel** outChannel, aRequestingPrincipal, aSecurityFlags, aContentPolicyType, - aChannelPolicy, aLoadGroup, aCallbacks, aLoadFlags, @@ -366,7 +349,6 @@ NS_OpenURIInternal(nsIInputStream** outStream, aRequestingPrincipal, aSecurityFlags, aContentPolicyType, - nullptr, // aChannelPolicy, aLoadGroup, aCallbacks, aLoadFlags, @@ -423,7 +405,6 @@ NS_OpenURIInternal(nsIStreamListener* aListener, nsresult rv = NS_NewChannelInternal(getter_AddRefs(channel), aUri, aLoadInfo, - nullptr, // aChannelPolicy aLoadGroup, aCallbacks, aLoadFlags, @@ -834,7 +815,6 @@ NS_NewStreamLoaderInternal(nsIStreamLoader** outStream, aRequestingPrincipal, aSecurityFlags, aContentPolicyType, - nullptr, // aChannelPolicy aLoadGroup, aCallbacks, aLoadFlags); diff --git a/netwerk/base/src/moz.build b/netwerk/base/src/moz.build index 0fb2fc3a97c1..9539524bbaf8 100644 --- a/netwerk/base/src/moz.build +++ b/netwerk/base/src/moz.build @@ -47,7 +47,6 @@ UNIFIED_SOURCES += [ 'nsMediaFragmentURIParser.cpp', 'nsMIMEInputStream.cpp', 'nsNetAddr.cpp', - 'nsNetStrings.cpp', 'nsNetUtil.cpp', 'nsPACMan.cpp', 'nsPreloadedStream.cpp', diff --git a/netwerk/base/src/nsIncrementalDownload.cpp b/netwerk/base/src/nsIncrementalDownload.cpp index 5859f50b1d02..d13a81213ab7 100644 --- a/netwerk/base/src/nsIncrementalDownload.cpp +++ b/netwerk/base/src/nsIncrementalDownload.cpp @@ -267,7 +267,6 @@ nsIncrementalDownload::ProcessTimeout() nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy nullptr, // loadGroup this, // aCallbacks mLoadFlags); diff --git a/netwerk/base/src/nsNetStrings.cpp b/netwerk/base/src/nsNetStrings.cpp deleted file mode 100644 index cd3ebfac3037..000000000000 --- a/netwerk/base/src/nsNetStrings.cpp +++ /dev/null @@ -1,14 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "nsNetStrings.h" -#include "nsChannelProperties.h" - -nsNetStrings* gNetStrings; - -nsNetStrings::nsNetStrings() - : NS_LITERAL_STRING_INIT(kChannelPolicy, NS_CHANNEL_PROP_CHANNEL_POLICY_STR) -{} - - diff --git a/netwerk/build/nsNetModule.cpp b/netwerk/build/nsNetModule.cpp index 51e20fb53d4b..070762956e7a 100644 --- a/netwerk/build/nsNetModule.cpp +++ b/netwerk/build/nsNetModule.cpp @@ -31,7 +31,6 @@ #include "nsApplicationCache.h" #include "nsApplicationCacheService.h" #include "nsMimeTypes.h" -#include "nsNetStrings.h" #include "nsDNSPrefetch.h" #include "nsAboutProtocolHandler.h" #include "nsXULAppAPI.h" @@ -630,11 +629,9 @@ CreateNewBinaryDetectorFactory(nsISupports *aOuter, REFNSIID aIID, void **aResul // Net module startup hook static nsresult nsNetStartup() { - gNetStrings = new nsNetStrings(); - return gNetStrings ? NS_OK : NS_ERROR_OUT_OF_MEMORY; + return NS_OK; } - // Net module shutdown hook static void nsNetShutdown() { @@ -647,10 +644,6 @@ static void nsNetShutdown() net_ShutdownURLHelperOSX(); #endif - // Release necko strings - delete gNetStrings; - gNetStrings = nullptr; - // Release DNS service reference. nsDNSPrefetch::Shutdown(); diff --git a/netwerk/protocol/ftp/FTPChannelParent.cpp b/netwerk/protocol/ftp/FTPChannelParent.cpp index 3d94e6c16885..1b140c2dcde1 100644 --- a/netwerk/protocol/ftp/FTPChannelParent.cpp +++ b/netwerk/protocol/ftp/FTPChannelParent.cpp @@ -132,7 +132,6 @@ FTPChannelParent::DoAsyncOpen(const URIParams& aURI, requestingPrincipal, aSecurityFlags, aContentPolicyType, - nullptr, // aChannelPolicy nullptr, // aLoadGroup nullptr, // aCallbacks nsIRequest::LOAD_NORMAL, diff --git a/netwerk/protocol/http/HttpChannelParent.cpp b/netwerk/protocol/http/HttpChannelParent.cpp index f16b519fc169..8208d3bd9052 100644 --- a/netwerk/protocol/http/HttpChannelParent.cpp +++ b/netwerk/protocol/http/HttpChannelParent.cpp @@ -219,7 +219,6 @@ HttpChannelParent::DoAsyncOpen( const URIParams& aURI, requestingPrincipal, aSecurityFlags, aContentPolicyType, - nullptr, // aChannelPolicy nullptr, // loadGroup nullptr, // aCallbacks loadFlags, diff --git a/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp b/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp index 41194d233707..474a0e5955a5 100644 --- a/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp +++ b/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp @@ -92,7 +92,6 @@ WyciwygChannelParent::RecvInit(const URIParams& aURI, requestingPrincipal, aSecurityFlags, aContentPolicyType, - nullptr, // aChannelPolicy nullptr, // loadGroup nullptr, // aCallbacks nsIRequest::LOAD_NORMAL, diff --git a/netwerk/test/TestPageLoad.cpp b/netwerk/test/TestPageLoad.cpp index 6402b0e6cb66..fe5002a20193 100644 --- a/netwerk/test/TestPageLoad.cpp +++ b/netwerk/test/TestPageLoad.cpp @@ -312,7 +312,6 @@ nsresult auxLoad(char *uriBuf) systemPrincipal, nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy nullptr, // loadGroup callbacks); @@ -371,7 +370,6 @@ int main(int argc, char **argv) systemPrincipal, nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy nullptr, // loadGroup callbacks); diff --git a/netwerk/test/TestProtocols.cpp b/netwerk/test/TestProtocols.cpp index 3e147adecd58..ec41b840e8fc 100644 --- a/netwerk/test/TestProtocols.cpp +++ b/netwerk/test/TestProtocols.cpp @@ -49,7 +49,6 @@ #include "nsIPropertyBag2.h" #include "nsIWritablePropertyBag2.h" #include "nsITimedChannel.h" -#include "nsChannelProperties.h" #include "mozilla/Attributes.h" #include "mozilla/unused.h" #include "nsIScriptSecurityManager.h" @@ -644,7 +643,6 @@ nsresult StartLoadingURL(const char* aUrlString) systemPrincipal, nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy nullptr, // loadGroup callbacks, nsIRequest::LOAD_NORMAL, diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp index b17ab187aef8..4c67e4969c99 100644 --- a/toolkit/components/downloads/nsDownloadManager.cpp +++ b/toolkit/components/downloads/nsDownloadManager.cpp @@ -3534,7 +3534,6 @@ nsDownload::Resume() nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy nullptr, // aLoadGroup ir); diff --git a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp index 77aaa0bbf560..731070ed997f 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp @@ -99,7 +99,6 @@ nsUrlClassifierStreamUpdater::FetchUpdate(nsIURI *aUpdateUrl, nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy nullptr, // aLoadGroup this, // aInterfaceRequestor loadFlags); diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp index 85475533bc99..9d3a133fc54d 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -57,7 +57,6 @@ #include "nsNetUtil.h" #include "nsIIOService.h" #include "nsNetCID.h" -#include "nsChannelProperties.h" #include "nsMimeTypes.h" // used for header disposition information. diff --git a/uriloader/prefetch/nsOfflineCacheUpdate.cpp b/uriloader/prefetch/nsOfflineCacheUpdate.cpp index 305296309206..769f188e6590 100644 --- a/uriloader/prefetch/nsOfflineCacheUpdate.cpp +++ b/uriloader/prefetch/nsOfflineCacheUpdate.cpp @@ -185,7 +185,6 @@ nsManifestCheck::Begin() nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy nullptr, // loadGroup nullptr, // aCallbacks nsIRequest::LOAD_BYPASS_CACHE); @@ -383,7 +382,6 @@ nsOfflineCacheUpdateItem::OpenChannel(nsOfflineCacheUpdate *aUpdate) nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy nullptr, // aLoadGroup this, // aCallbacks flags); diff --git a/uriloader/prefetch/nsPrefetchService.cpp b/uriloader/prefetch/nsPrefetchService.cpp index ec5a601dd002..71d04d8dbcf1 100644 --- a/uriloader/prefetch/nsPrefetchService.cpp +++ b/uriloader/prefetch/nsPrefetchService.cpp @@ -192,7 +192,6 @@ nsPrefetchNode::OpenChannel() nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy loadGroup, // aLoadGroup this, // aCallbacks nsIRequest::LOAD_BACKGROUND | diff --git a/widget/cocoa/OSXNotificationCenter.mm b/widget/cocoa/OSXNotificationCenter.mm index 43e44db0d6fc..943658e96f42 100644 --- a/widget/cocoa/OSXNotificationCenter.mm +++ b/widget/cocoa/OSXNotificationCenter.mm @@ -244,7 +244,7 @@ OSXNotificationCenter::ShowAlertNotification(const nsAString & aImageUrl, const if (imageUri) { nsresult rv = il->LoadImage(imageUri, nullptr, nullptr, aPrincipal, nullptr, this, nullptr, nsIRequest::LOAD_NORMAL, nullptr, - nullptr, EmptyString(), + EmptyString(), getter_AddRefs(osxni->mIconRequest)); if (NS_SUCCEEDED(rv)) { // Set a timer for six seconds. If we don't have an icon by the time this diff --git a/widget/cocoa/nsMenuItemIconX.mm b/widget/cocoa/nsMenuItemIconX.mm index 9ad01949f060..1150d9fc7986 100644 --- a/widget/cocoa/nsMenuItemIconX.mm +++ b/widget/cocoa/nsMenuItemIconX.mm @@ -305,11 +305,9 @@ nsMenuItemIconX::LoadIcon(nsIURI* aIconURI) [mNativeMenuItem setImage:sPlaceholderIconImage]; } - // Passing in null for channelPolicy here since nsMenuItemIconX::LoadIcon is - // not exposed to web content nsresult rv = loader->LoadImage(aIconURI, nullptr, nullptr, nullptr, loadGroup, this, - nullptr, nsIRequest::LOAD_NORMAL, nullptr, - nullptr, EmptyString(), getter_AddRefs(mIconRequest)); + nullptr, nsIRequest::LOAD_NORMAL, nullptr, + EmptyString(), getter_AddRefs(mIconRequest)); if (NS_FAILED(rv)) return rv; // We need to request the icon be decoded (bug 573583, bug 705516). diff --git a/widget/windows/nsDataObj.cpp b/widget/windows/nsDataObj.cpp index 53291c365667..cd4f2fe8ceb0 100644 --- a/widget/windows/nsDataObj.cpp +++ b/widget/windows/nsDataObj.cpp @@ -74,7 +74,6 @@ nsresult nsDataObj::CStream::Init(nsIURI *pSourceURI, aRequestingNode, nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy nullptr, // loadGroup nullptr, // aCallbacks nsIRequest::LOAD_FROM_CACHE); diff --git a/xpfe/components/directory/nsDirectoryViewer.cpp b/xpfe/components/directory/nsDirectoryViewer.cpp index 8cf610b8ba9c..b54fde367d8c 100644 --- a/xpfe/components/directory/nsDirectoryViewer.cpp +++ b/xpfe/components/directory/nsDirectoryViewer.cpp @@ -1305,7 +1305,6 @@ nsDirectoryViewerFactory::CreateInstance(const char *aCommand, nsContentUtils::GetSystemPrincipal(), nsILoadInfo::SEC_NORMAL, nsIContentPolicy::TYPE_OTHER, - nullptr, // aChannelPolicy aLoadGroup); if (NS_FAILED(rv)) return rv;