Bug 1238290 - fix bad necko deps on unified_sources r=valentin.gosu
authorPatrick McManus <mcmanus@ducksong.com>
Fri, 08 Jan 2016 20:20:50 -0500
changeset 316271 bf899f2bc46aa83fde98ed955196efa41ffedcd6
parent 316270 9e172c20b8f9571ddcb7926cc722af4e4403dd50
child 316272 9e33d8709881a198bd018cc161158f2b2eaa663d
push id1079
push userjlund@mozilla.com
push dateFri, 15 Apr 2016 21:02:33 +0000
treeherdermozilla-release@575fbf6786d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1238290
milestone46.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1238290 - fix bad necko deps on unified_sources r=valentin.gosu --- netwerk/base/ARefBase.h | 2 ++ netwerk/base/CaptivePortalService.cpp | 1 + netwerk/base/CaptivePortalService.h | 1 + netwerk/base/EventTokenBucket.cpp | 4 +++- netwerk/base/LoadContextInfo.cpp | 3 +++ netwerk/base/LoadInfo.cpp | 3 +++ netwerk/base/MemoryDownloader.cpp | 1 + netwerk/base/Predictor.cpp | 1 + netwerk/base/RedirectChannelRegistrar.h | 1 + netwerk/base/nsBaseChannel.cpp | 1 + netwerk/base/nsChannelClassifier.cpp | 1 + netwerk/base/nsDirectoryIndexStream.cpp | 3 ++- netwerk/base/nsDownloader.cpp | 1 + netwerk/base/nsIOService.cpp | 1 + netwerk/base/nsIncrementalDownload.cpp | 3 +++ netwerk/base/nsNetUtil.cpp | 4 ++++ netwerk/base/nsNetUtil.h | 1 + netwerk/base/nsProtocolProxyService.cpp | 1 + netwerk/base/nsSecCheckWrapChannel.cpp | 2 ++ netwerk/base/nsUDPSocket.cpp | 4 +++- netwerk/cache/nsDiskCacheBinding.cpp | 2 +- netwerk/cache/nsDiskCacheDeviceSQL.cpp | 2 ++ netwerk/cache/nsMemoryCacheDevice.cpp | 2 +- netwerk/cache2/CacheFileUtils.cpp | 2 ++ netwerk/cache2/CacheStorageService.h | 1 + netwerk/ipc/NeckoParent.cpp | 1 + netwerk/ipc/RemoteOpenFileChild.cpp | 1 + netwerk/protocol/about/nsAboutBloat.cpp | 1 + netwerk/protocol/about/nsAboutCacheEntry.cpp | 1 + netwerk/protocol/about/nsAboutProtocolHandler.cpp | 1 + netwerk/protocol/data/DataChannelParent.cpp | 1 + netwerk/protocol/file/nsFileProtocolHandler.cpp | 1 + netwerk/protocol/ftp/FTPChannelParent.cpp | 2 ++ netwerk/protocol/ftp/FTPChannelParent.h | 1 + netwerk/protocol/ftp/nsFtpConnectionThread.cpp | 1 + netwerk/protocol/ftp/nsFtpProtocolHandler.h | 1 + netwerk/protocol/http/Http2Compression.cpp | 1 + netwerk/protocol/http/Http2Session.cpp | 1 + netwerk/protocol/http/Http2Stream.h | 2 ++ netwerk/protocol/http/HttpBaseChannel.cpp | 4 ++++ netwerk/protocol/http/HttpBaseChannel.h | 1 + netwerk/protocol/http/HttpChannelChild.cpp | 25 ++-------------------- netwerk/protocol/http/HttpChannelChild.h | 24 +++++++++++++++++++++ netwerk/protocol/http/HttpChannelParent.cpp | 1 + netwerk/protocol/http/HttpChannelParent.h | 1 + .../protocol/http/HttpChannelParentListener.cpp | 1 + netwerk/protocol/http/HttpChannelParentListener.h | 1 + netwerk/protocol/http/InterceptedChannel.cpp | 1 + netwerk/protocol/http/NullHttpChannel.cpp | 1 + netwerk/protocol/http/NullHttpTransaction.cpp | 1 + netwerk/protocol/http/PackagedAppService.cpp | 14 ++++++++++-- netwerk/protocol/http/PackagedAppService.h | 4 +++- netwerk/protocol/http/PackagedAppVerifier.cpp | 1 + netwerk/protocol/http/nsCORSListenerProxy.cpp | 2 +- netwerk/protocol/http/nsHttpBasicAuth.cpp | 1 + netwerk/protocol/http/nsHttpChannel.cpp | 2 ++ netwerk/protocol/http/nsHttpChunkedDecoder.cpp | 1 + netwerk/protocol/http/nsHttpConnectionInfo.cpp | 2 ++ netwerk/protocol/http/nsHttpConnectionMgr.cpp | 1 + netwerk/protocol/http/nsHttpDigestAuth.cpp | 1 + netwerk/protocol/viewsource/nsViewSourceHandler.h | 4 ++++ .../protocol/websocket/BaseWebSocketChannel.cpp | 1 + .../websocket/WebSocketEventListenerParent.cpp | 1 + .../protocol/websocket/WebSocketEventService.cpp | 3 +++ netwerk/protocol/websocket/WebSocketFrame.cpp | 2 ++ netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp | 1 + .../protocol/wyciwyg/nsWyciwygProtocolHandler.cpp | 1 + netwerk/streamconv/converters/mozTXTToHTMLConv.cpp | 1 + .../streamconv/converters/nsFTPDirListingConv.cpp | 1 + .../streamconv/converters/nsHTTPCompressConv.cpp | 2 ++ netwerk/streamconv/converters/nsHTTPCompressConv.h | 1 + netwerk/streamconv/converters/nsIndexedToHTML.cpp | 1 + netwerk/streamconv/converters/nsMultiMixedConv.cpp | 2 ++ netwerk/streamconv/converters/nsTXTToHTMLConv.cpp | 2 ++ netwerk/streamconv/converters/nsUnknownDecoder.cpp | 2 ++ 75 files changed, 147 insertions(+), 32 deletions(-)
netwerk/base/ARefBase.h
netwerk/base/CaptivePortalService.cpp
netwerk/base/CaptivePortalService.h
netwerk/base/EventTokenBucket.cpp
netwerk/base/LoadContextInfo.cpp
netwerk/base/LoadInfo.cpp
netwerk/base/MemoryDownloader.cpp
netwerk/base/Predictor.cpp
netwerk/base/RedirectChannelRegistrar.h
netwerk/base/nsBaseChannel.cpp
netwerk/base/nsChannelClassifier.cpp
netwerk/base/nsDirectoryIndexStream.cpp
netwerk/base/nsDownloader.cpp
netwerk/base/nsIOService.cpp
netwerk/base/nsIncrementalDownload.cpp
netwerk/base/nsNetUtil.cpp
netwerk/base/nsNetUtil.h
netwerk/base/nsProtocolProxyService.cpp
netwerk/base/nsSecCheckWrapChannel.cpp
netwerk/base/nsUDPSocket.cpp
netwerk/cache/nsDiskCacheBinding.cpp
netwerk/cache/nsDiskCacheDeviceSQL.cpp
netwerk/cache/nsMemoryCacheDevice.cpp
netwerk/cache2/CacheFileUtils.cpp
netwerk/cache2/CacheStorageService.h
netwerk/ipc/NeckoParent.cpp
netwerk/ipc/RemoteOpenFileChild.cpp
netwerk/protocol/about/nsAboutBloat.cpp
netwerk/protocol/about/nsAboutCacheEntry.cpp
netwerk/protocol/about/nsAboutProtocolHandler.cpp
netwerk/protocol/data/DataChannelParent.cpp
netwerk/protocol/file/nsFileProtocolHandler.cpp
netwerk/protocol/ftp/FTPChannelParent.cpp
netwerk/protocol/ftp/FTPChannelParent.h
netwerk/protocol/ftp/nsFtpConnectionThread.cpp
netwerk/protocol/ftp/nsFtpProtocolHandler.h
netwerk/protocol/http/Http2Compression.cpp
netwerk/protocol/http/Http2Session.cpp
netwerk/protocol/http/Http2Stream.h
netwerk/protocol/http/HttpBaseChannel.cpp
netwerk/protocol/http/HttpBaseChannel.h
netwerk/protocol/http/HttpChannelChild.cpp
netwerk/protocol/http/HttpChannelChild.h
netwerk/protocol/http/HttpChannelParent.cpp
netwerk/protocol/http/HttpChannelParent.h
netwerk/protocol/http/HttpChannelParentListener.cpp
netwerk/protocol/http/HttpChannelParentListener.h
netwerk/protocol/http/InterceptedChannel.cpp
netwerk/protocol/http/NullHttpChannel.cpp
netwerk/protocol/http/NullHttpTransaction.cpp
netwerk/protocol/http/PackagedAppService.cpp
netwerk/protocol/http/PackagedAppService.h
netwerk/protocol/http/PackagedAppVerifier.cpp
netwerk/protocol/http/nsCORSListenerProxy.cpp
netwerk/protocol/http/nsHttpBasicAuth.cpp
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/protocol/http/nsHttpChunkedDecoder.cpp
netwerk/protocol/http/nsHttpConnectionInfo.cpp
netwerk/protocol/http/nsHttpConnectionMgr.cpp
netwerk/protocol/http/nsHttpDigestAuth.cpp
netwerk/protocol/viewsource/nsViewSourceHandler.h
netwerk/protocol/websocket/BaseWebSocketChannel.cpp
netwerk/protocol/websocket/WebSocketEventListenerParent.cpp
netwerk/protocol/websocket/WebSocketEventService.cpp
netwerk/protocol/websocket/WebSocketFrame.cpp
netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp
netwerk/protocol/wyciwyg/nsWyciwygProtocolHandler.cpp
netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
netwerk/streamconv/converters/nsFTPDirListingConv.cpp
netwerk/streamconv/converters/nsHTTPCompressConv.cpp
netwerk/streamconv/converters/nsHTTPCompressConv.h
netwerk/streamconv/converters/nsIndexedToHTML.cpp
netwerk/streamconv/converters/nsMultiMixedConv.cpp
netwerk/streamconv/converters/nsTXTToHTMLConv.cpp
netwerk/streamconv/converters/nsUnknownDecoder.cpp
--- a/netwerk/base/ARefBase.h
+++ b/netwerk/base/ARefBase.h
@@ -2,16 +2,18 @@
 
 /* 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 mozilla_net_ARefBase_h
 #define mozilla_net_ARefBase_h
 
+#include "nscore.h"
+
 namespace mozilla { namespace net {
 
 // This is an abstract class that can be pointed to by either
 // nsCOMPtr or nsRefPtr. nsHttpConnectionMgr uses it for generic
 // objects that need to be reference counted - similiar to nsISupports
 // but it may or may not be xpcom.
 
 class ARefBase
--- a/netwerk/base/CaptivePortalService.cpp
+++ b/netwerk/base/CaptivePortalService.cpp
@@ -1,16 +1,17 @@
 /* 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 "CaptivePortalService.h"
 #include "mozilla/Services.h"
 #include "mozilla/Preferences.h"
 #include "nsIObserverService.h"
+#include "nsServiceManagerUtils.h"
 #include "nsXULAppAPI.h"
 
 #define kInterfaceName "captive-portal-inteface"
 
 static const char kOpenCaptivePortalLoginEvent[] = "captive-portal-login";
 static const char kAbortCaptivePortalLoginEvent[] = "captive-portal-login-abort";
 static const char kCaptivePortalLoginSuccessEvent[] = "captive-portal-login-success";
 
--- a/netwerk/base/CaptivePortalService.h
+++ b/netwerk/base/CaptivePortalService.h
@@ -6,16 +6,17 @@
 #define CaptivePortalService_h_
 
 #include "nsICaptivePortalService.h"
 #include "nsICaptivePortalDetector.h"
 #include "nsIObserver.h"
 #include "nsWeakReference.h"
 #include "nsITimer.h"
 #include "nsCOMArray.h"
+#include "mozilla/TimeStamp.h"
 
 namespace mozilla {
 namespace net {
 
 class CaptivePortalService
   : public nsICaptivePortalService
   , public nsIObserver
   , public nsSupportsWeakReference
--- a/netwerk/base/EventTokenBucket.cpp
+++ b/netwerk/base/EventTokenBucket.cpp
@@ -2,19 +2,21 @@
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* 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 "EventTokenBucket.h"
 
 #include "nsICancelable.h"
+#include "nsIIOService.h"
 #include "nsNetCID.h"
+#include "nsNetUtil.h"
+#include "nsServiceManagerUtils.h"
 #include "nsSocketTransportService2.h"
-
 #ifdef DEBUG
 #include "MainThreadUtils.h"
 #endif
 
 #ifdef XP_WIN
 #include <windows.h>
 #include <mmsystem.h>
 #endif
--- a/netwerk/base/LoadContextInfo.cpp
+++ b/netwerk/base/LoadContextInfo.cpp
@@ -1,18 +1,21 @@
 /* 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 "LoadContextInfo.h"
 
+#include "mozilla/dom/ToJSValue.h"
 #include "nsIChannel.h"
 #include "nsILoadContext.h"
 #include "nsIWebNavigation.h"
+#include "nsNetUtil.h"
 
+using namespace mozilla::dom;
 namespace mozilla {
 namespace net {
 
 // LoadContextInfo
 
 NS_IMPL_ISUPPORTS(LoadContextInfo, nsILoadContextInfo)
 
 LoadContextInfo::LoadContextInfo(bool aIsPrivate, bool aIsAnonymous, NeckoOriginAttributes aOriginAttributes)
--- a/netwerk/base/LoadInfo.cpp
+++ b/netwerk/base/LoadInfo.cpp
@@ -9,21 +9,24 @@
 #include "mozilla/Assertions.h"
 #include "mozilla/dom/ToJSValue.h"
 #include "mozIThirdPartyUtil.h"
 #include "nsFrameLoader.h"
 #include "nsIDocShell.h"
 #include "nsIDocument.h"
 #include "nsIDOMDocument.h"
 #include "nsIFrameLoader.h"
+#include "nsIInterfaceRequestorUtils.h"
 #include "nsISupportsImpl.h"
 #include "nsISupportsUtils.h"
 #include "nsContentUtils.h"
 #include "nsGlobalWindow.h"
 
+using namespace mozilla::dom;
+
 namespace mozilla {
 
 LoadInfo::LoadInfo(nsIPrincipal* aLoadingPrincipal,
                    nsIPrincipal* aTriggeringPrincipal,
                    nsINode* aLoadingContext,
                    nsSecurityFlags aSecurityFlags,
                    nsContentPolicyType aContentPolicyType)
   : mLoadingPrincipal(aLoadingContext ?
--- a/netwerk/base/MemoryDownloader.cpp
+++ b/netwerk/base/MemoryDownloader.cpp
@@ -1,16 +1,17 @@
 /* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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 "MemoryDownloader.h"
 
 #include "mozilla/Assertions.h"
+#include "nsIInputStream.h"
 
 namespace mozilla {
 namespace net {
 
 NS_IMPL_ISUPPORTS(MemoryDownloader,
 		  nsIStreamListener,
 		  nsIRequestObserver)
 
--- a/netwerk/base/Predictor.cpp
+++ b/netwerk/base/Predictor.cpp
@@ -33,16 +33,17 @@
 #include "ipc/Nuwa.h"
 #endif
 #include "mozilla/Logging.h"
 
 #include "mozilla/Preferences.h"
 #include "mozilla/Telemetry.h"
 
 #include "mozilla/net/NeckoCommon.h"
+#include "mozilla/net/NeckoParent.h"
 
 #include "LoadContextInfo.h"
 #include "mozilla/ipc/URIUtils.h"
 #include "SerializedLoadContext.h"
 #include "mozilla/net/NeckoChild.h"
 
 #if defined(ANDROID) && !defined(MOZ_WIDGET_GONK)
 #include "nsIPropertyBag2.h"
--- a/netwerk/base/RedirectChannelRegistrar.h
+++ b/netwerk/base/RedirectChannelRegistrar.h
@@ -6,16 +6,17 @@
 #define RedirectChannelRegistrar_h__
 
 #include "nsIRedirectChannelRegistrar.h"
 
 #include "nsIChannel.h"
 #include "nsIParentChannel.h"
 #include "nsInterfaceHashtable.h"
 #include "mozilla/Attributes.h"
+#include "mozilla/Mutex.h"
 
 namespace mozilla {
 namespace net {
 
 class RedirectChannelRegistrar final : public nsIRedirectChannelRegistrar
 {
   NS_DECL_ISUPPORTS
   NS_DECL_NSIREDIRECTCHANNELREGISTRAR
--- a/netwerk/base/nsBaseChannel.cpp
+++ b/netwerk/base/nsBaseChannel.cpp
@@ -17,16 +17,17 @@
 #include "nsIChannelEventSink.h"
 #include "nsIStreamConverterService.h"
 #include "nsChannelClassifier.h"
 #include "nsAsyncRedirectVerifyHelper.h"
 #include "nsProxyRelease.h"
 #include "nsXULAppAPI.h"
 #include "nsContentSecurityManager.h"
 #include "LoadInfo.h"
+#include "nsServiceManagerUtils.h"
 
 // This class is used to suspend a request across a function scope.
 class ScopedRequestSuspender {
 public:
   explicit ScopedRequestSuspender(nsIRequest *request)
     : mRequest(request) {
     if (mRequest && NS_FAILED(mRequest->Suspend())) {
       NS_WARNING("Couldn't suspend pump");
--- a/netwerk/base/nsChannelClassifier.cpp
+++ b/netwerk/base/nsChannelClassifier.cpp
@@ -22,16 +22,17 @@
 #include "nsIPrivateBrowsingTrackingProtectionWhitelist.h"
 #include "nsIProtocolHandler.h"
 #include "nsIScriptError.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsISecureBrowserUI.h"
 #include "nsISecurityEventSink.h"
 #include "nsIURL.h"
 #include "nsIWebProgressListener.h"
+#include "nsNetUtil.h"
 #include "nsPIDOMWindow.h"
 #include "nsXULAppAPI.h"
 
 #include "mozilla/ErrorNames.h"
 #include "mozilla/Logging.h"
 #include "mozilla/Preferences.h"
 
 using mozilla::ArrayLength;
--- a/netwerk/base/nsDirectoryIndexStream.cpp
+++ b/netwerk/base/nsDirectoryIndexStream.cpp
@@ -34,17 +34,18 @@
 // we want to do stuff like i18n sorting. However, none of the collation stuff
 // is threadsafe.
 // So THIS CODE IS ASCII ONLY!!!!!!!! This is no worse than the current
 // behaviour, though. See bug 99382.
 // When this is fixed, #define THREADSAFE_I18N to get this code working
 
 //#define THREADSAFE_I18N
 
-static mozilla::LazyLogModule gLog("nsDirectoryIndexStream");
+using namespace mozilla;
+static LazyLogModule gLog("nsDirectoryIndexStream");
 
 nsDirectoryIndexStream::nsDirectoryIndexStream()
     : mOffset(0), mStatus(NS_OK), mPos(0)
 {
     MOZ_LOG(gLog, LogLevel::Debug,
            ("nsDirectoryIndexStream[%p]: created", this));
 }
 
--- a/netwerk/base/nsDownloader.cpp
+++ b/netwerk/base/nsDownloader.cpp
@@ -1,14 +1,15 @@
 /* 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 "nsDownloader.h"
 #include "nsIInputStream.h"
+#include "nsIOutputStream.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsNetUtil.h"
 #include "nsCRTGlue.h"
 
 nsDownloader::~nsDownloader()
 {
     if (mLocation && mLocationIsTemp) {
--- a/netwerk/base/nsIOService.cpp
+++ b/netwerk/base/nsIOService.cpp
@@ -35,16 +35,17 @@
 #include "nsICancelable.h"
 #include "nsINetworkLinkService.h"
 #include "nsPISocketTransportService.h"
 #include "nsAsyncRedirectVerifyHelper.h"
 #include "nsURLHelper.h"
 #include "nsPIDNSService.h"
 #include "nsIProtocolProxyService2.h"
 #include "MainThreadUtils.h"
+#include "nsINode.h"
 #include "nsIWidget.h"
 #include "nsThreadUtils.h"
 #include "mozilla/LoadInfo.h"
 #include "mozilla/net/NeckoCommon.h"
 #include "mozilla/Services.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/net/DNS.h"
 #include "CaptivePortalService.h"
--- a/netwerk/base/nsIncrementalDownload.cpp
+++ b/netwerk/base/nsIncrementalDownload.cpp
@@ -22,26 +22,29 @@
 #include "nsIInputStream.h"
 #include "nsNetUtil.h"
 #include "nsWeakReference.h"
 #include "prio.h"
 #include "prprf.h"
 #include <algorithm>
 #include "nsIContentPolicy.h"
 #include "nsContentUtils.h"
+#include "mozilla/UniquePtr.h"
 
 // Default values used to initialize a nsIncrementalDownload object.
 #define DEFAULT_CHUNK_SIZE (4096 * 16)  // bytes
 #define DEFAULT_INTERVAL    60          // seconds
 
 #define UPDATE_PROGRESS_INTERVAL PRTime(500 * PR_USEC_PER_MSEC) // 500ms
 
 // Number of times to retry a failed byte-range request.
 #define MAX_RETRY_COUNT 20
 
+using namespace mozilla;
+
 //-----------------------------------------------------------------------------
 
 static nsresult
 WriteToFile(nsIFile *lf, const char *data, uint32_t len, int32_t flags)
 {
   PRFileDesc *fd;
   int32_t mode = 0600;
   nsresult rv;
--- a/netwerk/base/nsNetUtil.cpp
+++ b/netwerk/base/nsNetUtil.cpp
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // HttpLog.h should generally be included first
 #include "HttpLog.h"
 
 #include "mozilla/LoadContext.h"
 #include "mozilla/LoadInfo.h"
 #include "mozilla/BasePrincipal.h"
+#include "mozilla/Telemetry.h"
 #include "nsNetUtil.h"
 #include "nsNetUtil.inl"
 #include "mozIApplicationClearPrivateDataParams.h"
 #include "nsCategoryCache.h"
 #include "nsContentUtils.h"
 #include "nsHashKeys.h"
 #include "nsHttp.h"
 #include "nsIAsyncStreamCopier.h"
@@ -68,16 +69,19 @@
 
 #ifdef MOZ_WIDGET_GONK
 #include "nsINetworkManager.h"
 #include "nsThreadUtils.h" // for NS_IsMainThread
 #endif
 
 #include <limits>
 
+using namespace mozilla;
+using namespace mozilla::net;
+
 nsresult /*NS_NewChannelWithNodeAndTriggeringPrincipal */
 NS_NewChannelWithTriggeringPrincipal(nsIChannel           **outChannel,
                                      nsIURI                *aUri,
                                      nsINode               *aLoadingNode,
                                      nsIPrincipal          *aTriggeringPrincipal,
                                      nsSecurityFlags        aSecurityFlags,
                                      nsContentPolicyType    aContentPolicyType,
                                      nsILoadGroup          *aLoadGroup /* = nullptr */,
--- a/netwerk/base/nsNetUtil.h
+++ b/netwerk/base/nsNetUtil.h
@@ -12,16 +12,17 @@
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsILoadGroup.h"
 #include "nsINetUtil.h"
 #include "nsIRequest.h"
 #include "nsILoadInfo.h"
 #include "nsIIOService.h"
 #include "mozilla/Services.h"
 #include "nsNetCID.h"
+#include "nsServiceManagerUtils.h"
 
 class nsIURI;
 class nsIPrincipal;
 class nsIAsyncStreamCopier;
 class nsIAuthPrompt;
 class nsIAuthPrompt2;
 class nsIChannel;
 class nsIChannelPolicy;
--- a/netwerk/base/nsProtocolProxyService.cpp
+++ b/netwerk/base/nsProtocolProxyService.cpp
@@ -20,16 +20,17 @@
 #include "nsPIDNSService.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsThreadUtils.h"
 #include "nsString.h"
 #include "nsNetUtil.h"
 #include "nsNetCID.h"
+#include "plstr.h"
 #include "prnetdb.h"
 #include "nsPACMan.h"
 #include "nsProxyRelease.h"
 #include "mozilla/Mutex.h"
 #include "mozilla/CondVar.h"
 #include "nsISystemProxySettings.h"
 #include "nsINetworkLinkService.h"
 #include "nsIHttpChannelInternal.h"
--- a/netwerk/base/nsSecCheckWrapChannel.cpp
+++ b/netwerk/base/nsSecCheckWrapChannel.cpp
@@ -1,16 +1,18 @@
 /* -*- Mode: C++; tab-width: 2; 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 "nsContentSecurityManager.h"
 #include "nsSecCheckWrapChannel.h"
 #include "nsIForcePendingChannel.h"
+#include "nsIStreamListener.h"
+#include "mozilla/Logging.h"
 #include "nsCOMPtr.h"
 
 static mozilla::LazyLogModule gChannelWrapperLog("ChannelWrapper");
 #define CHANNELWRAPPERLOG(args) MOZ_LOG(gChannelWrapperLog, mozilla::LogLevel::Debug, args)
 
 NS_IMPL_ADDREF(nsSecCheckWrapChannelBase)
 NS_IMPL_RELEASE(nsSecCheckWrapChannelBase)
 
--- a/netwerk/base/nsUDPSocket.cpp
+++ b/netwerk/base/nsUDPSocket.cpp
@@ -16,16 +16,17 @@
 #include "nsError.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "prnetdb.h"
 #include "prio.h"
 #include "nsNetAddr.h"
 #include "nsNetSegmentUtils.h"
 #include "NetworkActivityMonitor.h"
+#include "nsServiceManagerUtils.h"
 #include "nsStreamUtils.h"
 #include "nsIPipe.h"
 #include "prerror.h"
 #include "nsThreadUtils.h"
 #include "nsIDNSRecord.h"
 #include "nsIDNSService.h"
 #include "nsICancelable.h"
 #include "ClosingService.h"
@@ -33,16 +34,17 @@
 #ifdef MOZ_WIDGET_GONK
 #include "NetStatistics.h"
 #endif
 
 using namespace mozilla::net;
 using namespace mozilla;
 
 static const uint32_t UDP_PACKET_CHUNK_SIZE = 1400;
+static NS_DEFINE_CID(kSocketTransportServiceCID2, NS_SOCKETTRANSPORTSERVICE_CID);
 
 //-----------------------------------------------------------------------------
 
 typedef void (nsUDPSocket:: *nsUDPSocketFunc)(void);
 
 static nsresult
 PostEvent(nsUDPSocket *s, nsUDPSocketFunc func)
 {
@@ -257,17 +259,17 @@ nsUDPSocket::nsUDPSocket()
 {
   mAddr.raw.family = PR_AF_UNSPEC;
   // we want to be able to access the STS directly, and it may not have been
   // constructed yet.  the STS constructor sets gSocketTransportService.
   if (!gSocketTransportService)
   {
     // This call can fail if we're offline, for example.
     nsCOMPtr<nsISocketTransportService> sts =
-        do_GetService(kSocketTransportServiceCID);
+        do_GetService(kSocketTransportServiceCID2);
   }
 
   mSts = gSocketTransportService;
   MOZ_COUNT_CTOR(nsUDPSocket);
 }
 
 nsUDPSocket::~nsUDPSocket()
 {
--- a/netwerk/cache/nsDiskCacheBinding.cpp
+++ b/netwerk/cache/nsDiskCacheBinding.cpp
@@ -7,17 +7,17 @@
 #include "mozilla/MemoryReporting.h"
 #include "nsCache.h"
 #include <limits.h>
 
 #include "nscore.h"
 #include "nsDiskCacheBinding.h"
 #include "nsCacheService.h"
 
-
+using namespace mozilla;
 
 /******************************************************************************
  *  static hash table callback functions
  *
  *****************************************************************************/
 struct HashTableEntry : PLDHashEntryHdr {
     nsDiskCacheBinding *  mBinding;
 };
--- a/netwerk/cache/nsDiskCacheDeviceSQL.cpp
+++ b/netwerk/cache/nsDiskCacheDeviceSQL.cpp
@@ -27,16 +27,18 @@
 #include "nsPrintfCString.h"
 #include "nsCRT.h"
 #include "nsArrayUtils.h"
 #include "nsIArray.h"
 #include "nsIVariant.h"
 #include "nsILoadContextInfo.h"
 #include "nsThreadUtils.h"
 #include "nsISerializable.h"
+#include "nsIInputStream.h"
+#include "nsIOutputStream.h"
 #include "nsSerializationHelper.h"
 
 #include "mozIStorageService.h"
 #include "mozIStorageStatement.h"
 #include "mozIStorageFunction.h"
 #include "mozStorageHelper.h"
 
 #include "nsICacheVisitor.h"
--- a/netwerk/cache/nsMemoryCacheDevice.cpp
+++ b/netwerk/cache/nsMemoryCacheDevice.cpp
@@ -22,17 +22,17 @@
 
 // We keep kQueueCount LRU queues, which should be about ceil(log2(mHardLimit))
 // The queues hold exponentially increasing ranges of floor(log2((size/nref)))
 // values for entries.
 // Entries larger than 2^(kQueueCount-1) go in the last queue.
 // Entries with no expiration go in the first queue.
 
 const char *gMemoryDeviceID      = "memory";
-
+using namespace mozilla;
 
 nsMemoryCacheDevice::nsMemoryCacheDevice()
     : mInitialized(false),
       mHardLimit(4 * 1024 * 1024),       // default, if no pref
       mSoftLimit((mHardLimit * 9) / 10), // default, if no pref
       mTotalSize(0),
       mInactiveSize(0),
       mEntryCount(0),
--- a/netwerk/cache2/CacheFileUtils.cpp
+++ b/netwerk/cache2/CacheFileUtils.cpp
@@ -1,16 +1,18 @@
 /* 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 "CacheIndex.h"
 #include "CacheLog.h"
 #include "CacheFileUtils.h"
 #include "LoadContextInfo.h"
 #include "mozilla/Tokenizer.h"
+#include "mozilla/Telemetry.h"
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 #include "nsString.h"
 #include <algorithm>
 
 
 namespace mozilla {
 namespace net {
--- a/netwerk/cache2/CacheStorageService.h
+++ b/netwerk/cache2/CacheStorageService.h
@@ -10,16 +10,17 @@
 #include "nsITimer.h"
 #include "nsICacheTesting.h"
 
 #include "nsClassHashtable.h"
 #include "nsDataHashtable.h"
 #include "nsString.h"
 #include "nsThreadUtils.h"
 #include "nsProxyRelease.h"
+#include "mozilla/Monitor.h"
 #include "mozilla/Mutex.h"
 #include "mozilla/Atomics.h"
 #include "mozilla/TimeStamp.h"
 #include "nsTArray.h"
 
 class nsIURI;
 class nsICacheEntryDoomCallback;
 class nsICacheStorageVisitor;
--- a/netwerk/ipc/NeckoParent.cpp
+++ b/netwerk/ipc/NeckoParent.cpp
@@ -37,16 +37,17 @@
 #include "nsEscape.h"
 #include "RemoteOpenFileParent.h"
 #include "SerializedLoadContext.h"
 #include "nsAuthInformationHolder.h"
 #include "nsIAuthPromptCallback.h"
 #include "nsPrincipal.h"
 #include "nsIOService.h"
 #include "nsINetworkPredictor.h"
+#include "nsINetworkPredictorVerifier.h"
 #include "mozilla/net/OfflineObserver.h"
 #include "nsISpeculativeConnect.h"
 
 using mozilla::DocShellOriginAttributes;
 using mozilla::NeckoOriginAttributes;
 using mozilla::dom::ContentParent;
 using mozilla::dom::TabContext;
 using mozilla::dom::TabParent;
--- a/netwerk/ipc/RemoteOpenFileChild.cpp
+++ b/netwerk/ipc/RemoteOpenFileChild.cpp
@@ -12,16 +12,17 @@
 #include "mozilla/ipc/URIUtils.h"
 #include "mozilla/net/NeckoChild.h"
 #include "nsThreadUtils.h"
 #include "nsJARProtocolHandler.h"
 #include "nsIRemoteOpenFileListener.h"
 #include "nsProxyRelease.h"
 #include "SerializedLoadContext.h"
 #include "nsNetUtil.h"
+#include "nsIFileURL.h"
 
 // needed to alloc/free NSPR file descriptors
 #include "private/pprio.h"
 
 #if !defined(XP_WIN) && !defined(MOZ_WIDGET_COCOA)
 #include <unistd.h>
 #endif
 
--- a/netwerk/protocol/about/nsAboutBloat.cpp
+++ b/netwerk/protocol/about/nsAboutBloat.cpp
@@ -12,16 +12,17 @@
 #include "nsContentUtils.h"
 #include "nsStringStream.h"
 #include "nsDOMString.h"
 #include "nsIURI.h"
 #include "nsCOMPtr.h"
 #include "prtime.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsIFile.h"
+#include "nsNetUtil.h"
 
 static void GC_gcollect() {}
 
 NS_IMPL_ISUPPORTS(nsAboutBloat, nsIAboutModule)
 
 NS_IMETHODIMP
 nsAboutBloat::NewChannel(nsIURI* aURI,
                          nsILoadInfo* aLoadInfo,
--- a/netwerk/protocol/about/nsAboutCacheEntry.cpp
+++ b/netwerk/protocol/about/nsAboutCacheEntry.cpp
@@ -13,16 +13,17 @@
 #include "nsEscape.h"
 #include "nsIAsyncInputStream.h"
 #include "nsIAsyncOutputStream.h"
 #include "nsAboutProtocolUtils.h"
 #include "nsContentUtils.h"
 #include "nsInputStreamPump.h"
 #include "CacheFileUtils.h"
 #include <algorithm>
+#include "nsIPipe.h"
 
 using namespace mozilla::net;
 
 #define HEXDUMP_MAX_ROWS 16
 
 static void
 HexDump(uint32_t *state, const char *buf, int32_t n, nsCString &result)
 {
--- a/netwerk/protocol/about/nsAboutProtocolHandler.cpp
+++ b/netwerk/protocol/about/nsAboutProtocolHandler.cpp
@@ -12,16 +12,17 @@
 #include "nsNetCID.h"
 #include "nsAboutProtocolUtils.h"
 #include "nsError.h"
 #include "nsNetUtil.h"
 #include "nsIObjectInputStream.h"
 #include "nsIObjectOutputStream.h"
 #include "nsAutoPtr.h"
 #include "nsIWritablePropertyBag2.h"
+#include "nsIChannel.h"
 
 static NS_DEFINE_CID(kSimpleURICID,     NS_SIMPLEURI_CID);
 static NS_DEFINE_CID(kNestedAboutURICID, NS_NESTEDABOUTURI_CID);
 
 static bool IsSafeForUntrustedContent(nsIAboutModule *aModule, nsIURI *aURI) {
   uint32_t flags;
   nsresult rv = aModule->GetURIFlags(aURI, &flags);
   NS_ENSURE_SUCCESS(rv, false);
--- a/netwerk/protocol/data/DataChannelParent.cpp
+++ b/netwerk/protocol/data/DataChannelParent.cpp
@@ -2,16 +2,17 @@
 /* vim: set ts=4 sw=4 sts=4 et tw=80: */
 /* 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 "DataChannelParent.h"
 #include "mozilla/Assertions.h"
 #include "nsNetUtil.h"
+#include "nsIChannel.h"
 
 namespace mozilla {
 namespace net {
 
 NS_IMPL_ISUPPORTS(DataChannelParent, nsIParentChannel, nsIStreamListener)
 
 DataChannelParent::~DataChannelParent()
 {
--- a/netwerk/protocol/file/nsFileProtocolHandler.cpp
+++ b/netwerk/protocol/file/nsFileProtocolHandler.cpp
@@ -1,14 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 // vim:ts=4 sw=4 sts=4 et cin:
 /* 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 "nsIFile.h"
 #include "nsFileProtocolHandler.h"
 #include "nsFileChannel.h"
 #include "nsStandardURL.h"
 #include "nsURLHelper.h"
 
 #include "nsNetUtil.h"
 
 // URL file handling, copied and modified from xpfe/components/bookmarks/src/nsBookmarksService.cpp
--- a/netwerk/protocol/ftp/FTPChannelParent.cpp
+++ b/netwerk/protocol/ftp/FTPChannelParent.cpp
@@ -1,16 +1,18 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set sw=2 ts=8 et tw=80 : */
 
 /* 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 "mozilla/net/FTPChannelParent.h"
+#include "nsStringStream.h"
+#include "mozilla/net/ChannelEventQueue.h"
 #include "mozilla/dom/TabParent.h"
 #include "nsFTPChannel.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsQueryObject.h"
 #include "nsFtpProtocolHandler.h"
 #include "nsIAuthPrompt.h"
 #include "nsIAuthPromptProvider.h"
--- a/netwerk/protocol/ftp/FTPChannelParent.h
+++ b/netwerk/protocol/ftp/FTPChannelParent.h
@@ -21,16 +21,17 @@ class nsILoadContext;
 namespace mozilla {
 
 namespace dom {
 class TabParent;
 class PBrowserOrId;
 } // namespace dom
 
 namespace net {
+class ChannelEventQueue;
 
 class FTPChannelParent final : public PFTPChannelParent
                              , public nsIParentChannel
                              , public nsIInterfaceRequestor
                              , public ADivertableParentChannel
                              , public nsIChannelEventSink
                              , public DisconnectableParent
 {
--- a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
+++ b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
@@ -37,16 +37,17 @@
 #include "nsIPrompt.h"
 #include "nsIProtocolHandler.h"
 #include "nsIProxyInfo.h"
 #include "nsIRunnable.h"
 #include "nsISocketTransportService.h"
 #include "nsIURI.h"
 #include "nsILoadInfo.h"
 #include "nsNullPrincipal.h"
+#include "nsIAuthPrompt2.h"
 
 #ifdef MOZ_WIDGET_GONK
 #include "NetStatistics.h"
 #endif
 
 using namespace mozilla;
 using namespace mozilla::net;
 
--- a/netwerk/protocol/ftp/nsFtpProtocolHandler.h
+++ b/netwerk/protocol/ftp/nsFtpProtocolHandler.h
@@ -77,11 +77,12 @@ private:
     uint8_t mControlQoSBits;
     uint8_t mDataQoSBits;
 };
 
 //-----------------------------------------------------------------------------
 
 extern nsFtpProtocolHandler *gFtpHandler;
 
+#include "mozilla/Logging.h"
 extern mozilla::LazyLogModule gFTPLog;
 
 #endif // !nsFtpProtocolHandler_h__
--- a/netwerk/protocol/http/Http2Compression.cpp
+++ b/netwerk/protocol/http/Http2Compression.cpp
@@ -12,16 +12,17 @@
 #define LOG(args) LOG5(args)
 #undef LOG_ENABLED
 #define LOG_ENABLED() LOG5_ENABLED()
 
 #include "Http2Compression.h"
 #include "Http2HuffmanIncoming.h"
 #include "Http2HuffmanOutgoing.h"
 #include "mozilla/StaticPtr.h"
+#include "nsHttpHandler.h"
 
 namespace mozilla {
 namespace net {
 
 static nsDeque *gStaticHeaders = nullptr;
 
 class HpackStaticTableReporter final : public nsIMemoryReporter
 {
--- a/netwerk/protocol/http/Http2Session.cpp
+++ b/netwerk/protocol/http/Http2Session.cpp
@@ -31,16 +31,17 @@
 #include "nsISSLStatusProvider.h"
 #include "nsISupportsPriority.h"
 #include "nsStandardURL.h"
 #include "nsURLHelper.h"
 #include "prnetdb.h"
 #include "sslt.h"
 #include "mozilla/Snprintf.h"
 #include "nsSocketTransportService2.h"
+#include "nsNetUtil.h"
 
 namespace mozilla {
 namespace net {
 
 // Http2Session has multiple inheritance of things that implement
 // nsISupports, so this magic is taken from nsHttpPipeline that
 // implements some of the same abstract classes.
 NS_IMPL_ADDREF(Http2Session)
--- a/netwerk/protocol/http/Http2Stream.h
+++ b/netwerk/protocol/http/Http2Stream.h
@@ -10,16 +10,18 @@
 // https://www.rfc-editor.org/rfc/rfc7540.txt
 
 #include "mozilla/Attributes.h"
 #include "mozilla/UniquePtr.h"
 #include "nsAHttpTransaction.h"
 #include "nsISupportsPriority.h"
 
 class nsStandardURL;
+class nsIInputStream;
+class nsIOutputStream;
 
 namespace mozilla {
 namespace net {
 
 class Http2Session;
 class Http2Decompressor;
 
 class Http2Stream
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -42,16 +42,20 @@
 #include "nsINetworkInterceptController.h"
 #include "mozIThirdPartyUtil.h"
 #include "nsStreamUtils.h"
 #include "nsContentSecurityManager.h"
 #include "nsIChannelEventSink.h"
 #include "nsILoadGroupChild.h"
 #include "mozilla/ConsoleReportCollector.h"
 #include "LoadInfo.h"
+#include "nsISSLSocketControl.h"
+#include "mozilla/Telemetry.h"
+#include "nsIURL.h"
+#include "nsIConsoleService.h"
 
 #include <algorithm>
 
 namespace mozilla {
 namespace net {
 
 HttpBaseChannel::HttpBaseChannel()
   : mStartPos(UINT64_MAX)
--- a/netwerk/protocol/http/HttpBaseChannel.h
+++ b/netwerk/protocol/http/HttpBaseChannel.h
@@ -37,16 +37,17 @@
 #include "mozilla/net/NeckoCommon.h"
 #include "nsThreadUtils.h"
 #include "PrivateBrowsingChannel.h"
 #include "mozilla/net/DNS.h"
 #include "nsITimedChannel.h"
 #include "nsIHttpChannel.h"
 #include "nsISecurityConsoleMessage.h"
 #include "nsCOMArray.h"
+#include "mozilla/net/ChannelEventQueue.h"
 
 class nsPerformance;
 class nsISecurityConsoleMessage;
 class nsIPrincipal;
 
 namespace mozilla {
 
 class LogCollector;
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -12,16 +12,17 @@
 #include "nsICacheEntry.h"
 #include "mozilla/unused.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/TabChild.h"
 #include "mozilla/ipc/FileDescriptorSetChild.h"
 #include "mozilla/net/NeckoChild.h"
 #include "mozilla/net/HttpChannelChild.h"
 
+#include "nsISupportsPrimitives.h"
 #include "nsChannelClassifier.h"
 #include "nsStringStream.h"
 #include "nsHttpHandler.h"
 #include "nsNetUtil.h"
 #include "nsSerializationHelper.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/ipc/InputStreamUtils.h"
 #include "mozilla/ipc/URIUtils.h"
@@ -31,16 +32,17 @@
 #include "SerializedLoadContext.h"
 #include "nsInputStreamPump.h"
 #include "InterceptedChannel.h"
 #include "nsPerformance.h"
 #include "mozIThirdPartyUtil.h"
 #include "nsContentSecurityManager.h"
 #include "nsIDeprecationWarner.h"
 #include "nsICompressConvStats.h"
+#include "nsStreamUtils.h"
 
 #ifdef OS_POSIX
 #include "chrome/common/file_descriptor_set_posix.h"
 #endif
 
 using namespace mozilla::dom;
 using namespace mozilla::ipc;
 
@@ -57,39 +59,16 @@ const uint32_t kMaxFileDescriptorsPerMes
 #ifdef OS_POSIX
 // Keep this in sync with other platforms.
 static_assert(FileDescriptorSet::MAX_DESCRIPTORS_PER_MESSAGE == 250,
               "MAX_DESCRIPTORS_PER_MESSAGE mismatch!");
 #endif
 
 } // namespace
 
-// A stream listener interposed between the nsInputStreamPump used for intercepted channels
-// and this channel's original listener. This is only used to ensure the original listener
-// sees the channel as the request object, and to synthesize OnStatus and OnProgress notifications.
-class InterceptStreamListener : public nsIStreamListener
-                              , public nsIProgressEventSink
-{
-  RefPtr<HttpChannelChild> mOwner;
-  nsCOMPtr<nsISupports> mContext;
-  virtual ~InterceptStreamListener() {}
- public:
-  InterceptStreamListener(HttpChannelChild* aOwner, nsISupports* aContext)
-  : mOwner(aOwner)
-  , mContext(aContext)
-  {
-  }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIREQUESTOBSERVER
-  NS_DECL_NSISTREAMLISTENER
-  NS_DECL_NSIPROGRESSEVENTSINK
-
-  void Cleanup();
-};
 
 NS_IMPL_ISUPPORTS(InterceptStreamListener,
                   nsIStreamListener,
                   nsIRequestObserver,
                   nsIProgressEventSink)
 
 NS_IMETHODIMP
 InterceptStreamListener::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext)
--- a/netwerk/protocol/http/HttpChannelChild.h
+++ b/netwerk/protocol/http/HttpChannelChild.h
@@ -308,16 +308,40 @@ private:
   friend class Redirect3Event;
   friend class DeleteSelfEvent;
   friend class HttpAsyncAborter<HttpChannelChild>;
   friend class InterceptStreamListener;
   friend class InterceptedChannelContent;
   friend class OverrideRunnable;
 };
 
+// A stream listener interposed between the nsInputStreamPump used for intercepted channels
+// and this channel's original listener. This is only used to ensure the original listener
+// sees the channel as the request object, and to synthesize OnStatus and OnProgress notifications.
+class InterceptStreamListener : public nsIStreamListener
+                              , public nsIProgressEventSink
+{
+  RefPtr<HttpChannelChild> mOwner;
+  nsCOMPtr<nsISupports> mContext;
+  virtual ~InterceptStreamListener() {}
+ public:
+  InterceptStreamListener(HttpChannelChild* aOwner, nsISupports* aContext)
+  : mOwner(aOwner)
+  , mContext(aContext)
+  {
+  }
+
+  NS_DECL_ISUPPORTS
+  NS_DECL_NSIREQUESTOBSERVER
+  NS_DECL_NSISTREAMLISTENER
+  NS_DECL_NSIPROGRESSEVENTSINK
+
+  void Cleanup();
+};
+
 //-----------------------------------------------------------------------------
 // inline functions
 //-----------------------------------------------------------------------------
 
 inline bool
 HttpChannelChild::IsSuspended()
 {
   return mSuspendCount != 0;
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -33,16 +33,17 @@
 #include "nsICachingChannel.h"
 #include "mozilla/LoadInfo.h"
 #include "nsQueryObject.h"
 #include "mozilla/BasePrincipal.h"
 #include "nsCORSListenerProxy.h"
 #include "nsIPrompt.h"
 #include "nsIWindowWatcher.h"
 #include "nsIDocument.h"
+#include "nsStringStream.h"
 
 using mozilla::BasePrincipal;
 using namespace mozilla::dom;
 using namespace mozilla::ipc;
 
 namespace mozilla {
 namespace net {
 
--- a/netwerk/protocol/http/HttpChannelParent.h
+++ b/netwerk/protocol/http/HttpChannelParent.h
@@ -35,16 +35,17 @@ namespace mozilla {
 namespace dom{
 class TabParent;
 class PBrowserOrId;
 } // namespace dom
 
 namespace net {
 
 class HttpChannelParentListener;
+class ChannelEventQueue;
 
 // Note: nsIInterfaceRequestor must be the first base so that do_QueryObject()
 // works correctly on this object, as it's needed to compute a void* pointing to
 // the beginning of this object.
 
 class HttpChannelParent final : public nsIInterfaceRequestor
                               , public PHttpChannelParent
                               , public nsIParentRedirectingChannel
--- a/netwerk/protocol/http/HttpChannelParentListener.cpp
+++ b/netwerk/protocol/http/HttpChannelParentListener.cpp
@@ -9,16 +9,17 @@
 
 #include "HttpChannelParentListener.h"
 #include "mozilla/net/HttpChannelParent.h"
 #include "mozilla/unused.h"
 #include "nsIRedirectChannelRegistrar.h"
 #include "nsIHttpEventSink.h"
 #include "nsIPackagedAppChannelListener.h"
 #include "nsIHttpHeaderVisitor.h"
+#include "nsQueryObject.h"
 
 using mozilla::Unused;
 
 namespace mozilla {
 namespace net {
 
 HttpChannelParentListener::HttpChannelParentListener(HttpChannelParent* aInitialChannel)
   : mNextListener(aInitialChannel)
--- a/netwerk/protocol/http/HttpChannelParentListener.h
+++ b/netwerk/protocol/http/HttpChannelParentListener.h
@@ -8,16 +8,17 @@
 #ifndef mozilla_net_HttpChannelCallbackWrapper_h
 #define mozilla_net_HttpChannelCallbackWrapper_h
 
 #include "nsIInterfaceRequestor.h"
 #include "nsIChannelEventSink.h"
 #include "nsIRedirectResultListener.h"
 #include "nsIPackagedAppChannelListener.h"
 #include "nsINetworkInterceptController.h"
+#include "nsIStreamListener.h"
 
 namespace mozilla {
 namespace net {
 
 class HttpChannelParent;
 
 #define HTTP_CHANNEL_PARENT_LISTENER_IID \
   { 0xe409da52, 0xda76, 0x4eb7, \
--- a/netwerk/protocol/http/InterceptedChannel.cpp
+++ b/netwerk/protocol/http/InterceptedChannel.cpp
@@ -10,16 +10,17 @@
 #include "nsInputStreamPump.h"
 #include "nsIPipe.h"
 #include "nsIStreamListener.h"
 #include "nsHttpChannel.h"
 #include "HttpChannelChild.h"
 #include "nsHttpResponseHead.h"
 #include "mozilla/ConsoleReportCollector.h"
 #include "mozilla/dom/ChannelInfo.h"
+#include "nsIChannelEventSink.h"
 
 namespace mozilla {
 namespace net {
 
 extern bool
 WillRedirect(const nsHttpResponseHead * response);
 
 extern nsresult
--- a/netwerk/protocol/http/NullHttpChannel.cpp
+++ b/netwerk/protocol/http/NullHttpChannel.cpp
@@ -1,16 +1,17 @@
 /* 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 "NullHttpChannel.h"
 #include "nsContentUtils.h"
 #include "nsContentSecurityManager.h"
 #include "nsIScriptSecurityManager.h"
+#include "nsIStreamListener.h"
 
 namespace mozilla {
 namespace net {
 
 NS_IMPL_ISUPPORTS(NullHttpChannel, nsINullChannel,
                   nsIHttpChannel, nsITimedChannel)
 
 NullHttpChannel::NullHttpChannel()
--- a/netwerk/protocol/http/NullHttpTransaction.cpp
+++ b/netwerk/protocol/http/NullHttpTransaction.cpp
@@ -9,16 +9,17 @@
 
 #include "nsHttp.h"
 #include "NullHttpTransaction.h"
 #include "nsHttpHandler.h"
 #include "nsHttpRequestHead.h"
 #include "nsIHttpActivityObserver.h"
 #include "NullHttpChannel.h"
 #include "nsQueryObject.h"
+#include "nsNetUtil.h"
 
 namespace mozilla {
 namespace net {
 
 class CallObserveActivity final : public nsIRunnable
 {
   ~CallObserveActivity()
   {
--- a/netwerk/protocol/http/PackagedAppService.cpp
+++ b/netwerk/protocol/http/PackagedAppService.cpp
@@ -1,28 +1,38 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set sw=2 ts=8 et tw=80 : */
 /* 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 "PackagedAppService.h"
 #include "nsICacheStorage.h"
 #include "LoadContextInfo.h"
 #include "nsICacheStorageService.h"
 #include "nsIResponseHeadProvider.h"
 #include "nsIMultiPartChannel.h"
 #include "../../cache2/CacheFileUtils.h"
 #include "nsStreamUtils.h"
-#include "mozilla/Logging.h"
 #include "mozilla/DebugOnly.h"
 #include "nsIHttpHeaderVisitor.h"
 #include "mozilla/LoadContext.h"
 #include "nsIInstallPackagedWebapp.h"
+#include "mozilla/Logging.h"
+#include "nsHttpResponseHead.h"
+#include "nsICachingChannel.h"
+#include "nsStringStream.h"
+#include "nsIOutputStream.h"
+#include "nsIInputStream.h"
+#include "nsNetUtil.h"
+#include "nsICacheEntryOpenCallback.h"
+#include "nsIURL.h"
+#include "nsContentUtils.h"
+#include "nsIStreamConverterService.h"
+#include "nsMimeTypes.h"
 
 namespace mozilla {
 namespace net {
 
 static PackagedAppService *gPackagedAppService = nullptr;
 static LazyLogModule gPASLog("PackagedAppService");
 #undef LOG
 #define LOG(args) MOZ_LOG(gPASLog, mozilla::LogLevel::Debug, args)
--- a/netwerk/protocol/http/PackagedAppService.h
+++ b/netwerk/protocol/http/PackagedAppService.h
@@ -9,16 +9,18 @@
 
 #include "nsIPackagedAppService.h"
 #include "nsILoadContextInfo.h"
 #include "nsICacheStorage.h"
 #include "PackagedAppVerifier.h"
 #include "nsIMultiPartChannel.h"
 #include "PackagedAppVerifier.h"
 #include "nsIPackagedAppChannelListener.h"
+#include "nsCOMArray.h"
+#include "nsRefPtrHashtable.h"
 
 namespace mozilla {
 namespace net {
 
 class nsHttpResponseHead;
 
 // This service is used to download packages from the web.
 // Individual resources in the package are saved in the browser cache. It also
@@ -265,9 +267,9 @@ private:
   // Should only be used on the main thread.
   nsRefPtrHashtable<nsCStringHashKey, PackagedAppDownloader> mDownloadingPackages;
 };
 
 
 } // namespace net
 } // namespace mozilla
 
-#endif // mozilla_net_PackagedAppService_h
\ No newline at end of file
+#endif // mozilla_net_PackagedAppService_h
--- a/netwerk/protocol/http/PackagedAppVerifier.cpp
+++ b/netwerk/protocol/http/PackagedAppVerifier.cpp
@@ -14,16 +14,17 @@
 #include "nsITimer.h"
 #include "nsIPackagedAppVerifier.h"
 #include "mozilla/Preferences.h"
 #include "nsIPackagedAppUtils.h"
 #include "nsIInputStream.h"
 #include "nsComponentManagerUtils.h"
 #include "nsIURL.h"
 #include "mozilla/BasePrincipal.h"
+#include "HttpLog.h"
 
 static const short kResourceHashType = nsICryptoHash::SHA256;
 
 static bool gSignedAppEnabled = false;
 
 namespace mozilla {
 namespace net {
 
--- a/netwerk/protocol/http/nsCORSListenerProxy.cpp
+++ b/netwerk/protocol/http/nsCORSListenerProxy.cpp
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/Assertions.h"
 #include "mozilla/LinkedList.h"
 
 #include "nsCORSListenerProxy.h"
 #include "nsIChannel.h"
 #include "nsIHttpChannel.h"
-#include "nsIHttpChannelChild.h"
+#include "HttpChannelChild.h"
 #include "nsIHttpChannelInternal.h"
 #include "nsError.h"
 #include "nsContentUtils.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsNetUtil.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsMimeTypes.h"
--- a/netwerk/protocol/http/nsHttpBasicAuth.cpp
+++ b/netwerk/protocol/http/nsHttpBasicAuth.cpp
@@ -3,16 +3,17 @@
  * 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/. */
 
 // HttpLog.h should generally be included first
 #include "HttpLog.h"
 
 #include "nsHttpBasicAuth.h"
 #include "plbase64.h"
+#include "plstr.h"
 #include "nsString.h"
 
 namespace mozilla {
 namespace net {
 
 //-----------------------------------------------------------------------------
 // nsHttpBasicAuth <public>
 //-----------------------------------------------------------------------------
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -83,16 +83,18 @@
 #include "nsIHttpPushListener.h"
 #include "nsIX509Cert.h"
 #include "ScopedNSSTypes.h"
 #include "nsNullPrincipal.h"
 #include "nsIPackagedAppService.h"
 #include "nsIDeprecationWarner.h"
 #include "nsIDocument.h"
 #include "nsICompressConvStats.h"
+#include "nsCORSListenerProxy.h"
+#include "nsISocketProvider.h"
 
 namespace mozilla { namespace net {
 
 namespace {
 
 // Monotonically increasing ID for generating unique cache entries per
 // intercepted channel.
 static uint64_t gNumIntercepted = 0;
--- a/netwerk/protocol/http/nsHttpChunkedDecoder.cpp
+++ b/netwerk/protocol/http/nsHttpChunkedDecoder.cpp
@@ -3,16 +3,17 @@
  * 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/. */
 
 // HttpLog.h should generally be included first
 #include "HttpLog.h"
 #include <errno.h>
 #include "nsHttpChunkedDecoder.h"
 #include <algorithm>
+#include "plstr.h"
 
 namespace mozilla {
 namespace net {
 
 //-----------------------------------------------------------------------------
 // nsHttpChunkedDecoder <public>
 //-----------------------------------------------------------------------------
 
--- a/netwerk/protocol/http/nsHttpConnectionInfo.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionInfo.cpp
@@ -12,16 +12,18 @@
 #define LOG(args) LOG5(args)
 #undef LOG_ENABLED
 #define LOG_ENABLED() LOG5_ENABLED()
 
 #include "nsHttpConnectionInfo.h"
 #include "mozilla/net/DNS.h"
 #include "prnetdb.h"
 #include "nsICryptoHash.h"
+#include "nsComponentManagerUtils.h"
+#include "nsIProtocolProxyService.h"
 
 static nsresult
 SHA256(const char* aPlainText, nsAutoCString& aResult)
 {
   static nsICryptoHash* hasher = nullptr;
   nsresult rv;
   if (!hasher) {
     rv = CallCreateInstance("@mozilla.org/security/hash;1", &hasher);
--- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
@@ -29,16 +29,17 @@
 #include "nsIDNSRecord.h"
 #include "nsITransport.h"
 #include "nsInterfaceRequestorAgg.h"
 #include "nsISchedulingContext.h"
 #include "nsISocketTransportService.h"
 #include <algorithm>
 #include "mozilla/ChaosMode.h"
 #include "mozilla/unused.h"
+#include "nsIURI.h"
 
 #include "mozilla/Telemetry.h"
 
 namespace mozilla {
 namespace net {
 
 //-----------------------------------------------------------------------------
 
--- a/netwerk/protocol/http/nsHttpDigestAuth.cpp
+++ b/netwerk/protocol/http/nsHttpDigestAuth.cpp
@@ -13,16 +13,17 @@
 #include "nsISupportsPrimitives.h"
 #include "nsIURI.h"
 #include "nsString.h"
 #include "nsEscape.h"
 #include "nsNetCID.h"
 #include "prprf.h"
 #include "nsCRT.h"
 #include "nsICryptoHash.h"
+#include "nsComponentManagerUtils.h"
 
 namespace mozilla {
 namespace net {
 
 //-----------------------------------------------------------------------------
 // nsHttpDigestAuth <public>
 //-----------------------------------------------------------------------------
 
--- a/netwerk/protocol/viewsource/nsViewSourceHandler.h
+++ b/netwerk/protocol/viewsource/nsViewSourceHandler.h
@@ -2,18 +2,22 @@
 /* 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 nsViewSourceHandler_h___
 #define nsViewSourceHandler_h___
 
 #include "nsIProtocolHandler.h"
+#include "nsNetUtil.h"
 #include "mozilla/Attributes.h"
 
+class nsINode;
+class nsIPrincipal;
+
 class nsViewSourceHandler final : public nsIProtocolHandler
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIPROTOCOLHANDLER
 
     nsViewSourceHandler();
 
--- a/netwerk/protocol/websocket/BaseWebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/BaseWebSocketChannel.cpp
@@ -3,16 +3,17 @@
 /* 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 "WebSocketLog.h"
 #include "BaseWebSocketChannel.h"
 #include "MainThreadUtils.h"
 #include "nsILoadGroup.h"
+#include "nsINode.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsAutoPtr.h"
 #include "nsProxyRelease.h"
 #include "nsStandardURL.h"
 #include "LoadInfo.h"
 #include "nsIDOMNode.h"
 #include "mozilla/dom/ContentChild.h"
 
--- a/netwerk/protocol/websocket/WebSocketEventListenerParent.cpp
+++ b/netwerk/protocol/websocket/WebSocketEventListenerParent.cpp
@@ -1,14 +1,15 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 "WebSocketEventService.h"
 #include "WebSocketEventListenerParent.h"
 #include "mozilla/unused.h"
 
 namespace mozilla {
 namespace net {
 
 NS_INTERFACE_MAP_BEGIN(WebSocketEventListenerParent)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebSocketEventListener)
--- a/netwerk/protocol/websocket/WebSocketEventService.cpp
+++ b/netwerk/protocol/websocket/WebSocketEventService.cpp
@@ -6,18 +6,21 @@
 
 #include "WebSocketEventListenerChild.h"
 #include "WebSocketEventService.h"
 #include "WebSocketFrame.h"
 
 #include "mozilla/net/NeckoChild.h"
 #include "mozilla/StaticPtr.h"
 #include "nsISupportsPrimitives.h"
+#include "nsIObserverService.h"
 #include "nsXULAppAPI.h"
 #include "nsSocketTransportService2.h"
+#include "nsThreadUtils.h"
+#include "mozilla/Services.h"
 
 namespace mozilla {
 namespace net {
 
 namespace {
 
 StaticRefPtr<WebSocketEventService> gWebSocketEventService;
 
--- a/netwerk/protocol/websocket/WebSocketFrame.cpp
+++ b/netwerk/protocol/websocket/WebSocketFrame.cpp
@@ -3,16 +3,18 @@
 /* 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 "WebSocketFrame.h"
 
 #include "WebSocketChannel.h"
 #include "nsSocketTransportService2.h"
+#include "nsThreadUtils.h" // for NS_IsMainThread
+#include "ipc/IPCMessageUtils.h"
 
 namespace mozilla {
 namespace net {
 
 NS_INTERFACE_MAP_BEGIN(WebSocketFrame)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebSocketFrame)
   NS_INTERFACE_MAP_ENTRY(nsIWebSocketFrame)
 NS_INTERFACE_MAP_END
--- a/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp
+++ b/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp
@@ -24,16 +24,17 @@
 #include "nsIOutputStream.h"
 #include "nsIProgressEventSink.h"
 #include "nsIURI.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/unused.h"
 #include "mozilla/BasePrincipal.h"
 #include "nsProxyRelease.h"
 #include "nsContentSecurityManager.h"
+#include "nsContentUtils.h"
 
 typedef mozilla::net::LoadContextInfo LoadContextInfo;
 
 // Must release mChannel on the main thread
 class nsWyciwygAsyncEvent : public nsRunnable {
 public:
   explicit nsWyciwygAsyncEvent(nsWyciwygChannel *aChannel) : mChannel(aChannel) {}
 
--- a/netwerk/protocol/wyciwyg/nsWyciwygProtocolHandler.cpp
+++ b/netwerk/protocol/wyciwyg/nsWyciwygProtocolHandler.cpp
@@ -7,16 +7,17 @@
 #include "nsWyciwyg.h"
 #include "nsWyciwygChannel.h"
 #include "nsWyciwygProtocolHandler.h"
 #include "nsNetCID.h"
 #include "nsServiceManagerUtils.h"
 #include "plstr.h"
 #include "nsIObserverService.h"
 #include "mozIApplicationClearPrivateDataParams.h"
+#include "nsIURI.h"
 
 #include "mozilla/net/NeckoChild.h"
 
 using namespace mozilla::net;
 #include "mozilla/net/WyciwygChannelChild.h"
 
 ////////////////////////////////////////////////////////////////////////////////
 
--- a/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
+++ b/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
@@ -4,16 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozTXTToHTMLConv.h"
 #include "nsNetUtil.h"
 #include "nsUnicharUtils.h"
 #include "nsCRT.h"
 #include "nsIExternalProtocolHandler.h"
 #include "nsIIOService.h"
+#include "nsIURI.h"
 
 #include <algorithm>
 
 #ifdef DEBUG_BenB_Perf
 #include "prtime.h"
 #include "prinrval.h"
 #endif
 
--- a/netwerk/streamconv/converters/nsFTPDirListingConv.cpp
+++ b/netwerk/streamconv/converters/nsFTPDirListingConv.cpp
@@ -27,16 +27,17 @@
 //
 //    set NSPR_LOG_MODULES=nsFTPDirListConv:5
 //    set NSPR_LOG_FILE=nspr.log
 //
 // this enables LogLevel::Debug level information and places all output in
 // the file nspr.log
 //
 static mozilla::LazyLogModule gFTPDirListConvLog("nsFTPDirListingConv");
+using namespace mozilla;
 
 // nsISupports implementation
 NS_IMPL_ISUPPORTS(nsFTPDirListingConv,
                   nsIStreamConverter,
                   nsIStreamListener, 
                   nsIRequestObserver)
 
 
--- a/netwerk/streamconv/converters/nsHTTPCompressConv.cpp
+++ b/netwerk/streamconv/converters/nsHTTPCompressConv.cpp
@@ -9,17 +9,19 @@
 #include "plstr.h"
 #include "nsCOMPtr.h"
 #include "nsError.h"
 #include "nsStreamUtils.h"
 #include "nsStringStream.h"
 #include "nsComponentManagerUtils.h"
 #include "nsThreadUtils.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/Logging.h"
 #include "nsIForcePendingChannel.h"
+#include "nsIRequest.h"
 
 // brotli headers
 #include "state.h"
 #include "decode.h"
 
 namespace mozilla {
 namespace net {
 
--- a/netwerk/streamconv/converters/nsHTTPCompressConv.h
+++ b/netwerk/streamconv/converters/nsHTTPCompressConv.h
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #if !defined (__nsHTTPCompressConv__h__)
 #define	__nsHTTPCompressConv__h__	1
 
 #include "nsIStreamConverter.h"
 #include "nsICompressConvStats.h"
 #include "nsCOMPtr.h"
+#include "nsAutoPtr.h"
 
 #include "zlib.h"
 
 // brotli includes
 #undef assert
 #include "assert.h"
 #include "state.h"
 
--- a/netwerk/streamconv/converters/nsIndexedToHTML.cpp
+++ b/netwerk/streamconv/converters/nsIndexedToHTML.cpp
@@ -19,16 +19,17 @@
 #include "nsIPrefBranch.h"
 #include "nsIPrefLocalizedString.h"
 #include "nsIChromeRegistry.h"
 #include "nsIDateTimeFormat.h"
 #include "nsIStringBundle.h"
 #include "nsITextToSubURI.h"
 #include "nsXPIDLString.h"
 #include <algorithm>
+#include "nsIChannel.h"
 
 NS_IMPL_ISUPPORTS(nsIndexedToHTML,
                   nsIDirIndexListener,
                   nsIStreamConverter,
                   nsIRequestObserver,
                   nsIStreamListener)
 
 static void AppendNonAsciiToNCR(const nsAString& in, nsCString& out)
--- a/netwerk/streamconv/converters/nsMultiMixedConv.cpp
+++ b/netwerk/streamconv/converters/nsMultiMixedConv.cpp
@@ -12,16 +12,18 @@
 #include "nsCRT.h"
 #include "nsIHttpChannelInternal.h"
 #include "nsURLHelper.h"
 #include "nsIStreamConverterService.h"
 #include "nsICacheInfoChannel.h"
 #include <algorithm>
 #include "nsContentSecurityManager.h"
 #include "nsHttp.h"
+#include "nsNetUtil.h"
+#include "nsIURI.h"
 
 //
 // Helper function for determining the length of data bytes up to
 // the next multipart token.  A token is usually preceded by a LF
 // or CRLF delimiter.
 // 
 static uint32_t
 LengthToToken(const char *cursor, const char *token)
--- a/netwerk/streamconv/converters/nsTXTToHTMLConv.cpp
+++ b/netwerk/streamconv/converters/nsTXTToHTMLConv.cpp
@@ -9,16 +9,18 @@
 #include "nsAutoPtr.h"
 #include "nsIChannel.h"
 #include <algorithm>
 
 #include "mozilla/UniquePtrExtensions.h"
 
 #define TOKEN_DELIMITERS MOZ_UTF16("\t\r\n ")
 
+using namespace mozilla;
+
 // nsISupports methods
 NS_IMPL_ISUPPORTS(nsTXTToHTMLConv,
                   nsIStreamConverter,
                   nsITXTToHTMLConv,
                   nsIRequestObserver,
                   nsIStreamListener)
 
 
--- a/netwerk/streamconv/converters/nsUnknownDecoder.cpp
+++ b/netwerk/streamconv/converters/nsUnknownDecoder.cpp
@@ -15,16 +15,18 @@
 
 #include "nsIMIMEService.h"
 
 #include "nsIDivertableChannel.h"
 #include "nsIViewSourceChannel.h"
 #include "nsIHttpChannel.h"
 #include "nsIForcePendingChannel.h"
 #include "nsIEncodedChannel.h"
+#include "nsIURI.h"
+#include "nsStringStream.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 
 #include <algorithm>
 
 #define MAX_BUFFER_SIZE 512u
 
 NS_IMPL_ISUPPORTS(nsUnknownDecoder::ConvertedStreamListener,