From 1273dc5391c444e2cb4c0131395c4f3c80077f0b Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Wed, 30 May 2018 21:21:17 +0200 Subject: [PATCH] Bug 1446933 - Remove 'using namespace mozilla::net' from BackgroundUtils.h, r=qdot --- docshell/base/nsDocShell.cpp | 36 +++++++++---------- dom/base/nsContentUtils.cpp | 10 +++--- dom/base/nsDocument.cpp | 8 ++--- dom/network/TCPSocketParent.cpp | 2 ++ dom/network/UDPSocketParent.cpp | 3 ++ dom/security/nsMixedContentBlocker.cpp | 2 +- dom/serviceworkers/ServiceWorkerContainer.cpp | 10 +++--- dom/serviceworkers/ServiceWorkerEvents.cpp | 2 +- dom/serviceworkers/ServiceWorkerRegistrar.cpp | 4 +-- dom/workers/ScriptLoader.cpp | 2 +- ipc/glue/BackgroundUtils.h | 14 ++++---- ipc/glue/URIUtils.cpp | 2 +- layout/build/nsLayoutModule.cpp | 4 +-- .../peerconnection/PeerConnectionMedia.cpp | 2 +- netwerk/base/nsAsyncStreamCopier.cpp | 1 + netwerk/base/nsBaseChannel.cpp | 2 +- netwerk/base/nsIncrementalDownload.cpp | 1 + netwerk/base/nsInputStreamPump.cpp | 2 +- netwerk/base/nsNetUtil.cpp | 15 ++++---- netwerk/base/nsStandardURL.cpp | 2 +- netwerk/build/nsNetModule.cpp | 1 + netwerk/cookie/nsCookieService.cpp | 2 +- netwerk/protocol/data/nsDataChannel.cpp | 2 +- netwerk/protocol/data/nsDataHandler.cpp | 2 +- netwerk/protocol/http/HttpBaseChannel.cpp | 2 +- netwerk/protocol/http/nsCORSListenerProxy.cpp | 5 +-- netwerk/protocol/http/nsIHttpChannelChild.idl | 2 +- netwerk/protocol/res/nsResProtocolHandler.h | 18 +++++----- security/manager/ssl/PSMContentListener.cpp | 2 +- .../webrequest/StreamFilterParent.cpp | 4 +-- .../components/places/nsFaviconService.cpp | 14 ++++---- .../exthandler/ExternalHelperAppParent.cpp | 2 +- .../exthandler/nsExternalProtocolHandler.cpp | 2 +- 33 files changed, 94 insertions(+), 88 deletions(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 51c34605c011..caf70bfad5a4 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -225,6 +225,7 @@ using namespace mozilla; using namespace mozilla::dom; +using namespace mozilla::net; // Threshold value in ms for META refresh based redirects #define REFRESH_REDIRECT_TIMER 15000 @@ -683,7 +684,7 @@ nsDocShell::LoadURI(nsIURI* aURI, bool inheritPrincipal = false; bool principalIsExplicit = false; bool sendReferrer = true; - uint32_t referrerPolicy = mozilla::net::RP_Unset; + uint32_t referrerPolicy = RP_Unset; bool isSrcdoc = false; nsCOMPtr shEntry; nsString target; @@ -4223,7 +4224,7 @@ nsDocShell::LoadURI(const char16_t* aURI, nsIPrincipal* aTriggeringPrincipal) { return LoadURIWithOptions(aURI, aLoadFlags, aReferringURI, - mozilla::net::RP_Unset, aPostStream, + RP_Unset, aPostStream, aHeaderStream, nullptr, aTriggeringPrincipal); } @@ -4919,8 +4920,7 @@ nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL, nsresult rv = NS_NewURI(getter_AddRefs(errorPageURI), errorPageUrl); NS_ENSURE_SUCCESS(rv, rv); - return InternalLoad(errorPageURI, nullptr, Nothing(), false, nullptr, - mozilla::net::RP_Unset, + return InternalLoad(errorPageURI, nullptr, Nothing(), false, nullptr, RP_Unset, nsContentUtils::GetSystemPrincipal(), nullptr, INTERNAL_LOAD_FLAGS_NONE, EmptyString(), nullptr, VoidString(), nullptr, nullptr, @@ -7472,8 +7472,7 @@ nsDocShell::EndPageLoad(nsIWebProgress* aProgress, // If we have a host nsCOMPtr loadInfo = aChannel->GetLoadInfo(); if (loadInfo) { - mozilla::net::PredictorLearnRedirect(url, aChannel, - loadInfo->GetOriginAttributes()); + PredictorLearnRedirect(url, aChannel, loadInfo->GetOriginAttributes()); } } @@ -10202,10 +10201,10 @@ nsDocShell::InternalLoad(nsIURI* aURI, OriginAttributes attrs = GetOriginAttributes(); attrs.SetFirstPartyDomain(isTopLevelDoc, aURI); - net::PredictorLearn(aURI, nullptr, - nsINetworkPredictor::LEARN_LOAD_TOPLEVEL, attrs); - net::PredictorPredict(aURI, nullptr, - nsINetworkPredictor::PREDICT_LOAD, attrs, nullptr); + PredictorLearn(aURI, nullptr, + nsINetworkPredictor::LEARN_LOAD_TOPLEVEL, attrs); + PredictorPredict(aURI, nullptr, + nsINetworkPredictor::PREDICT_LOAD, attrs, nullptr); nsCOMPtr req; rv = DoURILoad(aURI, aOriginalURI, aResultPrincipalURI, aLoadReplace, @@ -10642,7 +10641,7 @@ nsDocShell::DoURILoad(nsIURI* aURI, getter_AddRefs(resultPrincipal)); NS_ENSURE_SUCCESS(rv, rv); if (IsConsideredSameOriginForUIR(aTriggeringPrincipal, resultPrincipal)) { - static_cast(loadInfo.get())->SetUpgradeInsecureRequests(); + static_cast(loadInfo.get())->SetUpgradeInsecureRequests(); } } } @@ -11973,7 +11972,7 @@ nsDocShell::AddToSessionHistory(nsIURI* aURI, nsIChannel* aChannel, nsCOMPtr resultPrincipalURI; bool loadReplace = false; nsCOMPtr referrerURI; - uint32_t referrerPolicy = mozilla::net::RP_Unset; + uint32_t referrerPolicy = RP_Unset; uint32_t cacheKey = 0; nsCOMPtr triggeringPrincipal = aTriggeringPrincipal; nsCOMPtr principalToInherit = aPrincipalToInherit; @@ -13517,8 +13516,9 @@ nsDocShell::OnLinkClickSync(nsIContent* aContent, // if per element referrer is enabled, the element referrer overrules // the document wide referrer if (IsElementAnchorOrArea(aContent)) { - net::ReferrerPolicy refPolEnum = aContent->AsElement()->GetReferrerPolicyAsEnum(); - if (refPolEnum != net::RP_Unset) { + net::ReferrerPolicy refPolEnum = + aContent->AsElement()->GetReferrerPolicyAsEnum(); + if (refPolEnum != RP_Unset) { refererPolicy = refPolEnum; } } @@ -13618,10 +13618,10 @@ nsDocShell::OnOverLink(nsIContent* aContent, NS_ConvertUTF8toUTF16 uStr(spec); - mozilla::net::PredictorPredict(aURI, mCurrentURI, - nsINetworkPredictor::PREDICT_LINK, - aContent->NodePrincipal()->OriginAttributesRef(), - nullptr); + PredictorPredict(aURI, mCurrentURI, + nsINetworkPredictor::PREDICT_LINK, + aContent->NodePrincipal()->OriginAttributesRef(), + nullptr); if (browserChrome2) { rv = browserChrome2->SetStatusWithContext(nsIWebBrowserChrome::STATUS_LINK, diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index e872d5b93082..5300bd8ea298 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -3476,11 +3476,11 @@ nsContentUtils::CanLoadImage(nsIURI* aURI, nsINode* aNode, } nsCOMPtr secCheckLoadInfo = - new LoadInfo(aLoadingPrincipal, - aLoadingPrincipal, // triggering principal - aNode, - nsILoadInfo::SEC_ONLY_FOR_EXPLICIT_CONTENTSEC_CHECK, - nsIContentPolicy::TYPE_INTERNAL_IMAGE); + new mozilla::net::LoadInfo(aLoadingPrincipal, + aLoadingPrincipal, // triggering principal + aNode, + nsILoadInfo::SEC_ONLY_FOR_EXPLICIT_CONTENTSEC_CHECK, + nsIContentPolicy::TYPE_INTERNAL_IMAGE); int16_t decision = nsIContentPolicy::ACCEPT; diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 70ec41bb4f27..43b0cdc79ab3 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -3754,7 +3754,7 @@ nsIDocument::SetHeaderData(nsAtom* aHeaderField, const nsAString& aData) // Referrer policy spec says to ignore any empty referrer policies. if (aHeaderField == nsGkAtoms::referrer && !aData.IsEmpty()) { - enum ReferrerPolicy policy = mozilla::net::ReferrerPolicyFromString(aData); + enum mozilla::net::ReferrerPolicy policy = mozilla::net::ReferrerPolicyFromString(aData); // If policy is not the empty string, then set element's node document's // referrer policy to policy if (policy != mozilla::net::RP_Unset) { @@ -3766,7 +3766,7 @@ nsIDocument::SetHeaderData(nsAtom* aHeaderField, const nsAString& aData) } if (aHeaderField == nsGkAtoms::headerReferrerPolicy && !aData.IsEmpty()) { - enum ReferrerPolicy policy = nsContentUtils::GetReferrerPolicyFromHeader(aData); + enum mozilla::net::ReferrerPolicy policy = nsContentUtils::GetReferrerPolicyFromHeader(aData); if (policy != mozilla::net::RP_Unset) { mReferrerPolicy = policy; mReferrerPolicySet = true; @@ -8961,7 +8961,7 @@ nsIDocument::ResolvePreloadImage(nsIURI *aBaseURI, void nsIDocument::MaybePreLoadImage(nsIURI* uri, const nsAString &aCrossOriginAttr, - enum ReferrerPolicy aReferrerPolicy, + enum mozilla::net::ReferrerPolicy aReferrerPolicy, bool aIsImgSet) { // Early exit if the img is already present in the img-cache @@ -9108,7 +9108,7 @@ void nsIDocument::PreloadStyle(nsIURI* uri, const Encoding* aEncoding, const nsAString& aCrossOriginAttr, - const enum ReferrerPolicy aReferrerPolicy, + const enum mozilla::net::ReferrerPolicy aReferrerPolicy, const nsAString& aIntegrity) { // The CSSLoader will retain this object after we return. diff --git a/dom/network/TCPSocketParent.cpp b/dom/network/TCPSocketParent.cpp index b6eba99e87bd..5e220ddba659 100644 --- a/dom/network/TCPSocketParent.cpp +++ b/dom/network/TCPSocketParent.cpp @@ -41,6 +41,8 @@ extern LazyLogModule gTCPSocketLog; #define TCPSOCKET_LOG_ENABLED() MOZ_LOG_TEST(gTCPSocketLog, LogLevel::Debug) } // namespace net +using namespace net; + namespace dom { static void diff --git a/dom/network/UDPSocketParent.cpp b/dom/network/UDPSocketParent.cpp index 958d5250eeac..5198c4be50c0 100644 --- a/dom/network/UDPSocketParent.cpp +++ b/dom/network/UDPSocketParent.cpp @@ -20,6 +20,9 @@ #include "mtransport/runnable_utils.h" namespace mozilla { + +using namespace net; + namespace dom { NS_IMPL_ISUPPORTS(UDPSocketParent, nsIUDPSocketListener) diff --git a/dom/security/nsMixedContentBlocker.cpp b/dom/security/nsMixedContentBlocker.cpp index 2171eb6a2ce1..8a8ea9d1514e 100644 --- a/dom/security/nsMixedContentBlocker.cpp +++ b/dom/security/nsMixedContentBlocker.cpp @@ -275,7 +275,7 @@ nsMixedContentBlocker::AsyncOnChannelRedirect(nsIChannel* aOldChannel, uint32_t aFlags, nsIAsyncVerifyRedirectCallback* aCallback) { - nsAsyncRedirectAutoCallback autoCallback(aCallback); + mozilla::net::nsAsyncRedirectAutoCallback autoCallback(aCallback); if (!aOldChannel) { NS_ERROR("No channel when evaluating mixed content!"); diff --git a/dom/serviceworkers/ServiceWorkerContainer.cpp b/dom/serviceworkers/ServiceWorkerContainer.cpp index 55fd637b8d0b..1d9bed1df9f9 100644 --- a/dom/serviceworkers/ServiceWorkerContainer.cpp +++ b/dom/serviceworkers/ServiceWorkerContainer.cpp @@ -301,11 +301,11 @@ ServiceWorkerContainer::Register(const nsAString& aScriptURL, // using the ClientInfo instead of doing a window-specific check here. // See bug 1455077 for further investigation. nsCOMPtr secCheckLoadInfo = - new LoadInfo(doc->NodePrincipal(), // loading principal - doc->NodePrincipal(), // triggering principal - doc, // loading node - nsILoadInfo::SEC_ONLY_FOR_EXPLICIT_CONTENTSEC_CHECK, - nsIContentPolicy::TYPE_INTERNAL_SERVICE_WORKER); + new mozilla::net::LoadInfo(doc->NodePrincipal(), // loading principal + doc->NodePrincipal(), // triggering principal + doc, // loading node + nsILoadInfo::SEC_ONLY_FOR_EXPLICIT_CONTENTSEC_CHECK, + nsIContentPolicy::TYPE_INTERNAL_SERVICE_WORKER); // Check content policy. int16_t decision = nsIContentPolicy::ACCEPT; diff --git a/dom/serviceworkers/ServiceWorkerEvents.cpp b/dom/serviceworkers/ServiceWorkerEvents.cpp index cef1c65c79f6..fed836272938 100644 --- a/dom/serviceworkers/ServiceWorkerEvents.cpp +++ b/dom/serviceworkers/ServiceWorkerEvents.cpp @@ -337,7 +337,7 @@ public: mChannel->SynthesizeHeader(entries[i].mName, entries[i].mValue); } - auto castLoadInfo = static_cast(loadInfo.get()); + auto castLoadInfo = static_cast(loadInfo.get()); castLoadInfo->SynthesizeServiceWorkerTainting(mInternalResponse->GetTainting()); // Get the preferred alternative data type of outter channel diff --git a/dom/serviceworkers/ServiceWorkerRegistrar.cpp b/dom/serviceworkers/ServiceWorkerRegistrar.cpp index 0e09a1154956..cb30375cefd4 100644 --- a/dom/serviceworkers/ServiceWorkerRegistrar.cpp +++ b/dom/serviceworkers/ServiceWorkerRegistrar.cpp @@ -63,8 +63,8 @@ StaticRefPtr gServiceWorkerRegistrar; nsresult GetOrigin(const nsACString& aURL, nsACString& aOrigin) { - RefPtr url; - nsresult rv = MozURL::Init(getter_AddRefs(url), aURL); + RefPtr url; + nsresult rv = net::MozURL::Init(getter_AddRefs(url), aURL); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } diff --git a/dom/workers/ScriptLoader.cpp b/dom/workers/ScriptLoader.cpp index ea2f41914f1c..ec140c94e811 100644 --- a/dom/workers/ScriptLoader.cpp +++ b/dom/workers/ScriptLoader.cpp @@ -161,7 +161,7 @@ ChannelFromScriptURL(nsIPrincipal* principal, rv = uri->SchemeIs("data", &isData); NS_ENSURE_SUCCESS(rv, rv); - bool isURIUniqueOrigin = nsIOService::IsDataURIUniqueOpaqueOrigin() && isData; + bool isURIUniqueOrigin = net::nsIOService::IsDataURIUniqueOpaqueOrigin() && isData; if (inheritAttrs && !isURIUniqueOrigin) { secFlags |= nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL; } diff --git a/ipc/glue/BackgroundUtils.h b/ipc/glue/BackgroundUtils.h index 5d5ebbf2266b..2a55cf4a9e73 100644 --- a/ipc/glue/BackgroundUtils.h +++ b/ipc/glue/BackgroundUtils.h @@ -54,8 +54,6 @@ class ParentLoadInfoForwarderArgs; class RedirectHistoryEntryInfo; } // namespace net -using namespace mozilla::net; - namespace ipc { class PrincipalInfo; @@ -90,7 +88,7 @@ IsPincipalInfoPrivate(const PrincipalInfo& aPrincipalInfo); */ already_AddRefed -RHEntryInfoToRHEntry(const RedirectHistoryEntryInfo& aRHEntryInfo); +RHEntryInfoToRHEntry(const mozilla::net::RedirectHistoryEntryInfo& aRHEntryInfo); /** * Convert an nsIRedirectHistoryEntry to a RedirectHistoryEntryInfo. @@ -98,20 +96,20 @@ RHEntryInfoToRHEntry(const RedirectHistoryEntryInfo& aRHEntryInfo); nsresult RHEntryToRHEntryInfo(nsIRedirectHistoryEntry* aRHEntry, - RedirectHistoryEntryInfo* aRHEntryInfo); + mozilla::net::RedirectHistoryEntryInfo* aRHEntryInfo); /** * Convert a LoadInfo to LoadInfoArgs struct. */ nsresult LoadInfoToLoadInfoArgs(nsILoadInfo *aLoadInfo, - OptionalLoadInfoArgs* outOptionalLoadInfoArgs); + mozilla::net::OptionalLoadInfoArgs* outOptionalLoadInfoArgs); /** * Convert LoadInfoArgs to a LoadInfo. */ nsresult -LoadInfoArgsToLoadInfo(const OptionalLoadInfoArgs& aOptionalLoadInfoArgs, +LoadInfoArgsToLoadInfo(const mozilla::net::OptionalLoadInfoArgs& aOptionalLoadInfoArgs, nsILoadInfo** outLoadInfo); /** @@ -119,14 +117,14 @@ LoadInfoArgsToLoadInfo(const OptionalLoadInfoArgs& aOptionalLoadInfoArgs, */ void LoadInfoToParentLoadInfoForwarder(nsILoadInfo *aLoadInfo, - ParentLoadInfoForwarderArgs* outLoadInfoChildForwardArgs); + mozilla::net::ParentLoadInfoForwarderArgs* outLoadInfoChildForwardArgs); /** * Merges (replaces) properties of an existing LoadInfo on a child process * with properties carried down through ParentLoadInfoForwarderArgs. */ nsresult -MergeParentLoadInfoForwarder(ParentLoadInfoForwarderArgs const& outLoadInfoChildForwardArgs, +MergeParentLoadInfoForwarder(mozilla::net::ParentLoadInfoForwarderArgs const& outLoadInfoChildForwardArgs, nsILoadInfo *aLoadInfo); } // namespace ipc diff --git a/ipc/glue/URIUtils.cpp b/ipc/glue/URIUtils.cpp index 8699e9a93fa8..c5814424d917 100644 --- a/ipc/glue/URIUtils.cpp +++ b/ipc/glue/URIUtils.cpp @@ -105,7 +105,7 @@ DeserializeURI(const URIParams& aParams) break; case URIParams::TSimpleNestedURIParams: - mutator = new nsSimpleNestedURI::Mutator(); + mutator = new net::nsSimpleNestedURI::Mutator(); break; case URIParams::THostObjectURIParams: diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp index 38bb371c6f60..dfc94343626f 100644 --- a/layout/build/nsLayoutModule.cpp +++ b/layout/build/nsLayoutModule.cpp @@ -162,12 +162,10 @@ static void Shutdown(); using namespace mozilla; using namespace mozilla::dom; +using namespace mozilla::net; using mozilla::dom::power::PowerManagerService; using mozilla::dom::quota::QuotaManagerService; -using mozilla::dom::WorkerDebuggerManager; -using mozilla::dom::UDPSocketChild; using mozilla::gmp::GeckoMediaPluginService; -using mozilla::dom::NotificationTelemetryService; #define NS_EDITORCOMMANDTABLE_CID \ { 0x4f5e62b8, 0xd659, 0x4156, \ diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp index 264ef18f8d5e..ea0481789122 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp @@ -169,7 +169,7 @@ PeerConnectionMedia::InitLocalAddrs() // We're in the content process, so send a request over IPC for the // stun address discovery. mStunAddrsRequest = - new StunAddrsRequestChild(new StunAddrsHandler(this), target); + new net::StunAddrsRequestChild(new StunAddrsHandler(this), target); mStunAddrsRequest->SendGetStunAddrs(); } else { // No content process, so don't need to hold up the ice event queue diff --git a/netwerk/base/nsAsyncStreamCopier.cpp b/netwerk/base/nsAsyncStreamCopier.cpp index 6fbed58cc118..1b9031f6aa2d 100644 --- a/netwerk/base/nsAsyncStreamCopier.cpp +++ b/netwerk/base/nsAsyncStreamCopier.cpp @@ -14,6 +14,7 @@ #include "mozilla/Logging.h" using namespace mozilla; +using namespace mozilla::net; #undef LOG // diff --git a/netwerk/base/nsBaseChannel.cpp b/netwerk/base/nsBaseChannel.cpp index 30b7ec756056..ea57c3407363 100644 --- a/netwerk/base/nsBaseChannel.cpp +++ b/netwerk/base/nsBaseChannel.cpp @@ -91,7 +91,7 @@ nsBaseChannel::Redirect(nsIChannel *newChannel, uint32_t redirectFlags, nsSecurityFlags secFlags = mLoadInfo->GetSecurityFlags() & ~nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL; nsCOMPtr newLoadInfo = - static_cast(mLoadInfo.get())->CloneWithNewSecFlags(secFlags); + static_cast(mLoadInfo.get())->CloneWithNewSecFlags(secFlags); nsCOMPtr uriPrincipal; nsIScriptSecurityManager *sm = nsContentUtils::GetSecurityManager(); diff --git a/netwerk/base/nsIncrementalDownload.cpp b/netwerk/base/nsIncrementalDownload.cpp index d9ac91500e1c..d59843b1b143 100644 --- a/netwerk/base/nsIncrementalDownload.cpp +++ b/netwerk/base/nsIncrementalDownload.cpp @@ -40,6 +40,7 @@ #define MAX_RETRY_COUNT 20 using namespace mozilla; +using namespace mozilla::net; //----------------------------------------------------------------------------- diff --git a/netwerk/base/nsInputStreamPump.cpp b/netwerk/base/nsInputStreamPump.cpp index 2b98169a141f..218a85c3412a 100644 --- a/netwerk/base/nsInputStreamPump.cpp +++ b/netwerk/base/nsInputStreamPump.cpp @@ -112,7 +112,7 @@ nsInputStreamPump::PeekStream(PeekSegmentFun callback, void* closure) PeekData data(callback, closure); return mAsyncStream->ReadSegments(CallPeekFunc, &data, - nsIOService::gDefaultSegmentSize, + net::nsIOService::gDefaultSegmentSize, &dummy); } diff --git a/netwerk/base/nsNetUtil.cpp b/netwerk/base/nsNetUtil.cpp index 22655ac135d8..3fb9f75e08a4 100644 --- a/netwerk/base/nsNetUtil.cpp +++ b/netwerk/base/nsNetUtil.cpp @@ -767,11 +767,11 @@ NS_NewInputStreamChannelInternal(nsIChannel** outChannel, nsContentPolicyType aContentPolicyType) { nsCOMPtr loadInfo = - new mozilla::LoadInfo(aLoadingPrincipal, - aTriggeringPrincipal, - aLoadingNode, - aSecurityFlags, - aContentPolicyType); + new mozilla::net::LoadInfo(aLoadingPrincipal, + aTriggeringPrincipal, + aLoadingNode, + aSecurityFlags, + aContentPolicyType); if (!loadInfo) { return NS_ERROR_UNEXPECTED; } @@ -858,8 +858,9 @@ NS_NewInputStreamChannelInternal(nsIChannel **outChannel, bool aIsSrcdocChannel /* = false */) { nsCOMPtr loadInfo = - new mozilla::LoadInfo(aLoadingPrincipal, aTriggeringPrincipal, - aLoadingNode, aSecurityFlags, aContentPolicyType); + new mozilla::net::LoadInfo(aLoadingPrincipal, aTriggeringPrincipal, + aLoadingNode, aSecurityFlags, + aContentPolicyType); return NS_NewInputStreamChannelInternal(outChannel, aUri, aData, aContentType, loadInfo, aIsSrcdocChannel); } diff --git a/netwerk/base/nsStandardURL.cpp b/netwerk/base/nsStandardURL.cpp index d182bc943996..25bca652919d 100644 --- a/netwerk/base/nsStandardURL.cpp +++ b/netwerk/base/nsStandardURL.cpp @@ -3685,5 +3685,5 @@ nsStandardURL::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const { nsresult Test_NormalizeIPv4(const nsACString& host, nsCString& result) { - return nsStandardURL::NormalizeIPv4(host, result); + return mozilla::net::nsStandardURL::NormalizeIPv4(host, result); } diff --git a/netwerk/build/nsNetModule.cpp b/netwerk/build/nsNetModule.cpp index 330f3bd0eaa7..c9e713cfbedf 100644 --- a/netwerk/build/nsNetModule.cpp +++ b/netwerk/build/nsNetModule.cpp @@ -293,6 +293,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(NamedPipeService, Init) #include "nsResProtocolHandler.h" #include "ExtensionProtocolHandler.h" #include "SubstitutingProtocolHandler.h" +typedef mozilla::net::ExtensionProtocolHandler ExtensionProtocolHandler; typedef mozilla::net::SubstitutingURL::Mutator SubstitutingURLMutator; NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsResProtocolHandler, Init) diff --git a/netwerk/cookie/nsCookieService.cpp b/netwerk/cookie/nsCookieService.cpp index 050d1f0e6f73..25c8c3116e59 100644 --- a/netwerk/cookie/nsCookieService.cpp +++ b/netwerk/cookie/nsCookieService.cpp @@ -3513,7 +3513,7 @@ nsCookieService::CanSetCookie(nsIURI* aHostURI, // to be processed bool nsCookieService::SetCookieInternal(nsIURI *aHostURI, - const mozilla::nsCookieKey &aKey, + const mozilla::net::nsCookieKey &aKey, bool aRequireHostMatch, CookieStatus aStatus, nsDependentCString &aCookieHeader, diff --git a/netwerk/protocol/data/nsDataChannel.cpp b/netwerk/protocol/data/nsDataChannel.cpp index 84b629887e97..01f068ba0efd 100644 --- a/netwerk/protocol/data/nsDataChannel.cpp +++ b/netwerk/protocol/data/nsDataChannel.cpp @@ -91,7 +91,7 @@ nsDataChannel::OpenContentStream(bool async, nsIInputStream **result, // create an unbounded pipe. rv = NS_NewPipe(getter_AddRefs(bufInStream), getter_AddRefs(bufOutStream), - nsIOService::gDefaultSegmentSize, + net::nsIOService::gDefaultSegmentSize, UINT32_MAX, async, true); if (NS_FAILED(rv)) diff --git a/netwerk/protocol/data/nsDataHandler.cpp b/netwerk/protocol/data/nsDataHandler.cpp index 63db1e2c09df..1c4c9c6b6554 100644 --- a/netwerk/protocol/data/nsDataHandler.cpp +++ b/netwerk/protocol/data/nsDataHandler.cpp @@ -87,7 +87,7 @@ nsDataHandler::NewURI(const nsACString &aSpec, } } - rv = NS_MutateURI(new nsSimpleURI::Mutator()) + rv = NS_MutateURI(new mozilla::net::nsSimpleURI::Mutator()) .SetSpec(spec) .Finalize(uri); } diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index ac79ee35c824..b7a9bc2194bc 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -3268,7 +3268,7 @@ HttpBaseChannel::CloneLoadInfoForRedirect(nsIURI * newURI, uint32_t redirectFlag } nsCOMPtr newLoadInfo = - static_cast(mLoadInfo.get())->Clone(); + static_cast(mLoadInfo.get())->Clone(); nsContentPolicyType contentPolicyType = mLoadInfo->GetExternalContentPolicyType(); if (contentPolicyType == nsIContentPolicy::TYPE_DOCUMENT || diff --git a/netwerk/protocol/http/nsCORSListenerProxy.cpp b/netwerk/protocol/http/nsCORSListenerProxy.cpp index 3f57f977f087..2df0a7493ca2 100644 --- a/netwerk/protocol/http/nsCORSListenerProxy.cpp +++ b/netwerk/protocol/http/nsCORSListenerProxy.cpp @@ -48,6 +48,7 @@ #include using namespace mozilla; +using namespace mozilla::net; #define PREFLIGHT_CACHE_SIZE 100 @@ -1490,9 +1491,9 @@ nsCORSListenerProxy::StartCORSPreflight(nsIChannel* aRequestChannel, // Either it wasn't cached or the cached result has expired. Build a // channel for the OPTIONS request. - nsCOMPtr loadInfo = static_cast + nsCOMPtr loadInfo = static_cast (originalLoadInfo.get())->CloneForNewRequest(); - static_cast(loadInfo.get())->SetIsPreflight(); + static_cast(loadInfo.get())->SetIsPreflight(); nsCOMPtr loadGroup; rv = aRequestChannel->GetLoadGroup(getter_AddRefs(loadGroup)); diff --git a/netwerk/protocol/http/nsIHttpChannelChild.idl b/netwerk/protocol/http/nsIHttpChannelChild.idl index 5451d651ecff..8f6b0c72e5eb 100644 --- a/netwerk/protocol/http/nsIHttpChannelChild.idl +++ b/netwerk/protocol/http/nsIHttpChannelChild.idl @@ -6,7 +6,7 @@ #include "nsISupports.idl" [ptr] native RequestHeaderTuples(mozilla::net::RequestHeaderTuples); -[ref] native OptionalCorsPreflightArgsRef(mozilla::OptionalCorsPreflightArgs); +[ref] native OptionalCorsPreflightArgsRef(mozilla::net::OptionalCorsPreflightArgs); interface nsIPrincipal; interface nsIURI; diff --git a/netwerk/protocol/res/nsResProtocolHandler.h b/netwerk/protocol/res/nsResProtocolHandler.h index 30fccb90c492..4a651f75bde6 100644 --- a/netwerk/protocol/res/nsResProtocolHandler.h +++ b/netwerk/protocol/res/nsResProtocolHandler.h @@ -17,18 +17,18 @@ class nsISubstitutionObserver; struct SubstitutionMapping; class nsResProtocolHandler final : public nsIResProtocolHandler, - public mozilla::SubstitutingProtocolHandler, + public mozilla::net::SubstitutingProtocolHandler, public nsSupportsWeakReference { public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIRESPROTOCOLHANDLER - NS_FORWARD_NSIPROTOCOLHANDLER(mozilla::SubstitutingProtocolHandler::) + NS_FORWARD_NSIPROTOCOLHANDLER(mozilla::net::SubstitutingProtocolHandler::) nsResProtocolHandler() - : SubstitutingProtocolHandler("resource", URI_STD | URI_IS_UI_RESOURCE | URI_IS_LOCAL_RESOURCE, - /* aEnforceFileOrJar = */ false) + : mozilla::net::SubstitutingProtocolHandler("resource", URI_STD | URI_IS_UI_RESOURCE | URI_IS_LOCAL_RESOURCE, + /* aEnforceFileOrJar = */ false) {} MOZ_MUST_USE nsresult Init(); @@ -38,27 +38,27 @@ public: NS_IMETHOD GetSubstitution(const nsACString& aRoot, nsIURI** aResult) override { - return mozilla::SubstitutingProtocolHandler::GetSubstitution(aRoot, aResult); + return mozilla::net::SubstitutingProtocolHandler::GetSubstitution(aRoot, aResult); } NS_IMETHOD HasSubstitution(const nsACString& aRoot, bool* aResult) override { - return mozilla::SubstitutingProtocolHandler::HasSubstitution(aRoot, aResult); + return mozilla::net::SubstitutingProtocolHandler::HasSubstitution(aRoot, aResult); } NS_IMETHOD ResolveURI(nsIURI *aResURI, nsACString& aResult) override { - return mozilla::SubstitutingProtocolHandler::ResolveURI(aResURI, aResult); + return mozilla::net::SubstitutingProtocolHandler::ResolveURI(aResURI, aResult); } NS_IMETHOD AddObserver(nsISubstitutionObserver *aObserver) override { - return mozilla::SubstitutingProtocolHandler::AddObserver(aObserver); + return mozilla::net::SubstitutingProtocolHandler::AddObserver(aObserver); } NS_IMETHOD RemoveObserver(nsISubstitutionObserver *aObserver) override { - return mozilla::SubstitutingProtocolHandler::RemoveObserver(aObserver); + return mozilla::net::SubstitutingProtocolHandler::RemoveObserver(aObserver); } protected: diff --git a/security/manager/ssl/PSMContentListener.cpp b/security/manager/ssl/PSMContentListener.cpp index dde57ea8f032..4f5f25967600 100644 --- a/security/manager/ssl/PSMContentListener.cpp +++ b/security/manager/ssl/PSMContentListener.cpp @@ -271,7 +271,7 @@ PSMContentDownloaderParent::RecvDivertToParentUsing(mozilla::net::PChannelDivert MOZ_ASSERT(diverter); auto p = static_cast(diverter); p->DivertTo(this); - mozilla::Unused << ChannelDiverterParent::Send__delete__(p); + mozilla::Unused << mozilla::net::ChannelDiverterParent::Send__delete__(p); return IPC_OK(); } diff --git a/toolkit/components/extensions/webrequest/StreamFilterParent.cpp b/toolkit/components/extensions/webrequest/StreamFilterParent.cpp index 1bc053a27f4e..ab299948a4a2 100644 --- a/toolkit/components/extensions/webrequest/StreamFilterParent.cpp +++ b/toolkit/components/extensions/webrequest/StreamFilterParent.cpp @@ -137,7 +137,7 @@ StreamFilterParent::Create(dom::ContentParent* aContentParent, uint64_t aChannel RefPtr addonId = NS_Atomize(aAddonId); nsCOMPtr channel = webreq.GetTraceableChannel(aChannelId, addonId, aContentParent); - RefPtr chan = do_QueryObject(channel); + RefPtr chan = do_QueryObject(channel); NS_ENSURE_TRUE(chan, false); auto channelPid = chan->ProcessId(); @@ -693,7 +693,7 @@ StreamFilterParent::FlushBufferedData() nsIEventTarget* StreamFilterParent::ActorThread() { - return gSocketTransportService; + return net::gSocketTransportService; } bool diff --git a/toolkit/components/places/nsFaviconService.cpp b/toolkit/components/places/nsFaviconService.cpp index 190c1070d22a..b5f2a1c9e707 100644 --- a/toolkit/components/places/nsFaviconService.cpp +++ b/toolkit/components/places/nsFaviconService.cpp @@ -549,13 +549,13 @@ nsFaviconService::ReplaceFaviconDataFromDataURL(nsIURI* aFaviconURI, NS_ENSURE_TRUE(loadingPrincipal, NS_ERROR_FAILURE); nsCOMPtr loadInfo = - new mozilla::LoadInfo(loadingPrincipal, - nullptr, // aTriggeringPrincipal - nullptr, // aLoadingNode - nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS | - nsILoadInfo::SEC_ALLOW_CHROME | - nsILoadInfo::SEC_DISALLOW_SCRIPT, - nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON); + new mozilla::net::LoadInfo(loadingPrincipal, + nullptr, // aTriggeringPrincipal + nullptr, // aLoadingNode + nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS | + nsILoadInfo::SEC_ALLOW_CHROME | + nsILoadInfo::SEC_DISALLOW_SCRIPT, + nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON); nsCOMPtr channel; rv = protocolHandler->NewChannel2(dataURI, loadInfo, getter_AddRefs(channel)); diff --git a/uriloader/exthandler/ExternalHelperAppParent.cpp b/uriloader/exthandler/ExternalHelperAppParent.cpp index a32b7abc3fcd..fd626528a949 100644 --- a/uriloader/exthandler/ExternalHelperAppParent.cpp +++ b/uriloader/exthandler/ExternalHelperAppParent.cpp @@ -196,7 +196,7 @@ ExternalHelperAppParent::RecvDivertToParentUsing(PChannelDiverterParent* diverte #ifdef DEBUG mDiverted = true; #endif - Unused << ChannelDiverterParent::Send__delete__(p); + Unused << mozilla::net::ChannelDiverterParent::Send__delete__(p); return IPC_OK(); } diff --git a/uriloader/exthandler/nsExternalProtocolHandler.cpp b/uriloader/exthandler/nsExternalProtocolHandler.cpp index f9a825fcaf3d..5cf157999eda 100644 --- a/uriloader/exthandler/nsExternalProtocolHandler.cpp +++ b/uriloader/exthandler/nsExternalProtocolHandler.cpp @@ -405,7 +405,7 @@ NS_IMETHODIMP nsExtProtocolChannel::CompleteRedirectSetup(nsIStreamListener *lis // From nsIParentChannel (derives from nsIStreamListener) ////////////////////////////////////////////////////////////////////// -NS_IMETHODIMP nsExtProtocolChannel::SetParentListener(HttpChannelParentListener* aListener) +NS_IMETHODIMP nsExtProtocolChannel::SetParentListener(mozilla::net::HttpChannelParentListener* aListener) { // This is called as part of the connect parent operation from // ContentParent::RecvExtProtocolChannelConnectParent. Setting