From 922f9b4f527cb78eb19dd6c5e4bfc5c19730fd6f Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sun, 17 May 2020 10:43:40 +0000 Subject: Issue #80 - De-unify netwerk/base --- netwerk/base/PollableEvent.cpp | 3 +++ netwerk/base/Predictor.cpp | 2 ++ netwerk/base/ProxyAutoConfig.cpp | 1 + netwerk/base/ThrottleQueue.cpp | 1 + netwerk/base/ThrottleQueue.h | 2 ++ netwerk/base/moz.build | 2 +- netwerk/base/nsAsyncStreamCopier.cpp | 1 + netwerk/base/nsBaseChannel.cpp | 7 +++++-- netwerk/base/nsChannelClassifier.cpp | 1 + netwerk/base/nsInputStreamPump.cpp | 3 +++ netwerk/base/nsMIMEInputStream.cpp | 1 + netwerk/base/nsStandardURL.cpp | 1 + netwerk/base/nsSyncStreamListener.cpp | 2 ++ netwerk/base/nsTemporaryFileInputStream.cpp | 7 +++++++ 14 files changed, 31 insertions(+), 3 deletions(-) (limited to 'netwerk') diff --git a/netwerk/base/PollableEvent.cpp b/netwerk/base/PollableEvent.cpp index 9cb45efded..af257808da 100644 --- a/netwerk/base/PollableEvent.cpp +++ b/netwerk/base/PollableEvent.cpp @@ -9,6 +9,7 @@ #include "mozilla/Assertions.h" #include "mozilla/DebugOnly.h" #include "mozilla/Logging.h" +#include "mozilla/net/DNS.h" #include "prerror.h" #include "prio.h" #include "private/pprio.h" @@ -21,6 +22,8 @@ #define USEPIPE 1 #endif +using namespace mozilla::net; + namespace mozilla { namespace net { diff --git a/netwerk/base/Predictor.cpp b/netwerk/base/Predictor.cpp index 12e4eb4155..59109b8cf7 100644 --- a/netwerk/base/Predictor.cpp +++ b/netwerk/base/Predictor.cpp @@ -35,6 +35,7 @@ #include "nsStreamUtils.h" #include "nsString.h" #include "nsThreadUtils.h" +#include "nsHttpRequestHead.h" #include "mozilla/Logging.h" #include "mozilla/Preferences.h" @@ -51,6 +52,7 @@ #include "mozilla/dom/ContentParent.h" using namespace mozilla; +using namespace mozilla::dom; namespace mozilla { namespace net { diff --git a/netwerk/base/ProxyAutoConfig.cpp b/netwerk/base/ProxyAutoConfig.cpp index 6a95776693..858e0e3787 100644 --- a/netwerk/base/ProxyAutoConfig.cpp +++ b/netwerk/base/ProxyAutoConfig.cpp @@ -16,6 +16,7 @@ #include "jsfriendapi.h" #include "prnetdb.h" #include "nsITimer.h" +#include "mozilla/Mutex.h" #include "mozilla/net/DNS.h" #include "nsServiceManagerUtils.h" #include "nsNetCID.h" diff --git a/netwerk/base/ThrottleQueue.cpp b/netwerk/base/ThrottleQueue.cpp index d5b8a41df8..80a5f7675a 100644 --- a/netwerk/base/ThrottleQueue.cpp +++ b/netwerk/base/ThrottleQueue.cpp @@ -6,6 +6,7 @@ #include "ThrottleQueue.h" #include "nsISeekableStream.h" +#include "nsIEventTarget.h" #include "nsIAsyncInputStream.h" #include "nsStreamUtils.h" #include "nsNetUtil.h" diff --git a/netwerk/base/ThrottleQueue.h b/netwerk/base/ThrottleQueue.h index 5e16c8ef60..9fb377cc8f 100644 --- a/netwerk/base/ThrottleQueue.h +++ b/netwerk/base/ThrottleQueue.h @@ -8,8 +8,10 @@ #define mozilla_net_ThrottleQueue_h #include "mozilla/TimeStamp.h" +#include "nsCOMPtr.h" #include "nsIThrottledInputChannel.h" #include "nsITimer.h" +#include "nsTArray.h" namespace mozilla { namespace net { diff --git a/netwerk/base/moz.build b/netwerk/base/moz.build index 3198d746c1..a9c7db845b 100644 --- a/netwerk/base/moz.build +++ b/netwerk/base/moz.build @@ -182,7 +182,7 @@ EXPORTS.mozilla.net += [ 'ReferrerPolicy.h', ] -UNIFIED_SOURCES += [ +SOURCES += [ 'ArrayBufferInputStream.cpp', 'BackgroundFileSaver.cpp', 'CaptivePortalService.cpp', diff --git a/netwerk/base/nsAsyncStreamCopier.cpp b/netwerk/base/nsAsyncStreamCopier.cpp index 6eec29d614..434304084b 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 200804c1e6..2575fac046 100644 --- a/netwerk/base/nsBaseChannel.cpp +++ b/netwerk/base/nsBaseChannel.cpp @@ -21,9 +21,12 @@ #include "nsProxyRelease.h" #include "nsXULAppAPI.h" #include "nsContentSecurityManager.h" -#include "LoadInfo.h" +#include "mozilla/LoadInfo.h" #include "nsServiceManagerUtils.h" +using namespace mozilla; +using namespace mozilla::net; + // This class is used to suspend a request across a function scope. class ScopedRequestSuspender { public: @@ -87,7 +90,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/nsChannelClassifier.cpp b/netwerk/base/nsChannelClassifier.cpp index 6b9f9ede31..8fc398de62 100644 --- a/netwerk/base/nsChannelClassifier.cpp +++ b/netwerk/base/nsChannelClassifier.cpp @@ -17,6 +17,7 @@ #include "nsIDOMDocument.h" #include "nsIHttpChannelInternal.h" #include "nsIIOService.h" +#include "nsILoadContext.h" #include "nsIParentChannel.h" #include "nsIPermissionManager.h" #include "nsIPrivateBrowsingTrackingProtectionWhitelist.h" diff --git a/netwerk/base/nsInputStreamPump.cpp b/netwerk/base/nsInputStreamPump.cpp index 19c2a790ab..0f47dfb5b7 100644 --- a/netwerk/base/nsInputStreamPump.cpp +++ b/netwerk/base/nsInputStreamPump.cpp @@ -19,6 +19,9 @@ #include "nsNetCID.h" #include +using namespace mozilla; +using namespace mozilla::net; + static NS_DEFINE_CID(kStreamTransportServiceCID, NS_STREAMTRANSPORTSERVICE_CID); // diff --git a/netwerk/base/nsMIMEInputStream.cpp b/netwerk/base/nsMIMEInputStream.cpp index ce1188ea08..5829f7ae43 100644 --- a/netwerk/base/nsMIMEInputStream.cpp +++ b/netwerk/base/nsMIMEInputStream.cpp @@ -24,6 +24,7 @@ using namespace mozilla::ipc; using mozilla::Maybe; +using mozilla::Nothing; class nsMIMEInputStream : public nsIMIMEInputStream, public nsISeekableStream, diff --git a/netwerk/base/nsStandardURL.cpp b/netwerk/base/nsStandardURL.cpp index 7317240c2c..81b4855028 100644 --- a/netwerk/base/nsStandardURL.cpp +++ b/netwerk/base/nsStandardURL.cpp @@ -26,6 +26,7 @@ #include "nsContentUtils.h" #include "prprf.h" #include "nsReadableUtils.h" +#include "nsPrintfCString.h" using mozilla::dom::EncodingUtils; using namespace mozilla::ipc; diff --git a/netwerk/base/nsSyncStreamListener.cpp b/netwerk/base/nsSyncStreamListener.cpp index e80e885c51..af24a89572 100644 --- a/netwerk/base/nsSyncStreamListener.cpp +++ b/netwerk/base/nsSyncStreamListener.cpp @@ -8,6 +8,8 @@ #include "nsThreadUtils.h" #include +using namespace mozilla::net; + nsresult nsSyncStreamListener::Init() { diff --git a/netwerk/base/nsTemporaryFileInputStream.cpp b/netwerk/base/nsTemporaryFileInputStream.cpp index c7c5b06486..86dc9e06d9 100644 --- a/netwerk/base/nsTemporaryFileInputStream.cpp +++ b/netwerk/base/nsTemporaryFileInputStream.cpp @@ -4,9 +4,16 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsTemporaryFileInputStream.h" + +#include "mozilla/ipc/InputStreamUtils.h" +#include "mozilla/Mutex.h" #include "nsStreamUtils.h" +#include "private/pprio.h" #include +using namespace mozilla; +using namespace mozilla::ipc; + typedef mozilla::ipc::FileDescriptor::PlatformHandleType FileHandleType; NS_IMPL_ISUPPORTS(nsTemporaryFileInputStream, -- cgit v1.2.3