Bug 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan
authorGabriele Svelto <gsvelto@mozilla.com>
Fri, 06 Dec 2019 09:17:57 +0000
changeset 505803 1f438b01c7801e7d750c4297330669621d3b7a4f
parent 505802 73820a049c644c3f3af58cece3bdb7cd0e4b2185
child 505804 7105703993db76574622572c41e43a8871bf5ef3
push id36888
push userrgurzau@mozilla.com
push dateFri, 06 Dec 2019 16:33:05 +0000
treeherdermozilla-central@a960f4ebc0c6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEhsan
bugs1600545
milestone73.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 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan The inclusions were removed with the following very crude script and the resulting breakage was fixed up by hand. The manual fixups did either revert the changes done by the script, replace a generic header with a more specific one or replace a header with a forward declaration. find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2) if [ -n "$interfaces" ]; then if [[ "$interfaces" == *$'\n'* ]]; then regexp="\(" for i in $interfaces; do regexp="$regexp$i\|"; done regexp="${regexp%%\\\|}\)" else regexp="$interfaces" fi interface=$(basename "$path") rg -l "#include.*${interface%%.idl}.h" . | while read path2; do hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" ) if [ $hits -eq 0 ]; then echo "Removing ${interface} from ${path2}" grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp mv -f "$path2".tmp "$path2" fi done fi done Differential Revision: https://phabricator.services.mozilla.com/D55444
modules/libjar/nsJAR.cpp
modules/libjar/nsJAR.h
modules/libjar/nsJARChannel.cpp
modules/libjar/nsJARInputStream.cpp
modules/libjar/nsJARProtocolHandler.cpp
modules/libjar/nsJARProtocolHandler.h
modules/libjar/nsJARURI.cpp
modules/libjar/zipwriter/nsDeflateConverter.cpp
modules/libjar/zipwriter/nsDeflateConverter.h
modules/libjar/zipwriter/nsZipWriter.cpp
modules/libjar/zipwriter/nsZipWriter.h
modules/libpref/Preferences.cpp
netwerk/base/BackgroundFileSaver.cpp
netwerk/base/ChannelDiverterChild.cpp
netwerk/base/Dashboard.cpp
netwerk/base/Dashboard.h
netwerk/base/IOActivityMonitor.cpp
netwerk/base/LoadInfo.cpp
netwerk/base/LoadInfo.h
netwerk/base/NetworkConnectivityService.cpp
netwerk/base/Predictor.cpp
netwerk/base/SimpleBuffer.h
netwerk/base/TLSServerSocket.cpp
netwerk/base/Tickler.cpp
netwerk/base/nsAsyncRedirectVerifyHelper.h
netwerk/base/nsBaseChannel.cpp
netwerk/base/nsDirectoryIndexStream.cpp
netwerk/base/nsDownloader.cpp
netwerk/base/nsIOService.cpp
netwerk/base/nsInputStreamPump.cpp
netwerk/base/nsLoadGroup.cpp
netwerk/base/nsMIMEInputStream.h
netwerk/base/nsNetUtil.cpp
netwerk/base/nsPACMan.cpp
netwerk/base/nsProtocolProxyService.cpp
netwerk/base/nsProtocolProxyService.h
netwerk/base/nsSocketTransportService2.cpp
netwerk/base/nsStandardURL.h
netwerk/base/nsStreamListenerWrapper.h
netwerk/base/nsStreamTransportService.cpp
netwerk/base/nsSyncStreamListener.cpp
netwerk/base/nsUDPSocket.cpp
netwerk/base/nsURLHelperWin.cpp
netwerk/build/nsNetModule.cpp
netwerk/cache/nsApplicationCacheService.cpp
netwerk/cache/nsCacheEntry.cpp
netwerk/cache/nsCacheEntry.h
netwerk/cache/nsCacheService.cpp
netwerk/cache/nsCacheService.h
netwerk/cache/nsDeleteDir.cpp
netwerk/cache/nsDiskCacheDeviceSQL.cpp
netwerk/cache/nsDiskCacheDeviceSQL.h
netwerk/cache2/CacheEntry.cpp
netwerk/cache2/CacheFileContextEvictor.cpp
netwerk/cache2/CacheFileIOManager.cpp
netwerk/cache2/CacheIndex.cpp
netwerk/cache2/CacheStorage.h
netwerk/cookie/CookieServiceChild.cpp
netwerk/cookie/CookieServiceParent.cpp
netwerk/cookie/nsCookie.h
netwerk/cookie/nsCookiePermission.cpp
netwerk/cookie/nsCookieService.cpp
netwerk/cookie/nsCookieService.h
netwerk/dns/ChildDNSService.cpp
netwerk/dns/DNSListenerProxy.cpp
netwerk/dns/DNSRequestChild.cpp
netwerk/dns/DNSRequestParent.cpp
netwerk/dns/DNSRequestParent.h
netwerk/dns/TRRService.cpp
netwerk/dns/mdns/libmdns/MDNSResponderReply.h
netwerk/dns/nsDNSService2.cpp
netwerk/dns/nsIDNService.cpp
netwerk/dns/nsIDNService.h
netwerk/ipc/DocumentLoadListener.cpp
netwerk/ipc/NeckoMessageUtils.h
netwerk/ipc/NeckoTargetHolder.cpp
netwerk/ipc/SocketProcessChild.cpp
netwerk/mime/nsMIMEHeaderParamImpl.cpp
netwerk/protocol/about/nsAboutCache.cpp
netwerk/protocol/about/nsAboutCacheEntry.cpp
netwerk/protocol/data/nsDataModule.cpp
netwerk/protocol/ftp/FTPChannelParent.cpp
netwerk/protocol/ftp/nsFtpConnectionThread.cpp
netwerk/protocol/ftp/nsFtpControlConnection.cpp
netwerk/protocol/ftp/nsFtpProtocolHandler.cpp
netwerk/protocol/gio/nsGIOProtocolHandler.cpp
netwerk/protocol/http/BackgroundChannelRegistrar.cpp
netwerk/protocol/http/ClassifierDummyChannel.h
netwerk/protocol/http/ClassifierDummyChannelChild.cpp
netwerk/protocol/http/ClassifierDummyChannelParent.cpp
netwerk/protocol/http/Http2Compression.h
netwerk/protocol/http/Http2Push.h
netwerk/protocol/http/Http2Stream.cpp
netwerk/protocol/http/HttpAuthUtils.cpp
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/InterceptedChannel.cpp
netwerk/protocol/http/PHttpChannelParams.h
netwerk/protocol/http/ParentChannelListener.cpp
netwerk/protocol/http/nsCORSListenerProxy.cpp
netwerk/protocol/http/nsCORSListenerProxy.h
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/protocol/http/nsHttpChannel.h
netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
netwerk/protocol/http/nsHttpConnectionMgr.cpp
netwerk/protocol/http/nsHttpHandler.cpp
netwerk/protocol/http/nsHttpNTLMAuth.cpp
netwerk/protocol/http/nsHttpTransaction.cpp
netwerk/protocol/res/ExtensionProtocolHandler.cpp
netwerk/protocol/res/nsResProtocolHandler.cpp
netwerk/protocol/websocket/WebSocketChannel.cpp
netwerk/protocol/websocket/WebSocketChannel.h
netwerk/protocol/websocket/WebSocketFrame.h
netwerk/socket/nsNamedPipeIOLayer.cpp
netwerk/socket/nsNamedPipeService.cpp
netwerk/socket/nsSOCKSIOLayer.cpp
netwerk/socket/nsSOCKSSocketProvider.cpp
netwerk/socket/nsSocketProviderService.cpp
netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
netwerk/streamconv/converters/nsIndexedToHTML.cpp
netwerk/streamconv/converters/nsMultiMixedConv.cpp
netwerk/streamconv/converters/nsMultiMixedConv.h
netwerk/streamconv/converters/nsUnknownDecoder.cpp
netwerk/streamconv/nsStreamConverterService.cpp
netwerk/system/netlink/NetlinkService.h
netwerk/system/win32/nsNotifyAddrListener.cpp
netwerk/test/TestBind.cpp
netwerk/test/TestCookie.cpp
netwerk/test/TestUDPSocket.cpp
netwerk/test/fuzz/TestFtpFuzzing.cpp
netwerk/test/fuzz/TestHttpFuzzing.cpp
netwerk/test/gtest/TestMIMEInputStream.cpp
netwerk/test/gtest/TestPartiallySeekableInputStream.cpp
netwerk/test/gtest/TestURIMutator.cpp
netwerk/url-classifier/AsyncUrlChannelClassifier.cpp
netwerk/url-classifier/nsChannelClassifier.cpp
netwerk/wifi/nsWifiMonitor.h
netwerk/wifi/nsWifiScannerMac.cpp
netwerk/wifi/nsWifiScannerSolaris.cpp
netwerk/wifi/nsWifiScannerWin.cpp
parser/html/nsHtml5Module.cpp
parser/html/nsHtml5OplessBuilder.cpp
parser/html/nsHtml5Parser.h
parser/html/nsHtml5TreeBuilder.cpp
parser/html/nsHtml5TreeBuilder.h
parser/html/nsHtml5TreeOpExecutor.cpp
parser/html/nsHtml5TreeOperation.cpp
parser/html/nsParserUtils.cpp
parser/htmlparser/CParserContext.h
parser/htmlparser/nsParser.cpp
parser/htmlparser/nsParser.h
parser/htmlparser/nsParserMsgUtils.cpp
parser/htmlparser/nsScanner.cpp
security/apps/AppSignatureVerification.cpp
security/apps/AppTrustDomain.h
security/certverifier/tests/gtest/TrustOverrideTest.cpp
security/manager/pki/nsASN1Tree.h
security/manager/pki/nsNSSDialogHelper.cpp
security/manager/ssl/CSTrustDomain.h
security/manager/ssl/CertBlocklist.cpp
security/manager/ssl/CertBlocklist.h
security/manager/ssl/NSSErrorsService.cpp
security/manager/ssl/NSSErrorsService.h
security/manager/ssl/OSKeyStore.cpp
security/manager/ssl/PSMContentListener.cpp
security/manager/ssl/SecretDecoderRing.cpp
security/manager/ssl/TransportSecurityInfo.cpp
security/manager/ssl/nsCertTree.h
security/manager/ssl/nsClientAuthRemember.cpp
security/manager/ssl/nsClientAuthRemember.h
security/manager/ssl/nsNSSASN1Object.cpp
security/manager/ssl/nsNSSCallbacks.cpp
security/manager/ssl/nsNSSCertificate.cpp
security/manager/ssl/nsNSSCertificate.h
security/manager/ssl/nsNSSCertificateDB.cpp
security/manager/ssl/nsNSSComponent.cpp
security/manager/ssl/nsNSSIOLayer.cpp
security/manager/ssl/nsNSSIOLayer.h
security/manager/ssl/nsNSSModule.cpp
security/manager/ssl/nsPKCS12Blob.cpp
security/manager/ssl/nsPKCS12Blob.h
security/manager/ssl/tests/gtest/CertDBTest.cpp
security/manager/ssl/tests/gtest/CertListTest.cpp
security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp
security/sandbox/win/src/remotesandboxbroker/RemoteSandboxBrokerProcessParent.cpp
startupcache/StartupCache.cpp
startupcache/StartupCache.h
startupcache/StartupCacheUtils.cpp
startupcache/test/TestStartupCache.cpp
storage/FileSystemModule.cpp
storage/VacuumManager.h
storage/mozStorageAsyncStatement.cpp
storage/mozStorageAsyncStatementJSHelper.h
storage/mozStorageConnection.cpp
storage/mozStorageConnection.h
storage/mozStorageHelper.h
storage/mozStoragePrivateHelpers.cpp
storage/mozStorageService.cpp
storage/mozStorageStatementData.h
storage/mozStorageStatementJSHelper.h
storage/storage.h
storage/test/gtest/storage_test_harness.h
storage/test/gtest/test_AsXXX_helpers.cpp
storage/test/gtest/test_asyncStatementExecution_transaction.cpp
storage/test/gtest/test_async_callbacks_with_spun_event_loops.cpp
toolkit/components/alerts/nsAlertsService.cpp
toolkit/components/alerts/nsAlertsUtils.cpp
toolkit/components/alerts/nsXULAlerts.cpp
toolkit/components/antitracking/AntiTrackingCommon.cpp
toolkit/components/antitracking/StoragePrincipalHelper.cpp
toolkit/components/autocomplete/nsAutoCompleteController.cpp
toolkit/components/browser/nsWebBrowser.cpp
toolkit/components/browser/nsWebBrowser.h
toolkit/components/browser/nsWebBrowserContentPolicy.cpp
toolkit/components/commandlines/nsCommandLine.cpp
toolkit/components/downloads/DownloadPlatform.cpp
toolkit/components/extensions/webrequest/ChannelWrapper.cpp
toolkit/components/extensions/webrequest/StreamFilterParent.cpp
toolkit/components/extensions/webrequest/WebRequestService.cpp
toolkit/components/filewatcher/NativeFileWatcherWin.cpp
toolkit/components/find/nsFind.cpp
toolkit/components/find/nsWebBrowserFind.cpp
toolkit/components/find/nsWebBrowserFind.h
toolkit/components/fuzzyfox/Fuzzyfox.cpp
toolkit/components/kvstore/nsKeyValueModule.cpp
toolkit/components/mediasniffer/nsMediaSniffer.cpp
toolkit/components/mediasniffer/nsMediaSniffer.h
toolkit/components/osfile/NativeOSFileInternals.cpp
toolkit/components/osfile/NativeOSFileInternals.h
toolkit/components/parentalcontrols/nsParentalControlsServiceWin.cpp
toolkit/components/places/Database.cpp
toolkit/components/places/Database.h
toolkit/components/places/FaviconHelpers.h
toolkit/components/places/Helpers.h
toolkit/components/places/History.cpp
toolkit/components/places/Shutdown.cpp
toolkit/components/places/Shutdown.h
toolkit/components/places/nsAnnoProtocolHandler.cpp
toolkit/components/places/nsFaviconService.cpp
toolkit/components/places/nsNavHistory.h
toolkit/components/places/nsNavHistoryResult.cpp
toolkit/components/places/nsPlacesMacros.h
toolkit/components/places/tests/gtest/places_test_harness_tail.h
toolkit/components/places/tests/gtest/test_IHistory.cpp
toolkit/components/printingui/ipc/PrintDataUtils.cpp
toolkit/components/printingui/ipc/PrintProgressDialogChild.cpp
toolkit/components/printingui/ipc/PrintProgressDialogChild.h
toolkit/components/printingui/ipc/PrintProgressDialogParent.cpp
toolkit/components/printingui/ipc/PrintingParent.cpp
toolkit/components/printingui/ipc/nsPrintingProxy.cpp
toolkit/components/printingui/nsPrintProgress.cpp
toolkit/components/printingui/nsPrintProgress.h
toolkit/components/printingui/nsPrintingPromptService.cpp
toolkit/components/printingui/nsPrintingPromptService.h
toolkit/components/remote/nsDBusRemoteServer.cpp
toolkit/components/remote/nsGTKRemoteServer.cpp
toolkit/components/remote/nsRemoteService.cpp
toolkit/components/remote/nsRemoteService.h
toolkit/components/remote/nsWinRemoteServer.cpp
toolkit/components/remote/nsXRemoteServer.cpp
toolkit/components/reputationservice/ApplicationReputation.cpp
toolkit/components/reputationservice/ApplicationReputation.h
toolkit/components/reputationservice/LoginReputation.cpp
toolkit/components/reputationservice/LoginReputation.h
toolkit/components/resistfingerprinting/nsRFPService.cpp
toolkit/components/resistfingerprinting/tests/test_reduceprecision.cpp
toolkit/components/satchel/nsFormFillController.cpp
toolkit/components/satchel/nsFormFillController.h
toolkit/components/sessionstore/SessionStoreListener.cpp
toolkit/components/startup/nsAppStartup.cpp
toolkit/components/startup/nsAppStartup.h
toolkit/components/statusfilter/nsBrowserStatusFilter.cpp
toolkit/components/telemetry/core/Stopwatch.cpp
toolkit/components/telemetry/core/Telemetry.cpp
toolkit/components/telemetry/core/TelemetryCommon.cpp
toolkit/components/telemetry/geckoview/gtest/TestGeckoView.cpp
toolkit/components/telemetry/tests/gtest/TestCounters.cpp
toolkit/components/telemetry/tests/gtest/TestHistograms.cpp
toolkit/components/telemetry/tests/gtest/TestScalars.cpp
toolkit/components/terminator/nsTerminator.cpp
toolkit/components/thumbnails/PageThumbsProtocol.cpp
toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
toolkit/components/typeaheadfind/nsTypeAheadFind.h
toolkit/components/url-classifier/Classifier.cpp
toolkit/components/url-classifier/Entries.h
toolkit/components/url-classifier/HashStore.cpp
toolkit/components/url-classifier/HashStore.h
toolkit/components/url-classifier/LookupCache.cpp
toolkit/components/url-classifier/LookupCache.h
toolkit/components/url-classifier/VariableLengthPrefixSet.cpp
toolkit/components/url-classifier/nsCheckSummedOutputStream.cpp
toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
toolkit/components/url-classifier/nsUrlClassifierDBService.h
toolkit/components/url-classifier/nsUrlClassifierInfo.h
toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp
toolkit/components/url-classifier/nsUrlClassifierPrefixSet.h
toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp
toolkit/components/windowwatcher/nsWindowWatcher.cpp
toolkit/components/xulstore/XULStore.cpp
toolkit/crashreporter/nsExceptionHandler.cpp
toolkit/profile/gtest/TestProfileLockRetry.cpp
toolkit/system/androidproxy/nsAndroidSystemProxySettings.cpp
toolkit/system/gnome/nsAlertsIconListener.cpp
toolkit/system/gnome/nsGIOService.cpp
toolkit/system/osxproxy/nsOSXSystemProxySettings.mm
toolkit/system/unixproxy/nsLibProxySettings.cpp
toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
toolkit/system/windowsDHCPClient/nsWindowsDHCPClient.h
toolkit/system/windowsDHCPClient/tests/gtest/TestDHCPUtils.cpp
toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp
toolkit/xre/MacApplicationDelegate.mm
toolkit/xre/MacLaunchHelper.mm
toolkit/xre/UntrustedModulesData.cpp
toolkit/xre/UntrustedModulesProcessor.h
toolkit/xre/nsAndroidStartup.cpp
toolkit/xre/nsAppRunner.cpp
toolkit/xre/nsAppStartupNotifier.cpp
toolkit/xre/nsEmbedFunctions.cpp
toolkit/xre/nsNativeAppSupportCocoa.mm
toolkit/xre/nsNativeAppSupportUnix.cpp
toolkit/xre/nsUpdateDriver.cpp
toolkit/xre/nsXREDirProvider.cpp
tools/fuzzing/faulty/Faulty.cpp
tools/fuzzing/interface/FuzzingInterfaceStream.h
tools/fuzzing/interface/harness/FuzzerTestHarness.h
tools/fuzzing/messagemanager/MessageManagerFuzzer.cpp
uriloader/base/nsDocLoader.cpp
uriloader/base/nsURILoader.cpp
uriloader/exthandler/ExternalHelperAppChild.cpp
uriloader/exthandler/ExternalHelperAppParent.cpp
uriloader/exthandler/mac/nsDecodeAppleFile.h
uriloader/exthandler/mac/nsMIMEInfoMac.mm
uriloader/exthandler/mac/nsOSHelperAppService.mm
uriloader/exthandler/nsExternalHelperAppService.cpp
uriloader/exthandler/nsExternalHelperAppService.h
uriloader/exthandler/nsExternalProtocolHandler.cpp
uriloader/exthandler/nsExternalProtocolHandler.h
uriloader/exthandler/nsMIMEInfoImpl.cpp
uriloader/exthandler/nsOSHelperAppServiceChild.cpp
uriloader/exthandler/uikit/nsMIMEInfoUIKit.mm
uriloader/exthandler/unix/nsGNOMERegistry.cpp
uriloader/exthandler/unix/nsOSHelperAppService.cpp
uriloader/exthandler/unix/nsOSHelperAppService.h
uriloader/exthandler/win/nsMIMEInfoWin.cpp
uriloader/exthandler/win/nsOSHelperAppService.cpp
uriloader/prefetch/OfflineCacheUpdateChild.cpp
uriloader/prefetch/OfflineCacheUpdateGlue.cpp
uriloader/prefetch/OfflineCacheUpdateParent.cpp
uriloader/prefetch/nsOfflineCacheUpdate.cpp
uriloader/prefetch/nsOfflineCacheUpdate.h
uriloader/prefetch/nsOfflineCacheUpdateService.cpp
uriloader/prefetch/nsPrefetchService.cpp
widget/GfxInfoX11.cpp
widget/TextEventDispatcher.cpp
widget/TextEvents.h
widget/android/AndroidBridge.cpp
widget/android/EventDispatcher.cpp
widget/android/GfxInfo.cpp
widget/android/ImageDecoderSupport.cpp
widget/android/WebExecutorSupport.cpp
widget/android/nsAndroidProtocolHandler.cpp
widget/android/nsAppShell.cpp
widget/android/nsDeviceContextAndroid.cpp
widget/android/nsIdleServiceAndroid.cpp
widget/android/nsWindow.cpp
widget/cocoa/GfxInfo.mm
widget/cocoa/OSXNotificationCenter.h
widget/cocoa/nsAppShell.mm
widget/cocoa/nsChildView.mm
widget/cocoa/nsCocoaUtils.mm
widget/cocoa/nsDeviceContextSpecX.mm
widget/cocoa/nsDragService.mm
widget/cocoa/nsFilePicker.h
widget/cocoa/nsFilePicker.mm
widget/cocoa/nsIdleServiceX.mm
widget/cocoa/nsLookAndFeel.mm
widget/cocoa/nsMacDockSupport.h
widget/cocoa/nsMenuBarX.mm
widget/cocoa/nsMenuItemIconX.h
widget/cocoa/nsPrintDialogX.mm
widget/cocoa/nsPrintSettingsServiceX.mm
widget/cocoa/nsToolkit.mm
widget/cocoa/nsTouchBarUpdater.mm
widget/cocoa/nsWidgetFactory.mm
widget/gtk/nsClipboard.cpp
widget/gtk/nsClipboard.h
widget/gtk/nsClipboardWayland.cpp
widget/gtk/nsClipboardX11.cpp
widget/gtk/nsClipboardX11.h
widget/gtk/nsDeviceContextSpecG.cpp
widget/gtk/nsDragService.cpp
widget/gtk/nsFilePicker.cpp
widget/gtk/nsIdleServiceGTK.cpp
widget/gtk/nsNativeThemeGTK.cpp
widget/gtk/nsPSPrinters.cpp
widget/gtk/nsPrintDialogGTK.cpp
widget/gtk/nsSound.cpp
widget/gtk/nsWindow.cpp
widget/gtk/nsWindow.h
widget/nsBaseClipboard.cpp
widget/nsBaseDragService.cpp
widget/nsBaseDragService.h
widget/nsBaseFilePicker.cpp
widget/nsBaseWidget.cpp
widget/nsClipboardHelper.cpp
widget/nsDeviceContextSpecProxy.cpp
widget/nsDragServiceProxy.cpp
widget/nsHTMLFormatConverter.cpp
widget/nsIdleService.cpp
widget/nsNativeTheme.cpp
widget/nsPrimitiveHelpers.cpp
widget/nsPrintSettingsService.cpp
widget/nsTransferable.cpp
widget/uikit/nsAppShell.mm
widget/uikit/nsWidgetFactory.mm
widget/windows/AudioSession.cpp
widget/windows/GfxInfo.cpp
widget/windows/JumpListBuilder.cpp
widget/windows/JumpListBuilder.h
widget/windows/JumpListItem.h
widget/windows/TSFTextStore.cpp
widget/windows/TaskbarPreview.cpp
widget/windows/ToastNotificationHandler.cpp
widget/windows/ToastNotificationHandler.h
widget/windows/WinTaskbar.cpp
widget/windows/WinUtils.cpp
widget/windows/WindowsUIUtils.cpp
widget/windows/nsClipboard.cpp
widget/windows/nsDataObj.cpp
widget/windows/nsDataObj.h
widget/windows/nsDeviceContextSpecWin.cpp
widget/windows/nsDeviceContextSpecWin.h
widget/windows/nsDragService.cpp
widget/windows/nsFilePicker.cpp
widget/windows/nsNativeDragSource.cpp
widget/windows/nsNativeDragTarget.cpp
widget/windows/nsNativeDragTarget.h
widget/windows/nsPrintDialogUtil.cpp
widget/windows/nsPrintSettingsServiceWin.cpp
widget/windows/nsToolkit.cpp
widget/windows/nsToolkit.h
widget/windows/nsWidgetFactory.cpp
widget/windows/nsWindow.cpp
widget/windows/nsWindow.h
widget/windows/nsWindowGfx.cpp
widget/windows/tests/TestWinDND.cpp
xpcom/base/CycleCollectedJSRuntime.cpp
xpcom/base/nsMacPreferencesReader.mm
xpcom/base/nsMacUtilsImpl.cpp
xpcom/base/nsMemoryInfoDumper.cpp
xpcom/build/XPCOM.h
xpcom/build/XPCOMInit.cpp
xpcom/components/nsCategoryCache.cpp
xpcom/components/nsCategoryCache.h
xpcom/components/nsCategoryManager.cpp
xpcom/components/nsCategoryManagerUtils.h
xpcom/components/nsComponentManager.cpp
xpcom/components/nsServiceManagerUtils.h
xpcom/ds/nsArray.h
xpcom/ds/nsObserverService.cpp
xpcom/glue/standalone/nsXPCOMGlue.cpp
xpcom/io/FileDescriptorFile.cpp
xpcom/io/FileDescriptorFile.h
xpcom/io/FilePreferences.h
xpcom/io/InputStreamLengthHelper.cpp
xpcom/io/nsAppFileLocationProvider.h
xpcom/io/nsDirectoryServiceUtils.h
xpcom/io/nsLocalFileCommon.cpp
xpcom/io/nsLocalFileUnix.cpp
xpcom/io/nsLocalFileWin.cpp
xpcom/io/nsLocalFileWin.h
xpcom/io/nsMultiplexInputStream.h
xpcom/io/nsStreamUtils.cpp
xpcom/io/nsUnicharInputStream.cpp
xpcom/tests/RegFactory.cpp
xpcom/tests/TestHarness.h
xpcom/tests/TestStreamUtils.cpp
xpcom/tests/gtest/TestAtoms.cpp
xpcom/tests/gtest/TestBase64.cpp
xpcom/tests/gtest/TestCallTemplates.cpp
xpcom/tests/gtest/TestEventPriorities.cpp
xpcom/tests/gtest/TestExpirationTracker.cpp
xpcom/tests/gtest/TestInputStreamLengthHelper.cpp
xpcom/tests/gtest/TestObserverService.cpp
xpcom/tests/gtest/TestRacingServiceManager.cpp
xpcom/tests/gtest/TestSnappyStreams.cpp
xpcom/tests/gtest/TestThreads.cpp
xpcom/threads/LazyIdleThread.cpp
xpcom/threads/SharedThreadPool.h
xpcom/threads/SystemGroup.cpp
xpcom/threads/TimerThread.cpp
xpcom/threads/nsProcess.h
xpcom/threads/nsThread.h
xpfe/appshell/AppWindow.cpp
xpfe/appshell/nsAppShellService.cpp
xpfe/appshell/nsAppShellWindowEnumerator.cpp
xpfe/appshell/nsChromeTreeOwner.cpp
xpfe/appshell/nsContentTreeOwner.cpp
xpfe/appshell/nsWindowMediator.cpp
--- a/modules/libjar/nsJAR.cpp
+++ b/modules/libjar/nsJAR.cpp
@@ -2,17 +2,17 @@
 /* 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 <string.h>
 #include "nsJARInputStream.h"
 #include "nsJAR.h"
 #include "nsIFile.h"
-#include "nsIConsoleService.h"
+#include "nsIObserverService.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Omnijar.h"
 #include "mozilla/Unused.h"
 
 #ifdef XP_UNIX
 #  include <sys/stat.h>
 #elif defined(XP_WIN)
 #  include <io.h>
--- a/modules/libjar/nsJAR.h
+++ b/modules/libjar/nsJAR.h
@@ -9,28 +9,26 @@
 #include "nscore.h"
 #include "prio.h"
 #include "plstr.h"
 #include "mozilla/Logging.h"
 #include "prinrval.h"
 
 #include "mozilla/Atomics.h"
 #include "mozilla/Mutex.h"
-#include "nsIComponentManager.h"
 #include "nsCOMPtr.h"
 #include "nsClassHashtable.h"
 #include "nsString.h"
 #include "nsIFile.h"
 #include "nsStringEnumerator.h"
 #include "nsHashKeys.h"
 #include "nsRefPtrHashtable.h"
 #include "nsTHashtable.h"
 #include "nsIZipReader.h"
 #include "nsZipArchive.h"
-#include "nsIObserverService.h"
 #include "nsWeakReference.h"
 #include "nsIObserver.h"
 #include "mozilla/Attributes.h"
 
 class nsZipReaderCache;
 
 /*-------------------------------------------------------------------------
  * Class nsJAR declaration.
--- a/modules/libjar/nsJARChannel.cpp
+++ b/modules/libjar/nsJARChannel.cpp
@@ -5,31 +5,25 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsJAR.h"
 #include "nsJARChannel.h"
 #include "nsJARProtocolHandler.h"
 #include "nsMimeTypes.h"
 #include "nsNetUtil.h"
 #include "nsEscape.h"
-#include "nsIPrefService.h"
-#include "nsIPrefBranch.h"
-#include "nsIViewSourceChannel.h"
 #include "nsContentUtils.h"
 #include "nsProxyRelease.h"
 #include "nsContentSecurityManager.h"
 
-#include "nsIScriptSecurityManager.h"
-#include "nsIPrincipal.h"
 #include "nsIFileURL.h"
 
 #include "mozilla/BasePrincipal.h"
 #include "mozilla/IntegerPrintfMacros.h"
 #include "mozilla/Preferences.h"
-#include "nsIBrowserChild.h"
 #include "private/pprio.h"
 #include "nsInputStreamPump.h"
 #include "nsThreadUtils.h"
 #include "nsJARProtocolHandler.h"
 
 using namespace mozilla;
 using namespace mozilla::net;
 
--- a/modules/libjar/nsJARInputStream.cpp
+++ b/modules/libjar/nsJARInputStream.cpp
@@ -9,17 +9,16 @@
 #include "zipstruct.h"  // defines ZIP compression codes
 #ifdef MOZ_JAR_BROTLI
 #  include "brotli/decode.h"  // brotli
 #endif
 #include "nsZipArchive.h"
 #include "MmapFaultHandler.h"
 
 #include "nsEscape.h"
-#include "nsIFile.h"
 #include "nsDebug.h"
 #include <algorithm>
 #if defined(XP_WIN)
 #  include <windows.h>
 #endif
 
 /*---------------------------------------------
  *  nsISupports implementation
--- a/modules/libjar/nsJARProtocolHandler.cpp
+++ b/modules/libjar/nsJARProtocolHandler.cpp
@@ -1,22 +1,18 @@
 /* -*- Mode: C++; tab-width: 4; 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 "mozilla/ClearOnShutdown.h"
 #include "nsAutoPtr.h"
 #include "nsJARProtocolHandler.h"
-#include "nsIIOService.h"
 #include "nsCRT.h"
-#include "nsIComponentManager.h"
-#include "nsIServiceManager.h"
 #include "nsJARURI.h"
-#include "nsIURL.h"
 #include "nsJARChannel.h"
 #include "nsString.h"
 #include "nsNetCID.h"
 #include "nsIMIMEService.h"
 #include "nsMimeTypes.h"
 #include "nsThreadUtils.h"
 
 static NS_DEFINE_CID(kZipReaderCacheCID, NS_ZIPREADERCACHE_CID);
--- a/modules/libjar/nsJARProtocolHandler.h
+++ b/modules/libjar/nsJARProtocolHandler.h
@@ -3,17 +3,16 @@
  * 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 nsJARProtocolHandler_h__
 #define nsJARProtocolHandler_h__
 
 #include "mozilla/StaticPtr.h"
 #include "nsIProtocolHandler.h"
-#include "nsIJARURI.h"
 #include "nsIZipReader.h"
 #include "nsIMIMEService.h"
 #include "nsWeakReference.h"
 #include "nsCOMPtr.h"
 
 class nsJARProtocolHandler final : public nsIProtocolHandler,
                                    public nsSupportsWeakReference {
  public:
--- a/modules/libjar/nsJARURI.cpp
+++ b/modules/libjar/nsJARURI.cpp
@@ -6,19 +6,16 @@
 
 #include "base/basictypes.h"
 
 #include "nsJARURI.h"
 #include "nsNetUtil.h"
 #include "nsIIOService.h"
 #include "nsIStandardURL.h"
 #include "nsCRT.h"
-#include "nsIComponentManager.h"
-#include "nsIServiceManager.h"
-#include "nsIZipReader.h"
 #include "nsReadableUtils.h"
 #include "nsAutoPtr.h"
 #include "nsNetCID.h"
 #include "nsIObjectInputStream.h"
 #include "nsIObjectOutputStream.h"
 #include "nsQueryObject.h"
 #include "mozilla/ipc/URIUtils.h"
 
--- a/modules/libjar/zipwriter/nsDeflateConverter.cpp
+++ b/modules/libjar/zipwriter/nsDeflateConverter.cpp
@@ -1,17 +1,16 @@
 /* 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 "StreamFunctions.h"
 #include "nsDeflateConverter.h"
 #include "nsStringStream.h"
-#include "nsIInputStreamPump.h"
 #include "nsComponentManagerUtils.h"
 #include "nsMemory.h"
 #include "plstr.h"
 #include "mozilla/UniquePtr.h"
 
 #define ZLIB_TYPE "deflate"
 #define GZIP_TYPE "gzip"
 #define X_GZIP_TYPE "x-gzip"
--- a/modules/libjar/zipwriter/nsDeflateConverter.h
+++ b/modules/libjar/zipwriter/nsDeflateConverter.h
@@ -3,17 +3,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 #ifndef _nsDeflateConverter_h_
 #define _nsDeflateConverter_h_
 
 #include "nsIStreamConverter.h"
 #include "nsCOMPtr.h"
-#include "nsIPipe.h"
 #include "zlib.h"
 #include "mozilla/Attributes.h"
 
 #define DEFLATECONVERTER_CID                         \
   {                                                  \
     0x461cd5dd, 0x73c6, 0x47a4, {                    \
       0x8c, 0xc3, 0x60, 0x3b, 0x37, 0xd8, 0x4a, 0x61 \
     }                                                \
--- a/modules/libjar/zipwriter/nsZipWriter.cpp
+++ b/modules/libjar/zipwriter/nsZipWriter.cpp
@@ -5,20 +5,18 @@
 
 #include "nsZipWriter.h"
 
 #include <algorithm>
 
 #include "StreamFunctions.h"
 #include "nsZipDataStream.h"
 #include "nsISeekableStream.h"
-#include "nsIAsyncStreamCopier.h"
 #include "nsIStreamListener.h"
 #include "nsIInputStreamPump.h"
-#include "nsILoadInfo.h"
 #include "nsComponentManagerUtils.h"
 #include "nsMemory.h"
 #include "nsError.h"
 #include "nsStreamUtils.h"
 #include "nsThreadUtils.h"
 #include "nsNetUtil.h"
 #include "nsIChannel.h"
 #include "nsIFile.h"
--- a/modules/libjar/zipwriter/nsZipWriter.h
+++ b/modules/libjar/zipwriter/nsZipWriter.h
@@ -2,18 +2,16 @@
  * 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 _nsZipWriter_h_
 #define _nsZipWriter_h_
 
 #include "nsIZipWriter.h"
-#include "nsIFileStreams.h"
-#include "nsIBufferedStreams.h"
 #include "nsIRequestObserver.h"
 #include "nsZipHeader.h"
 #include "nsCOMPtr.h"
 #include "nsCOMArray.h"
 #include "nsTArray.h"
 #include "nsDataHashtable.h"
 #include "mozilla/Attributes.h"
 
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
@@ -49,32 +49,28 @@
 #include "nsCategoryManagerUtils.h"
 #include "nsClassHashtable.h"
 #include "nsCOMArray.h"
 #include "nsCOMPtr.h"
 #include "nsCRT.h"
 #include "nsDataHashtable.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsHashKeys.h"
-#include "nsICategoryManager.h"
 #include "nsIConsoleService.h"
-#include "nsIDirectoryService.h"
 #include "nsIFile.h"
-#include "nsIInputStream.h"
 #include "nsIMemoryReporter.h"
 #include "nsIObserver.h"
 #include "nsIObserverService.h"
 #include "nsIOutputStream.h"
 #include "nsIPrefBranch.h"
 #include "nsIPrefLocalizedString.h"
 #include "nsIRelativeFilePref.h"
 #include "nsISafeOutputStream.h"
 #include "nsISimpleEnumerator.h"
 #include "nsIStringBundle.h"
-#include "nsIStringEnumerator.h"
 #include "nsISupportsImpl.h"
 #include "nsISupportsPrimitives.h"
 #include "nsIZipReader.h"
 #include "nsNetUtil.h"
 #include "nsPrintfCString.h"
 #include "nsQuickSort.h"
 #include "nsReadableUtils.h"
 #include "nsRefPtrHashtable.h"
--- a/netwerk/base/BackgroundFileSaver.cpp
+++ b/netwerk/base/BackgroundFileSaver.cpp
@@ -6,16 +6,17 @@
 
 #include "BackgroundFileSaver.h"
 
 #include "ScopedNSSTypes.h"
 #include "mozilla/Casting.h"
 #include "mozilla/Logging.h"
 #include "mozilla/Telemetry.h"
 #include "nsCOMArray.h"
+#include "nsComponentManagerUtils.h"
 #include "nsDependentSubstring.h"
 #include "nsIAsyncInputStream.h"
 #include "nsIFile.h"
 #include "nsIMutableArray.h"
 #include "nsIPipe.h"
 #include "nsNetUtil.h"
 #include "nsThreadUtils.h"
 #include "pk11pub.h"
--- a/netwerk/base/ChannelDiverterChild.cpp
+++ b/netwerk/base/ChannelDiverterChild.cpp
@@ -5,13 +5,12 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/net/ChannelDiverterChild.h"
 #include "mozilla/net/NeckoChannelParams.h"
 #include "mozilla/net/HttpChannelChild.h"
 #include "mozilla/net/FTPChannelChild.h"
 #include "mozilla/net/PHttpChannelChild.h"
 #include "mozilla/net/PFTPChannelChild.h"
-#include "nsIDivertableChannel.h"
 
 namespace mozilla {
 namespace net {}  // namespace net
 }  // namespace mozilla
--- a/netwerk/base/Dashboard.cpp
+++ b/netwerk/base/Dashboard.cpp
@@ -9,17 +9,16 @@
 #include "mozilla/net/HttpInfo.h"
 #include "nsHttp.h"
 #include "nsICancelable.h"
 #include "nsIDNSService.h"
 #include "nsIDNSRecord.h"
 #include "nsIInputStream.h"
 #include "nsINamed.h"
 #include "nsISocketTransport.h"
-#include "nsIThread.h"
 #include "nsProxyRelease.h"
 #include "nsSocketTransportService2.h"
 #include "nsThreadUtils.h"
 #include "nsURLHelper.h"
 #include "mozilla/Logging.h"
 #include "nsIOService.h"
 #include "../cache2/CacheFileUtils.h"
 
--- a/netwerk/base/Dashboard.h
+++ b/netwerk/base/Dashboard.h
@@ -4,20 +4,16 @@
 
 #ifndef nsDashboard_h__
 #define nsDashboard_h__
 
 #include "mozilla/Mutex.h"
 #include "mozilla/net/DashboardTypes.h"
 #include "nsIDashboard.h"
 #include "nsIDashboardEventNotifier.h"
-#include "nsIDNSListener.h"
-#include "nsIServiceManager.h"
-#include "nsITimer.h"
-#include "nsITransport.h"
 
 class nsIDNSService;
 
 namespace mozilla {
 namespace net {
 
 class SocketData;
 class HttpData;
--- a/netwerk/base/IOActivityMonitor.cpp
+++ b/netwerk/base/IOActivityMonitor.cpp
@@ -1,16 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; 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 "IOActivityMonitor.h"
-#include "nsIObserverService.h"
-#include "nsPISocketTransportService.h"
 #include "nsPrintfCString.h"
 #include "nsSocketTransport2.h"
 #include "nsSocketTransportService2.h"
 #include "nsThreadUtils.h"
 #include "mozilla/dom/Promise.h"
 #include "prerror.h"
 #include "prio.h"
 #include "prmem.h"
--- a/netwerk/base/LoadInfo.cpp
+++ b/netwerk/base/LoadInfo.cpp
@@ -20,17 +20,16 @@
 #include "mozilla/StaticPrefs_network.h"
 #include "mozIThirdPartyUtil.h"
 #include "nsFrameLoader.h"
 #include "nsFrameLoaderOwner.h"
 #include "nsIContentSecurityPolicy.h"
 #include "nsIDocShell.h"
 #include "mozilla/dom/Document.h"
 #include "nsCookiePermission.h"
-#include "nsICookieService.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsISupportsImpl.h"
 #include "nsISupportsUtils.h"
 #include "nsIXPConnect.h"
 #include "nsDocShell.h"
 #include "nsGlobalWindow.h"
 #include "nsMixedContentBlocker.h"
 #include "nsQueryObject.h"
--- a/netwerk/base/LoadInfo.h
+++ b/netwerk/base/LoadInfo.h
@@ -3,17 +3,16 @@
 /* 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_LoadInfo_h
 #define mozilla_LoadInfo_h
 
 #include "nsIContentSecurityPolicy.h"
-#include "nsIContentPolicy.h"
 #include "nsILoadInfo.h"
 #include "nsIPrincipal.h"
 #include "nsIWeakReferenceUtils.h"  // for nsWeakPtr
 #include "nsIURI.h"
 #include "nsContentUtils.h"
 #include "nsString.h"
 #include "nsTArray.h"
 
--- a/netwerk/base/NetworkConnectivityService.cpp
+++ b/netwerk/base/NetworkConnectivityService.cpp
@@ -2,17 +2,16 @@
  * 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 "NetworkConnectivityService.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "xpcpublic.h"
 #include "nsSocketTransport2.h"
-#include "nsIURIMutator.h"
 #include "nsINetworkLinkService.h"
 
 static LazyLogModule gNCSLog("NetworkConnectivityService");
 #undef LOG
 #define LOG(args) MOZ_LOG(gNCSLog, mozilla::LogLevel::Debug, args)
 
 namespace mozilla {
 namespace net {
--- a/netwerk/base/Predictor.cpp
+++ b/netwerk/base/Predictor.cpp
@@ -4,34 +4,30 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <algorithm>
 
 #include "Predictor.h"
 
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsICacheStorage.h"
-#include "nsICacheStorageService.h"
 #include "nsICachingChannel.h"
 #include "nsICancelable.h"
 #include "nsIChannel.h"
 #include "nsContentUtils.h"
 #include "nsIDNSService.h"
 #include "mozilla/dom/Document.h"
 #include "nsIFile.h"
 #include "nsIHttpChannel.h"
 #include "nsIInputStream.h"
-#include "nsIIOService.h"
 #include "nsILoadContext.h"
 #include "nsILoadContextInfo.h"
 #include "nsILoadGroup.h"
 #include "nsINetworkPredictorVerifier.h"
 #include "nsIObserverService.h"
-#include "nsIPrefBranch.h"
-#include "nsIPrefService.h"
 #include "nsISpeculativeConnect.h"
 #include "nsITimer.h"
 #include "nsIURI.h"
 #include "nsNetUtil.h"
 #include "nsServiceManagerUtils.h"
 #include "nsStreamUtils.h"
 #include "nsString.h"
 #include "nsThreadUtils.h"
--- a/netwerk/base/SimpleBuffer.h
+++ b/netwerk/base/SimpleBuffer.h
@@ -10,17 +10,16 @@
 /*
   This class is similar to a nsPipe except it does not have any locking, stores
   an unbounded amount of data, can only be used on one thread, and has much
   simpler result code semantics to deal with.
 */
 
 #include "prtypes.h"
 #include "mozilla/LinkedList.h"
-#include "nsIThreadInternal.h"
 
 namespace mozilla {
 namespace net {
 
 class SimpleBufferPage : public LinkedListElement<SimpleBufferPage> {
  public:
   SimpleBufferPage() : mReadOffset(0), mWriteOffset(0) {}
   static const size_t kSimpleBufferPageSize = 32000;
--- a/netwerk/base/TLSServerSocket.cpp
+++ b/netwerk/base/TLSServerSocket.cpp
@@ -5,17 +5,16 @@
 
 #include "TLSServerSocket.h"
 
 #include "mozilla/net/DNS.h"
 #include "nsAutoPtr.h"
 #include "nsComponentManagerUtils.h"
 #include "nsDependentSubstring.h"
 #include "nsIServerSocket.h"
-#include "nsITimer.h"
 #include "nsIX509Cert.h"
 #include "nsIX509CertDB.h"
 #include "nsNetCID.h"
 #include "nsProxyRelease.h"
 #include "nsServiceManagerUtils.h"
 #include "nsSocketTransport2.h"
 #include "nsThreadUtils.h"
 #include "ScopedNSSTypes.h"
--- a/netwerk/base/Tickler.cpp
+++ b/netwerk/base/Tickler.cpp
@@ -3,18 +3,16 @@
  * 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 "Tickler.h"
 
 #ifdef MOZ_USE_WIFI_TICKLER
 #  include "nsComponentManagerUtils.h"
 #  include "nsINamed.h"
-#  include "nsIPrefBranch.h"
-#  include "nsIPrefService.h"
 #  include "nsServiceManagerUtils.h"
 #  include "nsThreadUtils.h"
 #  include "prnetdb.h"
 
 #  include "mozilla/jni/Utils.h"
 #  include "GeneratedJNIWrappers.h"
 
 namespace mozilla {
--- a/netwerk/base/nsAsyncRedirectVerifyHelper.h
+++ b/netwerk/base/nsAsyncRedirectVerifyHelper.h
@@ -2,19 +2,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/. */
 
 #ifndef nsAsyncRedirectVerifyHelper_h
 #define nsAsyncRedirectVerifyHelper_h
 
 #include "nsIRunnable.h"
-#include "nsIThread.h"
 #include "nsIChannelEventSink.h"
-#include "nsIInterfaceRequestor.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "mozilla/Attributes.h"
 
 class nsIChannel;
 
--- a/netwerk/base/nsBaseChannel.cpp
+++ b/netwerk/base/nsBaseChannel.cpp
@@ -7,17 +7,16 @@
 #include "nsBaseChannel.h"
 #include "nsContentUtils.h"
 #include "nsURLHelper.h"
 #include "nsNetCID.h"
 #include "nsMimeTypes.h"
 #include "nsUnknownDecoder.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsMimeTypes.h"
-#include "nsIHttpChannel.h"
 #include "nsIChannelEventSink.h"
 #include "nsIStreamConverterService.h"
 #include "nsChannelClassifier.h"
 #include "nsAsyncRedirectVerifyHelper.h"
 #include "nsProxyRelease.h"
 #include "nsXULAppAPI.h"
 #include "nsContentSecurityManager.h"
 #include "LoadInfo.h"
--- a/netwerk/base/nsDirectoryIndexStream.cpp
+++ b/netwerk/base/nsDirectoryIndexStream.cpp
@@ -12,17 +12,16 @@
   http://www.mozilla.org/projects/netlib/dirindexformat.html
 
  */
 
 #include "nsEscape.h"
 #include "nsDirectoryIndexStream.h"
 #include "mozilla/Logging.h"
 #include "prtime.h"
-#include "nsISimpleEnumerator.h"
 #ifdef THREADSAFE_I18N
 #  include "nsCollationCID.h"
 #  include "nsICollation.h"
 #endif
 #include "nsIFile.h"
 #include "nsURLHelper.h"
 #include "nsNativeCharsetUtils.h"
 
--- a/netwerk/base/nsDownloader.cpp
+++ b/netwerk/base/nsDownloader.cpp
@@ -1,15 +1,14 @@
 /* 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) {
     // release the sink first since it may still hold an open file
--- a/netwerk/base/nsIOService.cpp
+++ b/netwerk/base/nsIOService.cpp
@@ -10,41 +10,37 @@
 #include "nsIProtocolHandler.h"
 #include "nsIFileProtocolHandler.h"
 #include "nscore.h"
 #include "nsIURI.h"
 #include "prprf.h"
 #include "nsErrorService.h"
 #include "netCore.h"
 #include "nsIObserverService.h"
-#include "nsIPrefService.h"
 #include "nsXPCOM.h"
 #include "nsIProxiedProtocolHandler.h"
 #include "nsIProxyInfo.h"
 #include "nsEscape.h"
 #include "nsNetUtil.h"
 #include "nsNetCID.h"
 #include "nsCRT.h"
 #include "nsSimpleNestedURI.h"
 #include "nsTArray.h"
 #include "nsIConsoleService.h"
 #include "nsIUploadChannel2.h"
 #include "nsXULAppAPI.h"
-#include "nsIScriptSecurityManager.h"
 #include "nsIProtocolProxyCallback.h"
 #include "nsICancelable.h"
 #include "nsINetworkLinkService.h"
-#include "nsPISocketTransportService.h"
 #include "nsAsyncRedirectVerifyHelper.h"
 #include "nsURLHelper.h"
 #include "nsIProtocolProxyService2.h"
 #include "MainThreadUtils.h"
 #include "nsINode.h"
 #include "nsIWidget.h"
-#include "nsIHttpChannel.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 "mozilla/ipc/URIUtils.h"
 #include "mozilla/net/NeckoChild.h"
--- a/netwerk/base/nsInputStreamPump.cpp
+++ b/netwerk/base/nsInputStreamPump.cpp
@@ -2,17 +2,16 @@
 /* vim:set ts=4 sts=2 sw=2 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 "nsIOService.h"
 #include "nsInputStreamPump.h"
 #include "nsIStreamTransportService.h"
-#include "nsISeekableStream.h"
 #include "nsITransport.h"
 #include "nsIThreadRetargetableStreamListener.h"
 #include "nsThreadUtils.h"
 #include "nsCOMPtr.h"
 #include "mozilla/Logging.h"
 #include "mozilla/NonBlockingAsyncInputStream.h"
 #include "mozilla/SlicedInputStream.h"
 #include "GeckoProfiler.h"
--- a/netwerk/base/nsLoadGroup.cpp
+++ b/netwerk/base/nsLoadGroup.cpp
@@ -13,17 +13,16 @@
 #include "nsCOMPtr.h"
 #include "mozilla/Logging.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "mozilla/Telemetry.h"
 #include "nsITimedChannel.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIRequestObserver.h"
-#include "nsIRequestContext.h"
 #include "CacheObserver.h"
 #include "MainThreadUtils.h"
 #include "RequestContextService.h"
 #include "mozilla/Unused.h"
 
 namespace mozilla {
 namespace net {
 
--- a/netwerk/base/nsMIMEInputStream.h
+++ b/netwerk/base/nsMIMEInputStream.h
@@ -6,18 +6,16 @@
 /**
  * The MIME stream separates headers and a datastream. It also allows
  * automatic creation of the content-length header.
  */
 
 #ifndef _nsMIMEInputStream_h_
 #define _nsMIMEInputStream_h_
 
-#include "nsIMIMEInputStream.h"
-
 #define NS_MIMEINPUTSTREAM_CONTRACTID "@mozilla.org/network/mime-input-stream;1"
 #define NS_MIMEINPUTSTREAM_CID                       \
   { /* 58a1c31c-1dd2-11b2-a3f6-d36949d48268 */       \
     0x58a1c31c, 0x1dd2, 0x11b2, {                    \
       0xa3, 0xf6, 0xd3, 0x69, 0x49, 0xd4, 0x82, 0x68 \
     }                                                \
   }
 
--- a/netwerk/base/nsNetUtil.cpp
+++ b/netwerk/base/nsNetUtil.cpp
@@ -22,61 +22,52 @@
 #include "mozilla/Telemetry.h"
 #include "nsBufferedStreams.h"
 #include "nsCategoryCache.h"
 #include "nsContentUtils.h"
 #include "nsFileStreams.h"
 #include "nsHashKeys.h"
 #include "nsHttp.h"
 #include "nsMimeTypes.h"
-#include "nsIAsyncStreamCopier.h"
 #include "nsIAuthPrompt.h"
 #include "nsIAuthPrompt2.h"
 #include "nsIAuthPromptAdapterFactory.h"
 #include "nsIBufferedStreams.h"
 #include "nsBufferedStreams.h"
 #include "nsIChannelEventSink.h"
 #include "nsIContentSniffer.h"
 #include "mozilla/dom/Document.h"
-#include "nsICookieService.h"
 #include "nsIDownloader.h"
 #include "nsIFileProtocolHandler.h"
 #include "nsIFileStreams.h"
 #include "nsIFileURL.h"
 #include "nsIIDNService.h"
 #include "nsIInputStreamChannel.h"
 #include "nsIInputStreamPump.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsILoadContext.h"
 #include "nsIMIMEHeaderParam.h"
-#include "nsIMutable.h"
 #include "nsINode.h"
 #include "nsIObjectLoadingContent.h"
 #include "nsIOfflineCacheUpdate.h"
 #include "nsPersistentProperties.h"
 #include "nsIPrivateBrowsingChannel.h"
 #include "nsIPropertyBag2.h"
 #include "nsIProtocolProxyService.h"
 #include "mozilla/net/RedirectChannelRegistrar.h"
 #include "nsRequestObserverProxy.h"
-#include "nsIScriptSecurityManager.h"
 #include "nsISensitiveInfoHiddenURI.h"
 #include "nsISimpleStreamListener.h"
 #include "nsISocketProvider.h"
-#include "nsISocketProviderService.h"
 #include "nsIStandardURL.h"
 #include "nsIStreamLoader.h"
 #include "nsIIncrementalStreamLoader.h"
-#include "nsIStreamTransportService.h"
 #include "nsStringStream.h"
 #include "nsSyncStreamListener.h"
-#include "nsITransport.h"
 #include "nsIURIWithSpecialOrigin.h"
-#include "nsIURLParser.h"
-#include "nsIUUIDGenerator.h"
 #include "nsIViewSourceChannel.h"
 #include "nsInterfaceRequestorAgg.h"
 #include "plstr.h"
 #include "nsINestedURI.h"
 #include "mozilla/dom/nsCSPUtils.h"
 #include "mozilla/dom/nsMixedContentBlocker.h"
 #include "mozilla/dom/BlobURLProtocolHandler.h"
 #include "mozilla/net/HttpBaseChannel.h"
--- a/netwerk/base/nsPACMan.cpp
+++ b/netwerk/base/nsPACMan.cpp
@@ -7,17 +7,16 @@
 #include "nsPACMan.h"
 
 #include "mozilla/Preferences.h"
 #include "nsContentUtils.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "nsIAuthPrompt.h"
 #include "nsIDHCPClient.h"
 #include "nsIHttpChannel.h"
-#include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsIPromptFactory.h"
 #include "nsIProtocolProxyService.h"
 #include "nsISystemProxySettings.h"
 #include "nsNetUtil.h"
 #include "nsThreadUtils.h"
 #include "mozilla/Result.h"
 #include "mozilla/ResultExtensions.h"
--- a/netwerk/base/nsProtocolProxyService.cpp
+++ b/netwerk/base/nsProtocolProxyService.cpp
@@ -14,18 +14,16 @@
 #include "nsIIOService.h"
 #include "nsIObserverService.h"
 #include "nsIProtocolHandler.h"
 #include "nsIProtocolProxyCallback.h"
 #include "nsIChannel.h"
 #include "nsICancelable.h"
 #include "nsIDNSService.h"
 #include "nsPIDNSService.h"
-#include "nsIScriptSecurityManager.h"
-#include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsContentUtils.h"
 #include "nsThreadUtils.h"
 #include "nsQueryObject.h"
 #include "nsSOCKSIOLayer.h"
 #include "nsString.h"
 #include "nsNetUtil.h"
 #include "nsNetCID.h"
--- a/netwerk/base/nsProtocolProxyService.h
+++ b/netwerk/base/nsProtocolProxyService.h
@@ -9,17 +9,16 @@
 #include "nsString.h"
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 #include "nsTArray.h"
 #include "nsIProtocolProxyService2.h"
 #include "nsIProtocolProxyFilter.h"
 #include "nsIProxyInfo.h"
 #include "nsIObserver.h"
-#include "nsIThread.h"
 #include "nsDataHashtable.h"
 #include "nsHashKeys.h"
 #include "prio.h"
 #include "mozilla/Attributes.h"
 
 class nsIPrefBranch;
 class nsISystemProxySettings;
 
--- a/netwerk/base/nsSocketTransportService2.cpp
+++ b/netwerk/base/nsSocketTransportService2.cpp
@@ -8,18 +8,16 @@
 #include "IOActivityMonitor.h"
 #include "mozilla/IntegerPrintfMacros.h"
 #include "mozilla/Preferences.h"
 #include "nsIOService.h"
 #include "nsASocketHandler.h"
 #include "nsError.h"
 #include "prnetdb.h"
 #include "prerror.h"
-#include "nsIPrefService.h"
-#include "nsIPrefBranch.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIObserverService.h"
 #include "mozilla/Atomics.h"
 #include "mozilla/Services.h"
 #include "mozilla/Likely.h"
 #include "mozilla/PublicSSL.h"
 #include "mozilla/ChaosMode.h"
 #include "mozilla/PodOperations.h"
--- a/netwerk/base/nsStandardURL.h
+++ b/netwerk/base/nsStandardURL.h
@@ -6,17 +6,16 @@
 #ifndef nsStandardURL_h__
 #define nsStandardURL_h__
 
 #include "nsString.h"
 #include "nsISerializable.h"
 #include "nsIFileURL.h"
 #include "nsIStandardURL.h"
 #include "mozilla/Encoding.h"
-#include "nsIObserver.h"
 #include "nsCOMPtr.h"
 #include "nsURLHelper.h"
 #include "nsIClassInfo.h"
 #include "nsISizeOf.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/LinkedList.h"
 #include "mozilla/MemoryReporting.h"
 #include "nsISensitiveInfoHiddenURI.h"
--- a/netwerk/base/nsStreamListenerWrapper.h
+++ b/netwerk/base/nsStreamListenerWrapper.h
@@ -2,17 +2,16 @@
  * 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 nsStreamListenerWrapper_h__
 #define nsStreamListenerWrapper_h__
 
 #include "nsCOMPtr.h"
 #include "nsIStreamListener.h"
-#include "nsIRequestObserver.h"
 #include "nsIThreadRetargetableStreamListener.h"
 #include "mozilla/Attributes.h"
 
 namespace mozilla {
 namespace net {
 
 // Wrapper class to make replacement of nsHttpChannel's listener
 // from JavaScript possible. It is workaround for bug 433711 and 682305.
--- a/netwerk/base/nsStreamTransportService.cpp
+++ b/netwerk/base/nsStreamTransportService.cpp
@@ -7,17 +7,16 @@
 #include "nsNetSegmentUtils.h"
 #include "nsTransportUtils.h"
 #include "nsStreamUtils.h"
 #include "nsError.h"
 #include "nsNetCID.h"
 
 #include "nsIAsyncInputStream.h"
 #include "nsIAsyncOutputStream.h"
-#include "nsISeekableStream.h"
 #include "nsIPipe.h"
 #include "nsITransport.h"
 #include "nsIObserverService.h"
 #include "nsThreadPool.h"
 #include "mozilla/Services.h"
 
 namespace mozilla {
 namespace net {
--- a/netwerk/base/nsSyncStreamListener.cpp
+++ b/netwerk/base/nsSyncStreamListener.cpp
@@ -1,15 +1,14 @@
 /* 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 "nsIOService.h"
 #include "nsSyncStreamListener.h"
-#include "nsIPipe.h"
 #include "nsThreadUtils.h"
 #include <algorithm>
 
 using namespace mozilla::net;
 
 nsresult nsSyncStreamListener::Init() {
   return NS_NewPipe(getter_AddRefs(mPipeIn), getter_AddRefs(mPipeOut),
                     mozilla::net::nsIOService::gDefaultSegmentSize,
--- a/netwerk/base/nsUDPSocket.cpp
+++ b/netwerk/base/nsUDPSocket.cpp
@@ -19,17 +19,16 @@
 #include "nsIOService.h"
 #include "prnetdb.h"
 #include "prio.h"
 #include "nsNetAddr.h"
 #include "nsNetSegmentUtils.h"
 #include "IOActivityMonitor.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 "nsWrapperCacheInlines.h"
 
 namespace mozilla {
--- a/netwerk/base/nsURLHelperWin.cpp
+++ b/netwerk/base/nsURLHelperWin.cpp
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=4 sw=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/. */
 
 /* Windows-specific local file uri parsing */
+#include "nsComponentManagerUtils.h"
 #include "nsURLHelper.h"
 #include "nsEscape.h"
 #include "nsIFile.h"
 #include <windows.h>
 #include "mozilla/Utf8.h"
 
 nsresult net_GetURLSpecFromActualFile(nsIFile* aFile, nsACString& result) {
   nsresult rv;
--- a/netwerk/build/nsNetModule.cpp
+++ b/netwerk/build/nsNetModule.cpp
@@ -8,29 +8,25 @@
 
 #define ALLOW_LATE_HTTPLOG_H_INCLUDE 1
 #include "base/basictypes.h"
 
 #include "nsCOMPtr.h"
 #include "nsIClassInfoImpl.h"
 #include "mozilla/Components.h"
 #include "mozilla/ModuleUtils.h"
-#include "nsIComponentManager.h"
-#include "nsIServiceManager.h"
-#include "nsICategoryManager.h"
 #include "nscore.h"
 #include "nsSimpleURI.h"
 #include "nsLoadGroup.h"
 #include "nsMimeTypes.h"
 #include "nsDNSPrefetch.h"
 #include "nsXULAppAPI.h"
 #include "nsCategoryCache.h"
 #include "nsIContentSniffer.h"
 #include "nsStandardURL.h"
-#include "nsIThreadPool.h"
 #include "mozilla/net/BackgroundChannelRegistrar.h"
 #include "mozilla/net/NeckoChild.h"
 #include "RedirectChannelRegistrar.h"
 #include "nsAuthGSSAPI.h"
 
 #include "nsNetCID.h"
 
 #if defined(XP_MACOSX) || defined(XP_WIN) || defined(XP_LINUX)
--- a/netwerk/cache/nsApplicationCacheService.cpp
+++ b/netwerk/cache/nsApplicationCacheService.cpp
@@ -5,17 +5,16 @@
 #include "nsDiskCache.h"
 #include "nsDiskCacheDeviceSQL.h"
 #include "nsCacheService.h"
 #include "nsApplicationCacheService.h"
 #include "nsCRT.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsIObserverService.h"
-#include "nsIPrincipal.h"
 #include "mozilla/LoadContextInfo.h"
 
 using namespace mozilla;
 
 static NS_DEFINE_CID(kCacheServiceCID, NS_CACHESERVICE_CID);
 
 //-----------------------------------------------------------------------------
 // nsApplicationCacheService
--- a/netwerk/cache/nsCacheEntry.cpp
+++ b/netwerk/cache/nsCacheEntry.cpp
@@ -7,17 +7,16 @@
 #include "nsCache.h"
 #include "nspr.h"
 #include "nsCacheEntry.h"
 #include "nsCacheEntryDescriptor.h"
 #include "nsCacheMetaData.h"
 #include "nsCacheRequest.h"
 #include "nsThreadUtils.h"
 #include "nsError.h"
-#include "nsICacheService.h"
 #include "nsCacheService.h"
 #include "nsCacheDevice.h"
 #include "nsHashKeys.h"
 
 using namespace mozilla;
 
 nsCacheEntry::nsCacheEntry(const nsACString& key, bool streamBased,
                            nsCacheStoragePolicy storagePolicy)
--- a/netwerk/cache/nsCacheEntry.h
+++ b/netwerk/cache/nsCacheEntry.h
@@ -4,31 +4,31 @@
  * 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 _nsCacheEntry_h_
 #define _nsCacheEntry_h_
 
 #include "nsICache.h"
 #include "nsICacheEntryDescriptor.h"
-#include "nsIThread.h"
 #include "nsCacheMetaData.h"
 
 #include "nspr.h"
 #include "PLDHashTable.h"
 #include "nsAutoPtr.h"
 #include "nscore.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "nsAString.h"
 
 class nsCacheDevice;
 class nsCacheMetaData;
 class nsCacheRequest;
 class nsCacheEntryDescriptor;
+class nsIEventTarget;
 
 /******************************************************************************
  * nsCacheEntry
  *******************************************************************************/
 class nsCacheEntry : public PRCList {
  public:
   nsCacheEntry(const nsACString& key, bool streamBased,
                nsCacheStoragePolicy storagePolicy);
--- a/netwerk/cache/nsCacheService.cpp
+++ b/netwerk/cache/nsCacheService.cpp
@@ -18,32 +18,28 @@
 #include "nsCacheRequest.h"
 #include "nsCacheEntry.h"
 #include "nsCacheEntryDescriptor.h"
 #include "nsCacheDevice.h"
 #include "nsICacheVisitor.h"
 #include "nsDiskCacheDeviceSQL.h"
 #include "nsCacheUtils.h"
 #include "../cache2/CacheObserver.h"
-#include "nsINamed.h"
 #include "nsIObserverService.h"
-#include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsIFile.h"
 #include "nsIOService.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsThreadUtils.h"
 #include "nsProxyRelease.h"
 #include "nsDeleteDir.h"
 #include "nsNetCID.h"
 #include <math.h>  // for log()
 #include "mozilla/Services.h"
-#include "nsITimer.h"
-#include "mozIStorageService.h"
 #include "mozilla/StaticPrefs_browser.h"
 
 #include "mozilla/net/NeckoCommon.h"
 #include <algorithm>
 
 using namespace mozilla;
 using namespace mozilla::net;
 
--- a/netwerk/cache/nsCacheService.h
+++ b/netwerk/cache/nsCacheService.h
@@ -10,17 +10,16 @@
 #include "nsICacheService.h"
 #include "nsCacheSession.h"
 #include "nsCacheDevice.h"
 #include "nsCacheEntry.h"
 #include "nsThreadUtils.h"
 #include "nsICacheListener.h"
 
 #include "prthread.h"
-#include "nsIObserver.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsRefPtrHashtable.h"
 #include "mozilla/CondVar.h"
 #include "mozilla/Mutex.h"
 #include "mozilla/Telemetry.h"
 
 class nsCacheRequest;
--- a/netwerk/cache/nsDeleteDir.cpp
+++ b/netwerk/cache/nsDeleteDir.cpp
@@ -4,17 +4,16 @@
  * 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 "nsDeleteDir.h"
 #include "nsIFile.h"
 #include "nsString.h"
 #include "mozilla/Telemetry.h"
 #include "nsITimer.h"
-#include "nsISimpleEnumerator.h"
 #include "nsAutoPtr.h"
 #include "nsThreadUtils.h"
 #include "nsISupportsPriority.h"
 #include "nsCacheUtils.h"
 #include "prtime.h"
 #include <time.h>
 
 using namespace mozilla;
--- a/netwerk/cache/nsDiskCacheDeviceSQL.cpp
+++ b/netwerk/cache/nsDiskCacheDeviceSQL.cpp
@@ -19,17 +19,16 @@
 #include "../cache2/CacheHashUtils.h"
 
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsIURI.h"
 #include "nsAutoPtr.h"
 #include "nsEscape.h"
 #include "nsIPrefBranch.h"
-#include "nsIPrefService.h"
 #include "nsString.h"
 #include "nsPrintfCString.h"
 #include "nsCRT.h"
 #include "nsArrayUtils.h"
 #include "nsIArray.h"
 #include "nsIVariant.h"
 #include "nsILoadContextInfo.h"
 #include "nsThreadUtils.h"
--- a/netwerk/cache/nsDiskCacheDeviceSQL.h
+++ b/netwerk/cache/nsDiskCacheDeviceSQL.h
@@ -3,18 +3,16 @@
  * 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 nsOfflineCacheDevice_h__
 #define nsOfflineCacheDevice_h__
 
 #include "nsCacheDevice.h"
 #include "nsIApplicationCache.h"
-#include "nsIApplicationCacheService.h"
-#include "nsIObserver.h"
 #include "mozIStorageConnection.h"
 #include "mozIStorageFunction.h"
 #include "nsIFile.h"
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsCOMArray.h"
 #include "nsInterfaceHashtable.h"
 #include "nsClassHashtable.h"
--- a/netwerk/cache2/CacheEntry.cpp
+++ b/netwerk/cache2/CacheEntry.cpp
@@ -11,17 +11,16 @@
 
 #include "nsIInputStream.h"
 #include "nsIOutputStream.h"
 #include "nsISeekableStream.h"
 #include "nsIURI.h"
 #include "nsICacheEntryOpenCallback.h"
 #include "nsICacheStorage.h"
 #include "nsISerializable.h"
-#include "nsIStreamTransportService.h"
 #include "nsISizeOf.h"
 
 #include "nsComponentManagerUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsString.h"
 #include "nsProxyRelease.h"
 #include "nsSerializationHelper.h"
 #include "nsThreadUtils.h"
--- a/netwerk/cache2/CacheFileContextEvictor.cpp
+++ b/netwerk/cache2/CacheFileContextEvictor.cpp
@@ -7,17 +7,16 @@
 #include "CacheFileIOManager.h"
 #include "CacheIndex.h"
 #include "CacheIndexIterator.h"
 #include "CacheFileUtils.h"
 #include "nsIFile.h"
 #include "LoadContextInfo.h"
 #include "nsThreadUtils.h"
 #include "nsString.h"
-#include "nsISimpleEnumerator.h"
 #include "nsIDirectoryEnumerator.h"
 #include "mozilla/Base64.h"
 #include "mozilla/IntegerPrintfMacros.h"
 #include "mozilla/net/MozURL.h"
 
 namespace mozilla {
 namespace net {
 
--- a/netwerk/cache2/CacheFileIOManager.cpp
+++ b/netwerk/cache2/CacheFileIOManager.cpp
@@ -11,20 +11,18 @@
 #include "CacheIndex.h"
 #include "CacheFileUtils.h"
 #include "nsThreadUtils.h"
 #include "CacheFile.h"
 #include "CacheObserver.h"
 #include "nsIFile.h"
 #include "CacheFileContextEvictor.h"
 #include "nsITimer.h"
-#include "nsISimpleEnumerator.h"
 #include "nsIDirectoryEnumerator.h"
 #include "nsIObserverService.h"
-#include "nsICacheStorageVisitor.h"
 #include "nsISizeOf.h"
 #include "mozilla/net/MozURL.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Services.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "private/pprio.h"
--- a/netwerk/cache2/CacheIndex.cpp
+++ b/netwerk/cache2/CacheIndex.cpp
@@ -5,18 +5,16 @@
 #include "CacheIndex.h"
 
 #include "CacheLog.h"
 #include "CacheFileIOManager.h"
 #include "CacheFileMetadata.h"
 #include "CacheIndexIterator.h"
 #include "CacheIndexContextIterator.h"
 #include "nsThreadUtils.h"
-#include "nsISimpleEnumerator.h"
-#include "nsIDirectoryEnumerator.h"
 #include "nsISizeOf.h"
 #include "nsPrintfCString.h"
 #include "mozilla/DebugOnly.h"
 #include "prinrval.h"
 #include "nsIFile.h"
 #include "nsITimer.h"
 #include "mozilla/AutoRestore.h"
 #include <algorithm>
--- a/netwerk/cache2/CacheStorage.h
+++ b/netwerk/cache2/CacheStorage.h
@@ -9,17 +9,16 @@
 #include "CacheEntry.h"
 #include "LoadContextInfo.h"
 
 #include "nsRefPtrHashtable.h"
 #include "nsThreadUtils.h"
 #include "nsCOMPtr.h"
 #include "nsILoadContextInfo.h"
 #include "nsIApplicationCache.h"
-#include "nsICacheEntryDoomCallback.h"
 
 class nsIURI;
 class nsIApplicationCache;
 
 namespace mozilla {
 namespace net {
 
 // This dance is needed to make CacheEntryTable declarable-only in headers
--- a/netwerk/cookie/CookieServiceChild.cpp
+++ b/netwerk/cookie/CookieServiceChild.cpp
@@ -21,17 +21,16 @@
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsIChannel.h"
 #include "nsIClassifiedChannel.h"
 #include "nsIHttpChannel.h"
 #include "nsCookiePermission.h"
 #include "nsIEffectiveTLDService.h"
 #include "nsIURI.h"
-#include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsServiceManagerUtils.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/TimeStamp.h"
 #include "ThirdPartyUtil.h"
 
 using namespace mozilla::ipc;
 using mozilla::OriginAttributes;
--- a/netwerk/cookie/CookieServiceParent.cpp
+++ b/netwerk/cookie/CookieServiceParent.cpp
@@ -8,19 +8,16 @@
 #include "mozilla/net/NeckoParent.h"
 
 #include "mozilla/BasePrincipal.h"
 #include "mozilla/ipc/URIUtils.h"
 #include "mozilla/StoragePrincipalHelper.h"
 #include "nsArrayUtils.h"
 #include "nsCookieService.h"
 #include "nsIChannel.h"
-#include "nsIEffectiveTLDService.h"
-#include "nsIScriptSecurityManager.h"
-#include "nsIPrivateBrowsingChannel.h"
 #include "nsNetCID.h"
 #include "nsPrintfCString.h"
 
 using namespace mozilla::ipc;
 using mozilla::BasePrincipal;
 using mozilla::OriginAttributes;
 using mozilla::dom::PContentParent;
 using mozilla::net::NeckoParent;
--- a/netwerk/cookie/nsCookie.h
+++ b/netwerk/cookie/nsCookie.h
@@ -8,16 +8,17 @@
 
 #include "nsICookie.h"
 #include "nsIMemoryReporter.h"
 #include "nsString.h"
 
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/BasePrincipal.h"
 #include "mozilla/net/NeckoChannelParams.h"
+#include "nsIMemoryReporter.h"
 
 using mozilla::OriginAttributes;
 
 /**
  * The nsCookie class is the main cookie storage medium for use within cookie
  * code.
  */
 
--- a/netwerk/cookie/nsCookiePermission.cpp
+++ b/netwerk/cookie/nsCookiePermission.cpp
@@ -2,29 +2,23 @@
 /* vim: set ts=2 sw=2 et: */
 /* 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 "nsCookiePermission.h"
 
 #include "nsICookie.h"
-#include "nsIServiceManager.h"
-#include "nsICookieManager.h"
 #include "nsICookieService.h"
 #include "nsNetUtil.h"
 #include "nsIInterfaceRequestorUtils.h"
-#include "nsIProtocolHandler.h"
 #include "nsIURI.h"
 #include "nsIChannel.h"
-#include "nsIHttpChannelInternal.h"
-#include "nsIPrincipal.h"
 #include "nsString.h"
 #include "nsCRT.h"
-#include "nsILoadContext.h"
 #include "nsIScriptObjectPrincipal.h"
 #include "nsNetCID.h"
 #include "prtime.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "nsContentUtils.h"
 
 /****************************************************************
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -15,37 +15,32 @@
 
 #include "mozilla/net/CookieSettings.h"
 #include "mozilla/net/CookieServiceChild.h"
 #include "mozilla/net/NeckoCommon.h"
 
 #include "nsCookieService.h"
 #include "nsContentUtils.h"
 #include "nsIClassifiedChannel.h"
-#include "nsIServiceManager.h"
-#include "nsIScriptSecurityManager.h"
 #include "nsIWebProgressListener.h"
 #include "nsIHttpChannel.h"
 
-#include "nsIIOService.h"
-#include "nsIPermissionManager.h"
-#include "nsIProtocolHandler.h"
-#include "nsIPrefBranch.h"
-#include "nsIPrefService.h"
-#include "nsIScriptError.h"
 #include "nsCookiePermission.h"
 #include "nsIURI.h"
 #include "nsIURL.h"
 #include "nsIChannel.h"
 #include "nsIFile.h"
 #include "nsIObserverService.h"
 #include "nsILineInputStream.h"
 #include "nsIEffectiveTLDService.h"
 #include "nsIIDNService.h"
-#include "nsIThread.h"
+#include "mozIStorageBindingParamsArray.h"
+#include "mozIStorageError.h"
+#include "mozIStorageFunction.h"
+#include "mozIStorageService.h"
 #include "mozIThirdPartyUtil.h"
 
 #include "nsTArray.h"
 #include "nsCOMArray.h"
 #include "nsIMutableArray.h"
 #include "nsAutoPtr.h"
 #include "nsReadableUtils.h"
 #include "nsCRT.h"
--- a/netwerk/cookie/nsCookieService.h
+++ b/netwerk/cookie/nsCookieService.h
@@ -16,23 +16,19 @@
 #include "nsCookieKey.h"
 #include "nsString.h"
 #include "nsAutoPtr.h"
 #include "nsHashKeys.h"
 #include "nsIMemoryReporter.h"
 #include "nsTHashtable.h"
 #include "mozIStorageStatement.h"
 #include "mozIStorageAsyncStatement.h"
-#include "mozIStoragePendingStatement.h"
 #include "mozIStorageConnection.h"
-#include "mozIStorageRow.h"
 #include "mozIStorageCompletionCallback.h"
 #include "mozIStorageStatementCallback.h"
-#include "mozIStorageFunction.h"
-#include "nsIVariant.h"
 #include "nsIFile.h"
 #include "mozilla/Atomics.h"
 #include "mozilla/BasePrincipal.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/Monitor.h"
 #include "mozilla/UniquePtr.h"
 
--- a/netwerk/dns/ChildDNSService.cpp
+++ b/netwerk/dns/ChildDNSService.cpp
@@ -1,19 +1,16 @@
 /* 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/ChildDNSService.h"
 #include "nsIDNSListener.h"
-#include "nsIIOService.h"
-#include "nsIThread.h"
 #include "nsThreadUtils.h"
 #include "nsIXPConnect.h"
-#include "nsIPrefService.h"
 #include "nsIProtocolProxyService.h"
 #include "nsNetCID.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/SystemGroup.h"
 #include "mozilla/net/NeckoChild.h"
 #include "mozilla/net/DNSListenerProxy.h"
 #include "nsServiceManagerUtils.h"
--- a/netwerk/dns/DNSListenerProxy.cpp
+++ b/netwerk/dns/DNSListenerProxy.cpp
@@ -1,17 +1,16 @@
 /* -*- 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/DNSListenerProxy.h"
 #include "nsICancelable.h"
-#include "nsIEventTarget.h"
 
 namespace mozilla {
 namespace net {
 
 NS_IMPL_ISUPPORTS(DNSListenerProxy, nsIDNSListener, nsIDNSListenerProxy)
 
 NS_IMETHODIMP
 DNSListenerProxy::OnLookupComplete(nsICancelable* aRequest,
--- a/netwerk/dns/DNSRequestChild.cpp
+++ b/netwerk/dns/DNSRequestChild.cpp
@@ -11,17 +11,16 @@
 #include "mozilla/net/SocketProcessChild.h"
 #include "mozilla/SystemGroup.h"
 #include "mozilla/Unused.h"
 #include "nsIDNSRecord.h"
 #include "nsIDNSByTypeRecord.h"
 #include "nsHostResolver.h"
 #include "nsTArray.h"
 #include "nsNetAddr.h"
-#include "nsIThread.h"
 #include "nsThreadUtils.h"
 
 using namespace mozilla::ipc;
 
 namespace mozilla {
 namespace net {
 
 //-----------------------------------------------------------------------------
--- a/netwerk/dns/DNSRequestParent.cpp
+++ b/netwerk/dns/DNSRequestParent.cpp
@@ -3,17 +3,16 @@
 /* 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/DNSRequestParent.h"
 #include "nsIDNSService.h"
 #include "nsNetCID.h"
 #include "nsThreadUtils.h"
-#include "nsIServiceManager.h"
 #include "nsICancelable.h"
 #include "nsIDNSRecord.h"
 #include "nsHostResolver.h"
 #include "mozilla/Unused.h"
 
 using namespace mozilla::ipc;
 
 namespace mozilla {
--- a/netwerk/dns/DNSRequestParent.h
+++ b/netwerk/dns/DNSRequestParent.h
@@ -3,17 +3,16 @@
 /* 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_DNSRequestParent_h
 #define mozilla_net_DNSRequestParent_h
 
 #include "mozilla/net/PDNSRequestParent.h"
-#include "nsIDNSService.h"
 #include "nsIDNSListener.h"
 
 namespace mozilla {
 namespace net {
 
 class DNSRequestParent : public PDNSRequestParent, public nsIDNSListener {
  public:
   NS_DECL_ISUPPORTS
--- a/netwerk/dns/TRRService.cpp
+++ b/netwerk/dns/TRRService.cpp
@@ -2,17 +2,16 @@
 /* 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 "nsICaptivePortalService.h"
 #include "nsIParentalControlsService.h"
 #include "nsINetworkLinkService.h"
 #include "nsIObserverService.h"
-#include "nsIURIMutator.h"
 #include "nsNetUtil.h"
 #include "nsStandardURL.h"
 #include "TRR.h"
 #include "TRRService.h"
 
 #include "mozilla/Preferences.h"
 #include "mozilla/StaticPrefs_network.h"
 #include "mozilla/Tokenizer.h"
--- a/netwerk/dns/mdns/libmdns/MDNSResponderReply.h
+++ b/netwerk/dns/mdns/libmdns/MDNSResponderReply.h
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_netwerk_dns_mdns_libmdns_MDNSResponderReply_h
 #define mozilla_netwerk_dns_mdns_libmdns_MDNSResponderReply_h
 
 #include "dns_sd.h"
 #include "MDNSResponderOperator.h"
 #include "mozilla/UniquePtr.h"
-#include "nsIThread.h"
 #include "mozilla/net/DNS.h"
 #include "mozilla/RefPtr.h"
 #include "nsThreadUtils.h"
 
 namespace mozilla {
 namespace net {
 
 class BrowseReplyRunnable final : public Runnable {
--- a/netwerk/dns/nsDNSService2.cpp
+++ b/netwerk/dns/nsDNSService2.cpp
@@ -4,19 +4,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/. */
 
 #include "nsDNSService2.h"
 #include "nsIDNSRecord.h"
 #include "nsIDNSListener.h"
 #include "nsIDNSByTypeRecord.h"
 #include "nsICancelable.h"
-#include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
-#include "nsIServiceManager.h"
 #include "nsIXPConnect.h"
 #include "nsProxyRelease.h"
 #include "nsReadableUtils.h"
 #include "nsString.h"
 #include "nsAutoPtr.h"
 #include "nsNetCID.h"
 #include "nsError.h"
 #include "nsDNSPrefetch.h"
--- a/netwerk/dns/nsIDNService.cpp
+++ b/netwerk/dns/nsIDNService.cpp
@@ -6,19 +6,16 @@
 #include "mozilla/Preferences.h"
 #include "nsIDNService.h"
 #include "nsReadableUtils.h"
 #include "nsCRT.h"
 #include "nsUnicharUtils.h"
 #include "nsUnicodeProperties.h"
 #include "nsUnicodeScriptCodes.h"
 #include "harfbuzz/hb.h"
-#include "nsIServiceManager.h"
-#include "nsIObserverService.h"
-#include "nsISupportsPrimitives.h"
 #include "punycode.h"
 #include "mozilla/TextUtils.h"
 #include "mozilla/Utf8.h"
 
 // Currently we use the non-transitional processing option -- see
 // http://unicode.org/reports/tr46/
 // To switch to transitional processing, change the value of this flag
 // and kTransitionalProcessing in netwerk/test/unit/test_idna2008.js to true
--- a/netwerk/dns/nsIDNService.h
+++ b/netwerk/dns/nsIDNService.h
@@ -3,17 +3,16 @@
  * 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 nsIDNService_h__
 #define nsIDNService_h__
 
 #include "nsIIDNService.h"
 #include "nsCOMPtr.h"
-#include "nsIObserver.h"
 #include "nsUnicodeScriptCodes.h"
 #include "nsWeakReference.h"
 
 #include "unicode/uidna.h"
 #include "mozilla/net/IDNBlocklistUtils.h"
 
 #include "nsString.h"
 
--- a/netwerk/ipc/DocumentLoadListener.cpp
+++ b/netwerk/ipc/DocumentLoadListener.cpp
@@ -15,17 +15,16 @@
 #include "mozilla/dom/ContentProcessManager.h"
 #include "mozilla/dom/ipc/IdType.h"
 #include "mozilla/dom/ServiceWorkerManager.h"
 #include "mozilla/net/HttpChannelParent.h"
 #include "mozilla/net/RedirectChannelRegistrar.h"
 #include "nsDocShell.h"
 #include "nsDocShellLoadState.h"
 #include "nsHttpChannel.h"
-#include "nsIHttpProtocolHandler.h"
 #include "nsISecureBrowserUI.h"
 #include "nsRedirectHistoryEntry.h"
 #include "nsSerializationHelper.h"
 #include "nsIPrompt.h"
 #include "nsIWindowWatcher.h"
 
 mozilla::LazyLogModule gDocumentChannelLog("DocumentChannel");
 #define LOG(fmt) MOZ_LOG(gDocumentChannelLog, mozilla::LogLevel::Verbose, fmt)
--- a/netwerk/ipc/NeckoMessageUtils.h
+++ b/netwerk/ipc/NeckoMessageUtils.h
@@ -10,17 +10,16 @@
 
 #include "ipc/IPCMessageUtils.h"
 #include "nsExceptionHandler.h"
 #include "nsIHttpChannel.h"
 #include "nsPrintfCString.h"
 #include "nsString.h"
 #include "prio.h"
 #include "mozilla/net/DNS.h"
-#include "nsILoadInfo.h"
 
 namespace IPC {
 
 // nsIPermissionManager utilities
 
 struct Permission {
   nsCString origin, type;
   uint32_t capability, expireType;
--- a/netwerk/ipc/NeckoTargetHolder.cpp
+++ b/netwerk/ipc/NeckoTargetHolder.cpp
@@ -3,17 +3,16 @@
 
 /* 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 "NeckoTargetHolder.h"
 
 #include "nsContentUtils.h"
-#include "nsILoadInfo.h"
 
 namespace mozilla {
 namespace net {
 
 already_AddRefed<nsIEventTarget> NeckoTargetHolder::GetNeckoTarget() {
   nsCOMPtr<nsIEventTarget> target = mNeckoTarget;
 
   if (!target) {
--- a/netwerk/ipc/SocketProcessChild.cpp
+++ b/netwerk/ipc/SocketProcessChild.cpp
@@ -15,16 +15,17 @@
 #include "mozilla/ipc/FileDescriptorSetChild.h"
 #include "mozilla/ipc/IPCStreamAlloc.h"
 #include "mozilla/ipc/ProcessChild.h"
 #include "mozilla/net/DNSRequestChild.h"
 #include "mozilla/ipc/PChildToParentStreamChild.h"
 #include "mozilla/ipc/PParentToChildStreamChild.h"
 #include "mozilla/Preferences.h"
 #include "nsDebugImpl.h"
+#include "nsIDNSService.h"
 #include "nsThreadManager.h"
 #include "ProcessUtils.h"
 #include "SocketProcessBridgeParent.h"
 
 #ifdef MOZ_GECKO_PROFILER
 #  include "ChildProfilerController.h"
 #endif
 
--- a/netwerk/mime/nsMIMEHeaderParamImpl.cpp
+++ b/netwerk/mime/nsMIMEHeaderParamImpl.cpp
@@ -9,17 +9,16 @@
 #include "plstr.h"
 #include "prmem.h"
 #include "plbase64.h"
 #include "nsCRT.h"
 #include "nsMemory.h"
 #include "nsTArray.h"
 #include "nsCOMPtr.h"
 #include "nsEscape.h"
-#include "nsIServiceManager.h"
 #include "nsMIMEHeaderParamImpl.h"
 #include "nsReadableUtils.h"
 #include "nsNativeCharsetUtils.h"
 #include "nsError.h"
 #include "mozilla/Encoding.h"
 #include "mozilla/TextUtils.h"
 #include "mozilla/Utf8.h"
 
--- a/netwerk/protocol/about/nsAboutCache.cpp
+++ b/netwerk/protocol/about/nsAboutCache.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; 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 "nsAboutCache.h"
 #include "nsIInputStream.h"
-#include "nsIStorageStream.h"
 #include "nsIURI.h"
 #include "nsCOMPtr.h"
 #include "nsNetUtil.h"
 #include "nsIPipe.h"
 #include "nsContentUtils.h"
 #include "nsEscape.h"
 #include "nsAboutProtocolUtils.h"
 #include "nsPrintfCString.h"
--- a/netwerk/protocol/about/nsAboutCacheEntry.cpp
+++ b/netwerk/protocol/about/nsAboutCacheEntry.cpp
@@ -14,17 +14,16 @@
 #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) {
   char temp[16];
--- a/netwerk/protocol/data/nsDataModule.cpp
+++ b/netwerk/protocol/data/nsDataModule.cpp
@@ -1,14 +1,13 @@
 /* -*- Mode: C++; tab-width: 4; 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 "nsIModule.h"
 #include "nsIGenericFactory.h"
 #include "nsDataHandler.h"
 
 // The list of components we register
 static const nsModuleComponentInfo components[] = {
     {"Data Protocol Handler", NS_DATAHANDLER_CID,
      NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "data", nsDataHandler::Create},
 };
--- a/netwerk/protocol/ftp/FTPChannelParent.cpp
+++ b/netwerk/protocol/ftp/FTPChannelParent.cpp
@@ -11,25 +11,23 @@
 #include "mozilla/dom/BrowserParent.h"
 #include "nsFTPChannel.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsQueryObject.h"
 #include "nsFtpProtocolHandler.h"
 #include "nsIAuthPrompt.h"
 #include "nsIAuthPromptProvider.h"
-#include "nsIEncodedChannel.h"
 #include "nsIHttpChannelInternal.h"
 #include "nsISecureBrowserUI.h"
 #include "nsIForcePendingChannel.h"
 #include "mozilla/ipc/IPCStreamUtils.h"
 #include "mozilla/ipc/URIUtils.h"
 #include "mozilla/Unused.h"
 #include "SerializedLoadContext.h"
-#include "nsIContentPolicy.h"
 #include "mozilla/ipc/BackgroundUtils.h"
 #include "mozilla/LoadInfo.h"
 #include "mozilla/dom/ContentParent.h"
 
 using namespace mozilla::dom;
 using namespace mozilla::ipc;
 
 #undef LOG
--- a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
+++ b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
@@ -23,30 +23,25 @@
 #include "nsMimeTypes.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsIAsyncStreamCopier.h"
 #include "nsThreadUtils.h"
 #include "nsStreamUtils.h"
 #include "nsIURL.h"
 #include "nsISocketTransport.h"
-#include "nsIStreamListenerTee.h"
-#include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsAuthInformationHolder.h"
 #include "nsIProtocolProxyService.h"
 #include "nsICancelable.h"
 #include "nsIOutputStream.h"
-#include "nsIPrompt.h"
 #include "nsIProtocolHandler.h"
 #include "nsIProxyInfo.h"
-#include "nsIRunnable.h"
 #include "nsISocketTransportService.h"
 #include "nsIURI.h"
-#include "nsIURIMutator.h"
 #include "nsILoadInfo.h"
 #include "nsIAuthPrompt2.h"
 #include "nsIFTPChannelParentInternal.h"
 #include "mozilla/Telemetry.h"
 
 using namespace mozilla;
 using namespace mozilla::net;
 
--- a/netwerk/protocol/ftp/nsFtpControlConnection.cpp
+++ b/netwerk/protocol/ftp/nsFtpControlConnection.cpp
@@ -6,17 +6,16 @@
 #include "nsIOService.h"
 #include "nsFtpControlConnection.h"
 #include "nsFtpProtocolHandler.h"
 #include "mozilla/Logging.h"
 #include "nsIInputStream.h"
 #include "nsISocketTransportService.h"
 #include "nsISocketTransport.h"
 #include "nsThreadUtils.h"
-#include "nsIOutputStream.h"
 #include "nsNetCID.h"
 #include "nsTArray.h"
 #include <algorithm>
 
 using namespace mozilla;
 using namespace mozilla::net;
 
 extern LazyLogModule gFTPLog;
--- a/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp
+++ b/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp
@@ -5,19 +5,17 @@
 
 #include "mozilla/net/NeckoChild.h"
 #include "mozilla/net/FTPChannelChild.h"
 using namespace mozilla;
 using namespace mozilla::net;
 
 #include "nsFtpProtocolHandler.h"
 #include "nsFTPChannel.h"
-#include "nsIStandardURL.h"
 #include "mozilla/Logging.h"
-#include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsIObserverService.h"
 #include "nsEscape.h"
 #include "nsAlgorithm.h"
 
 //-----------------------------------------------------------------------------
 
 //
--- a/netwerk/protocol/gio/nsGIOProtocolHandler.cpp
+++ b/netwerk/protocol/gio/nsGIOProtocolHandler.cpp
@@ -6,29 +6,26 @@
 /*
  * This code is based on original Mozilla gnome-vfs extension. It implements
  * input stream provided by GVFS/GIO.
  */
 #include "nsGIOProtocolHandler.h"
 #include "mozilla/Components.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/NullPrincipal.h"
-#include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsIObserver.h"
 #include "nsThreadUtils.h"
 #include "nsProxyRelease.h"
 #include "nsIStringBundle.h"
-#include "nsIStandardURL.h"
 #include "nsMimeTypes.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIURI.h"
-#include "nsIURIMutator.h"
 #include "nsIAuthPrompt.h"
 #include "nsIChannel.h"
 #include "nsIInputStream.h"
 #include "nsIProtocolHandler.h"
 #include "mozilla/Monitor.h"
 #include "plstr.h"
 #include "prtime.h"
 #include <gio/gio.h>
--- a/netwerk/protocol/http/BackgroundChannelRegistrar.cpp
+++ b/netwerk/protocol/http/BackgroundChannelRegistrar.cpp
@@ -3,17 +3,16 @@
 /* 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 "BackgroundChannelRegistrar.h"
 
 #include "HttpBackgroundChannelParent.h"
 #include "HttpChannelParent.h"
-#include "nsIInterfaceRequestor.h"
 #include "nsXULAppAPI.h"
 #include "mozilla/StaticPtr.h"
 
 namespace {
 mozilla::StaticRefPtr<mozilla::net::BackgroundChannelRegistrar> gSingleton;
 }
 
 namespace mozilla {
--- a/netwerk/protocol/http/ClassifierDummyChannel.h
+++ b/netwerk/protocol/http/ClassifierDummyChannel.h
@@ -4,16 +4,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/. */
 
 #ifndef mozilla_net_ClassifierDummyChannel_h
 #define mozilla_net_ClassifierDummyChannel_h
 
 #include "nsIChannel.h"
+#include "nsIHttpChannelInternal.h"
 #include <functional>
 
 #define CLASSIFIER_DUMMY_CHANNEL_IID                 \
   {                                                  \
     0x70ceb97d, 0xbfa6, 0x4255, {                    \
       0xb7, 0x08, 0xe1, 0xb4, 0x4a, 0x1e, 0x0e, 0x9a \
     }                                                \
   }
--- a/netwerk/protocol/http/ClassifierDummyChannelChild.cpp
+++ b/netwerk/protocol/http/ClassifierDummyChannelChild.cpp
@@ -2,17 +2,16 @@
 /* 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 "ClassifierDummyChannelChild.h"
 #include "mozilla/ipc/BackgroundUtils.h"
 #include "mozilla/ipc/URIUtils.h"
-#include "nsIChannel.h"
 #include "nsIURI.h"
 
 namespace mozilla {
 namespace net {
 
 /* static */
 bool ClassifierDummyChannelChild::Create(
     nsIHttpChannel* aChannel, nsIURI* aURI,
--- a/netwerk/protocol/http/ClassifierDummyChannelParent.cpp
+++ b/netwerk/protocol/http/ClassifierDummyChannelParent.cpp
@@ -2,17 +2,16 @@
 /* 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 "ClassifierDummyChannelParent.h"
 #include "mozilla/net/AsyncUrlChannelClassifier.h"
 #include "mozilla/Unused.h"
-#include "nsIChannel.h"
 #include "nsIPrincipal.h"
 #include "nsNetUtil.h"
 
 namespace mozilla {
 namespace net {
 
 ClassifierDummyChannelParent::ClassifierDummyChannelParent()
     : mIPCActive(true) {}
--- a/netwerk/protocol/http/Http2Compression.h
+++ b/netwerk/protocol/http/Http2Compression.h
@@ -7,17 +7,16 @@
 #define mozilla_net_Http2Compression_Internal_h
 
 // HPACK - RFC 7541
 // https://www.rfc-editor.org/rfc/rfc7541.txt
 
 #include "mozilla/Attributes.h"
 #include "nsDeque.h"
 #include "nsString.h"
-#include "nsIMemoryReporter.h"
 #include "mozilla/Telemetry.h"
 
 namespace mozilla {
 namespace net {
 
 struct HuffmanIncomingTable;
 
 void Http2CompressionCleanup();
--- a/netwerk/protocol/http/Http2Push.h
+++ b/netwerk/protocol/http/Http2Push.h
@@ -11,17 +11,16 @@
 
 #include "Http2Session.h"
 #include "Http2Stream.h"
 
 #include "mozilla/Attributes.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/UniquePtr.h"
 #include "nsHttpRequestHead.h"
-#include "nsILoadGroup.h"
 #include "nsIRequestContext.h"
 #include "nsString.h"
 #include "PSpdyPush.h"
 
 namespace mozilla {
 namespace net {
 
 class Http2PushTransactionBuffer;
--- a/netwerk/protocol/http/Http2Stream.cpp
+++ b/netwerk/protocol/http/Http2Stream.cpp
@@ -23,18 +23,16 @@
 
 #include "mozilla/BasePrincipal.h"
 #include "mozilla/Telemetry.h"
 #include "nsAlgorithm.h"
 #include "nsHttp.h"
 #include "nsHttpHandler.h"
 #include "nsHttpRequestHead.h"
 #include "nsIClassOfService.h"
-#include "nsIPipe.h"
-#include "nsISocketTransport.h"
 #include "nsStandardURL.h"
 #include "prnetdb.h"
 
 namespace mozilla {
 namespace net {
 
 Http2Stream::Http2Stream(nsAHttpTransaction* httpTransaction,
                          Http2Session* session, int32_t priority,
--- a/netwerk/protocol/http/HttpAuthUtils.cpp
+++ b/netwerk/protocol/http/HttpAuthUtils.cpp
@@ -1,15 +1,14 @@
 /* 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/HttpAuthUtils.h"
 #include "mozilla/Tokenizer.h"
-#include "nsIPrefService.h"
 #include "nsIURI.h"
 #include "nsNetUtil.h"
 #include "nsUnicharUtils.h"
 
 namespace mozilla {
 namespace net {
 namespace auth {
 
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -22,26 +22,26 @@
 #include "nsIPrincipal.h"
 #include "nsIScriptError.h"
 #include "nsISeekableStream.h"
 #include "nsIStorageStream.h"
 #include "nsITimedChannel.h"
 #include "nsIEncodedChannel.h"
 #include "nsIApplicationCacheChannel.h"
 #include "nsIMutableArray.h"
-#include "nsIURIMutator.h"
 #include "nsEscape.h"
 #include "nsStreamListenerWrapper.h"
 #include "nsISecurityConsoleMessage.h"
 #include "nsURLHelper.h"
 #include "nsICookieService.h"
 #include "nsIStreamConverterService.h"
 #include "nsCRT.h"
 #include "nsContentUtils.h"
 #include "nsIMutableArray.h"
+#include "nsIURIMutator.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIObserverService.h"
 #include "nsIProtocolProxyService.h"
 #include "nsProxyRelease.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDocShell.h"
 #include "nsINetworkInterceptController.h"
 #include "mozilla/AntiTrackingCommon.h"
@@ -55,35 +55,31 @@
 #include "nsThreadUtils.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 "mozilla/BinarySearch.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Move.h"
 #include "mozilla/net/PartiallySeekableInputStream.h"
 #include "mozilla/net/UrlClassifierCommon.h"
 #include "mozilla/InputStreamLengthHelper.h"
 #include "mozilla/Tokenizer.h"
 #include "nsIHttpHeaderVisitor.h"
 #include "nsIMIMEInputStream.h"
-#include "nsIXULRuntime.h"
 #include "nsICacheInfoChannel.h"
 #include "nsIDOMWindowUtils.h"
-#include "nsIURIFixup.h"
 #include "nsHttpChannel.h"
 #include "nsRedirectHistoryEntry.h"
 #include "nsServerTiming.h"
-#include "nsIURIMutator.h"
 #include "mozilla/Tokenizer.h"
 
 #include <algorithm>
 #include "HttpBaseChannel.h"
 
 namespace mozilla {
 namespace net {
 
--- a/netwerk/protocol/http/HttpBaseChannel.h
+++ b/netwerk/protocol/http/HttpBaseChannel.h
@@ -21,25 +21,23 @@
 #include "nsIHttpChannel.h"
 #include "nsHttpHandler.h"
 #include "nsIHttpChannelInternal.h"
 #include "nsIForcePendingChannel.h"
 #include "nsIFormPOSTActionChannel.h"
 #include "nsIUploadChannel2.h"
 #include "nsIProgressEventSink.h"
 #include "nsIURI.h"
-#include "nsIEffectiveTLDService.h"
 #include "nsIStringEnumerator.h"
 #include "nsISupportsPriority.h"
 #include "nsIClassOfService.h"
 #include "nsIClassifiedChannel.h"
 #include "nsIApplicationCache.h"
 #include "nsIResumableChannel.h"
 #include "nsITraceableChannel.h"
-#include "nsILoadContext.h"
 #include "nsILoadInfo.h"
 #include "mozilla/net/NeckoCommon.h"
 #include "nsThreadUtils.h"
 #include "mozilla/net/PrivateBrowsingChannel.h"
 #include "mozilla/net/DNS.h"
 #include "nsITimedChannel.h"
 #include "nsIHttpChannel.h"
 #include "nsISecurityConsoleMessage.h"
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -25,17 +25,16 @@
 #include "mozilla/net/HttpChannelChild.h"
 #include "mozilla/net/UrlClassifierCommon.h"
 #include "mozilla/net/UrlClassifierFeatureFactory.h"
 
 #include "AltDataOutputStreamChild.h"
 #include "CookieServiceChild.h"
 #include "HttpBackgroundChannelChild.h"
 #include "nsCOMPtr.h"
-#include "nsISupportsPrimitives.h"
 #include "nsContentPolicyUtils.h"
 #include "nsDOMNavigationTiming.h"
 #include "nsGlobalWindow.h"
 #include "nsStringStream.h"
 #include "nsHttpChannel.h"
 #include "nsHttpHandler.h"
 #include "nsNetUtil.h"
 #include "nsSerializationHelper.h"
@@ -44,17 +43,16 @@
 #include "mozilla/ipc/InputStreamUtils.h"
 #include "mozilla/ipc/URIUtils.h"
 #include "mozilla/ipc/BackgroundUtils.h"
 #include "mozilla/net/ChannelDiverterChild.h"
 #include "mozilla/net/DNS.h"
 #include "SerializedLoadContext.h"
 #include "nsInputStreamPump.h"
 #include "InterceptedChannel.h"
-#include "mozIThirdPartyUtil.h"
 #include "nsContentSecurityManager.h"
 #include "nsICompressConvStats.h"
 #include "nsIDeprecationWarner.h"
 #include "mozilla/dom/Document.h"
 #include "nsIEventTarget.h"
 #include "nsIScriptError.h"
 #include "nsRedirectHistoryEntry.h"
 #include "nsSocketTransportService2.h"
--- a/netwerk/protocol/http/HttpChannelChild.h
+++ b/netwerk/protocol/http/HttpChannelChild.h
@@ -12,24 +12,22 @@
 #include "mozilla/Telemetry.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/net/HttpBaseChannel.h"
 #include "mozilla/net/NeckoTargetHolder.h"
 #include "mozilla/net/PHttpChannelChild.h"
 #include "mozilla/net/ChannelEventQueue.h"
 
 #include "nsIStreamListener.h"
-#include "nsILoadGroup.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIProgressEventSink.h"
 #include "nsICacheInfoChannel.h"
 #include "nsIApplicationCache.h"
 #include "nsIApplicationCacheChannel.h"
-#include "nsIUploadChannel2.h"
 #include "nsIResumableChannel.h"
 #include "nsIProxiedChannel.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "nsIChildChannel.h"
 #include "nsIHttpChannelChild.h"
 #include "nsIDivertableChannel.h"
 #include "nsIMultiPartChannel.h"
 #include "nsIThreadRetargetableRequest.h"
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -29,37 +29,31 @@
 #include "nsIAuthPromptProvider.h"
 #include "mozilla/net/BackgroundChannelRegistrar.h"
 #include "nsSerializationHelper.h"
 #include "nsISerializable.h"
 #include "nsIApplicationCacheService.h"
 #include "mozilla/ipc/InputStreamUtils.h"
 #include "mozilla/ipc/URIUtils.h"
 #include "SerializedLoadContext.h"
-#include "nsIAuthInformation.h"
-#include "nsIAuthPromptCallback.h"
-#include "nsIContentPolicy.h"
 #include "mozilla/ipc/BackgroundUtils.h"
-#include "nsICachingChannel.h"
 #include "mozilla/LoadInfo.h"
 #include "nsQueryObject.h"
 #include "mozilla/BasePrincipal.h"
 #include "nsCORSListenerProxy.h"
 #include "nsIIPCSerializableInputStream.h"
 #include "nsIPrompt.h"
 #include "mozilla/net/RedirectChannelRegistrar.h"
 #include "nsIWindowWatcher.h"
 #include "mozilla/dom/Document.h"
 #include "nsISecureBrowserUI.h"
 #include "nsStreamUtils.h"
 #include "nsStringStream.h"
-#include "nsIStorageStream.h"
 #include "nsThreadUtils.h"
 #include "nsQueryObject.h"
-#include "nsIURIClassifier.h"
 #include "nsIMultiPartChannel.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
@@ -9,17 +9,16 @@
 #define mozilla_net_HttpChannelParent_h
 
 #include "ADivertableParentChannel.h"
 #include "nsHttp.h"
 #include "mozilla/net/PHttpChannelParent.h"
 #include "mozilla/net/NeckoCommon.h"
 #include "mozilla/net/NeckoParent.h"
 #include "mozilla/MozPromise.h"
-#include "nsIObserver.h"
 #include "nsIParentRedirectingChannel.h"
 #include "nsIProgressEventSink.h"
 #include "nsIChannelEventSink.h"
 #include "nsIRedirectResultListener.h"
 #include "nsHttpChannel.h"
 #include "nsIAuthPromptProvider.h"
 #include "mozilla/dom/ipc/IdType.h"
 #include "nsIDeprecationWarner.h"
--- a/netwerk/protocol/http/InterceptedChannel.cpp
+++ b/netwerk/protocol/http/InterceptedChannel.cpp
@@ -2,28 +2,24 @@
 /* vim:set expandtab ts=2 sw=2 sts=2 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 "HttpLog.h"
 
 #include "InterceptedChannel.h"
-#include "nsICancelable.h"
 #include "nsInputStreamPump.h"
-#include "nsIPipe.h"
-#include "nsIStreamListener.h"
 #include "nsITimedChannel.h"
 #include "nsHttpChannel.h"
 #include "HttpChannelChild.h"
 #include "nsHttpResponseHead.h"
 #include "nsNetUtil.h"
 #include "mozilla/ConsoleReportCollector.h"
 #include "mozilla/dom/ChannelInfo.h"
-#include "nsIChannelEventSink.h"
 #include "nsThreadUtils.h"
 
 namespace mozilla {
 namespace net {
 
 extern nsresult DoUpdateExpirationTime(nsHttpChannel* aSelf,
                                        nsICacheEntry* aCacheEntry,
                                        nsHttpResponseHead* aResponseHead,
--- a/netwerk/protocol/http/PHttpChannelParams.h
+++ b/netwerk/protocol/http/PHttpChannelParams.h
@@ -12,18 +12,16 @@
 
 #include "ipc/IPCMessageUtils.h"
 #include "nsHttp.h"
 #include "nsHttpHeaderArray.h"
 #include "nsHttpRequestHead.h"
 #include "nsHttpResponseHead.h"
 #include "mozilla/Tuple.h"
 
-#include "nsIClassInfo.h"
-
 namespace mozilla {
 namespace net {
 
 struct RequestHeaderTuple {
   nsCString mHeader;
   nsCString mValue;
   bool mMerge;
   bool mEmpty;
--- a/netwerk/protocol/http/ParentChannelListener.cpp
+++ b/netwerk/protocol/http/ParentChannelListener.cpp
@@ -12,17 +12,16 @@
 #include "mozilla/dom/ServiceWorkerInterceptController.h"
 #include "mozilla/dom/ServiceWorkerUtils.h"
 #include "mozilla/net/HttpChannelParent.h"
 #include "mozilla/net/RedirectChannelRegistrar.h"
 #include "mozilla/Unused.h"
 #include "nsIAuthPrompt.h"
 #include "nsIAuthPrompt2.h"
 #include "nsIHttpHeaderVisitor.h"
-#include "nsIRemoteTab.h"
 #include "nsIPrompt.h"
 #include "nsIPromptFactory.h"
 #include "nsISecureBrowserUI.h"
 #include "nsIWindowWatcher.h"
 #include "nsQueryObject.h"
 
 using mozilla::Unused;
 using mozilla::dom::ServiceWorkerInterceptController;
--- a/netwerk/protocol/http/nsCORSListenerProxy.cpp
+++ b/netwerk/protocol/http/nsCORSListenerProxy.cpp
@@ -10,22 +10,20 @@
 
 #include "nsCORSListenerProxy.h"
 #include "nsIChannel.h"
 #include "nsIHttpChannel.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"
-#include "nsIStreamConverterService.h"
 #include "nsStringStream.h"
 #include "nsGkAtoms.h"
 #include "nsWhitespaceTokenizer.h"
 #include "nsIChannelEventSink.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "nsCharSeparatedTokenizer.h"
 #include "nsAsyncRedirectVerifyHelper.h"
 #include "nsClassHashtable.h"
--- a/netwerk/protocol/http/nsCORSListenerProxy.h
+++ b/netwerk/protocol/http/nsCORSListenerProxy.h
@@ -10,17 +10,16 @@
 #include "nsIStreamListener.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "nsIURI.h"
 #include "nsTArray.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIChannelEventSink.h"
-#include "nsIAsyncVerifyRedirectCallback.h"
 #include "nsIHttpChannel.h"
 #include "nsIThreadRetargetableStreamListener.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/Atomics.h"
 #include "mozilla/Mutex.h"
 
 class nsIURI;
 class nsIPrincipal;
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -15,47 +15,42 @@
 #include "mozilla/Sprintf.h"
 #include "mozilla/dom/nsCSPContext.h"
 
 #include "nsHttp.h"
 #include "nsHttpChannel.h"
 #include "nsHttpChannelAuthProvider.h"
 #include "nsHttpHandler.h"
 #include "nsString.h"
-#include "nsIApplicationCacheService.h"
 #include "nsIApplicationCacheContainer.h"
 #include "nsICacheStorageService.h"
 #include "nsICacheStorage.h"
 #include "nsICacheEntry.h"
-#include "nsICaptivePortalService.h"
-#include "nsICookieService.h"
 #include "nsICryptoHash.h"
+#include "nsIEffectiveTLDService.h"
+#include "nsIHttpHeaderVisitor.h"
 #include "nsINetworkInterceptController.h"
 #include "nsINSSErrorsService.h"
 #include "nsISecurityReporter.h"
 #include "nsIStringBundle.h"
 #include "nsIStreamListenerTee.h"
 #include "nsISeekableStream.h"
-#include "nsILoadGroupChild.h"
 #include "nsIProtocolProxyService2.h"
-#include "nsIURIClassifier.h"
 #include "nsMimeTypes.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsIURL.h"
-#include "nsIURIMutator.h"
 #include "nsIStreamTransportService.h"
 #include "prnetdb.h"
 #include "nsEscape.h"
 #include "nsStreamUtils.h"
 #include "nsIOService.h"
 #include "nsDNSPrefetch.h"
 #include "nsChannelClassifier.h"
 #include "nsIRedirectResultListener.h"
-#include "mozIThirdPartyUtil.h"
 #include "mozilla/TimeStamp.h"
 #include "nsError.h"
 #include "nsPrintfCString.h"
 #include "nsAlgorithm.h"
 #include "nsQueryObject.h"
 #include "nsThreadUtils.h"
 #include "GeckoProfiler.h"
 #include "nsIConsoleService.h"
@@ -65,33 +60,29 @@
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "mozilla/StaticPrefs_browser.h"
 #include "mozilla/StaticPrefs_fission.h"
 #include "mozilla/StaticPrefs_network.h"
 #include "mozilla/StaticPrefs_privacy.h"
 #include "mozilla/StaticPrefs_security.h"
-#include "nsISSLSocketControl.h"
 #include "sslt.h"
 #include "nsContentUtils.h"
 #include "nsContentSecurityManager.h"
 #include "nsIClassOfService.h"
-#include "nsIPermissionManager.h"
 #include "nsIPrincipal.h"
 #include "nsIScriptError.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsITransportSecurityInfo.h"
 #include "nsIWebProgressListener.h"
 #include "LoadContextInfo.h"
 #include "netCore.h"
 #include "nsHttpTransaction.h"
-#include "nsICacheEntryDescriptor.h"
 #include "nsICancelable.h"
-#include "nsIHttpChannelAuthProvider.h"
 #include "nsIHttpChannelInternal.h"
 #include "nsIPrompt.h"
 #include "nsInputStreamPump.h"
 #include "nsIURIFixup.h"
 #include "nsURLHelper.h"
 #include "nsISocketTransport.h"
 #include "nsIStreamConverterService.h"
 #include "nsISiteSecurityService.h"
@@ -116,30 +107,26 @@
 #include "mozilla/NullPrincipal.h"
 #include "CacheControlParser.h"
 #include "nsMixedContentBlocker.h"
 #include "CacheStorageService.h"
 #include "HttpChannelParent.h"
 #include "HttpTransactionParent.h"
 #include "ParentChannelListener.h"
 #include "InterceptedHttpChannel.h"
-#include "nsIBufferedStreams.h"
-#include "nsIFileStreams.h"
-#include "nsIMIMEInputStream.h"
-#include "nsIMultiplexInputStream.h"
 #include "../../cache2/CacheFileUtils.h"
 #include "../../cache2/CacheHashUtils.h"
+#include "nsIMultiplexInputStream.h"
 #include "nsINetworkLinkService.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/ServiceWorkerUtils.h"
 #include "mozilla/net/AsyncUrlChannelClassifier.h"
 #include "mozilla/net/CookieSettings.h"
 #include "mozilla/net/NeckoChannelParams.h"
 #include "mozilla/net/UrlClassifierFeatureFactory.h"
-#include "nsIWebNavigation.h"
 #include "HttpTrafficAnalyzer.h"
 #include "mozilla/dom/CanonicalBrowsingContext.h"
 #include "mozilla/dom/WindowGlobalParent.h"
 #include "mozilla/net/SocketProcessParent.h"
 #include "js/Conversions.h"
 
 #ifdef MOZ_TASK_TRACER
 #  include "GeckoTaskTracer.h"
--- a/netwerk/protocol/http/nsHttpChannel.h
+++ b/netwerk/protocol/http/nsHttpChannel.h
@@ -12,34 +12,31 @@
 #include "nsTArray.h"
 #include "nsICachingChannel.h"
 #include "nsICacheEntry.h"
 #include "nsICacheEntryOpenCallback.h"
 #include "nsIDNSListener.h"
 #include "nsIApplicationCacheChannel.h"
 #include "nsIChannelWithDivertableParentListener.h"
 #include "nsIProtocolProxyCallback.h"
-#include "nsIStreamTransportService.h"
 #include "nsIHttpAuthenticableChannel.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "nsIThreadRetargetableRequest.h"
 #include "nsIThreadRetargetableStreamListener.h"
 #include "nsWeakReference.h"
 #include "TimingStruct.h"
 #include "ADivertableParentChannel.h"
 #include "AutoClose.h"
 #include "nsIStreamListener.h"
-#include "nsISupportsPrimitives.h"
 #include "nsICorsPreflightCallback.h"
 #include "AlternateServices.h"
 #include "nsIRaceCacheWithNetwork.h"
 #include "mozilla/extensions/PStreamFilterParent.h"
 #include "mozilla/Mutex.h"
 #include "nsIProcessSwitchRequestor.h"
-#include "nsIRemoteTab.h"
 
 class nsDNSPrefetch;
 class nsICancelable;
 class nsIHttpChannelAuthProvider;
 class nsInputStreamPump;
 class nsITransportSecurityInfo;
 
 namespace mozilla {
--- a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
+++ b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
@@ -26,17 +26,16 @@
 #include "nsIHttpAuthenticableChannel.h"
 #include "nsIURI.h"
 #include "nsContentUtils.h"
 #include "nsHttpBasicAuth.h"
 #include "nsHttpDigestAuth.h"
 #include "nsHttpNegotiateAuth.h"
 #include "nsHttpNTLMAuth.h"
 #include "nsServiceManagerUtils.h"
-#include "nsILoadContext.h"
 #include "nsIURL.h"
 #include "mozilla/StaticPrefs_network.h"
 #include "mozilla/Telemetry.h"
 #include "nsIProxiedChannel.h"
 #include "nsIProxyInfo.h"
 
 namespace mozilla {
 namespace net {
--- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
@@ -16,30 +16,28 @@
 #include "nsHttpConnection.h"
 #include "nsHttpHandler.h"
 #include "nsIHttpChannelInternal.h"
 #include "nsNetCID.h"
 #include "nsCOMPtr.h"
 #include "nsNetUtil.h"
 #include "mozilla/net/DNS.h"
 #include "nsISocketTransport.h"
-#include "nsISSLSocketControl.h"
 #include "mozilla/Services.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/net/DashboardTypes.h"
 #include "NullHttpTransaction.h"
 #include "nsIDNSRecord.h"
 #include "nsITransport.h"
 #include "nsInterfaceRequestorAgg.h"
 #include "nsIRequestContext.h"
 #include "nsISocketTransportService.h"
 #include <algorithm>
 #include "mozilla/ChaosMode.h"
 #include "mozilla/Unused.h"
-#include "nsIURI.h"
 #include "nsIXPConnect.h"
 
 #include "mozilla/Move.h"
 #include "mozilla/Telemetry.h"
 
 namespace mozilla {
 namespace net {
 
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -10,23 +10,18 @@
 #include "prsystem.h"
 
 #include "nsError.h"
 #include "nsHttp.h"
 #include "nsHttpHandler.h"
 #include "nsHttpChannel.h"
 #include "nsHttpAuthCache.h"
 #include "nsStandardURL.h"
-#include "nsIHttpChannel.h"
-#include "nsIStandardURL.h"
 #include "LoadContextInfo.h"
 #include "nsCategoryManagerUtils.h"
-#include "nsIPrefService.h"
-#include "nsIPrefBranch.h"
-#include "nsIPrefLocalizedString.h"
 #include "nsIProcessSwitchRequestor.h"
 #include "nsSocketProviderService.h"
 #include "nsISocketProvider.h"
 #include "nsPrintfCString.h"
 #include "nsCOMPtr.h"
 #include "nsNetCID.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/Printf.h"
@@ -40,21 +35,20 @@
 #include "EventTokenBucket.h"
 #include "Tickler.h"
 #include "nsIXULAppInfo.h"
 #include "nsICookieService.h"
 #include "nsIObserverService.h"
 #include "nsISiteSecurityService.h"
 #include "nsIStreamConverterService.h"
 #include "nsCRT.h"
-#include "nsIMemoryReporter.h"
 #include "nsIParentalControlsService.h"
 #include "nsPIDOMWindow.h"
+#include "nsHttpChannelAuthProvider.h"
 #include "nsINetworkLinkService.h"
-#include "nsHttpChannelAuthProvider.h"
 #include "nsNetUtil.h"
 #include "nsServiceManagerUtils.h"
 #include "nsComponentManagerUtils.h"
 #include "nsSocketTransportService2.h"
 #include "nsIOService.h"
 #include "nsISupportsPrimitives.h"
 #include "nsIXULRuntime.h"
 #include "nsCharSeparatedTokenizer.h"
--- a/netwerk/protocol/http/nsHttpNTLMAuth.cpp
+++ b/netwerk/protocol/http/nsHttpNTLMAuth.cpp
@@ -12,17 +12,16 @@
 #include "nsServiceManagerUtils.h"
 #include "plbase64.h"
 #include "plstr.h"
 #include "prnetdb.h"
 
 //-----------------------------------------------------------------------------
 
 #include "nsIPrefBranch.h"
-#include "nsIPrefService.h"
 #include "nsIHttpAuthenticableChannel.h"
 #include "nsIURI.h"
 #ifdef XP_WIN
 #  include "nsIChannel.h"
 #  include "nsIX509Cert.h"
 #  include "nsITransportSecurityInfo.h"
 #endif
 #include "mozilla/Attributes.h"
--- a/netwerk/protocol/http/nsHttpTransaction.cpp
+++ b/netwerk/protocol/http/nsHttpTransaction.cpp
@@ -16,17 +16,16 @@
 #include "nsHttpNegotiateAuth.h"
 #include "nsHttpNTLMAuth.h"
 #include "nsHttpRequestHead.h"
 #include "nsHttpResponseHead.h"
 #include "nsHttpTransaction.h"
 #include "nsTransportUtils.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
-#include "nsIChannel.h"
 #include "nsIPipe.h"
 #include "nsCRT.h"
 #include "mozilla/Tokenizer.h"
 #include "mozilla/Move.h"
 #include "TCPFastOpenLayer.h"
 
 #include "nsISeekableStream.h"
 #include "nsMultiplexInputStream.h"
@@ -34,16 +33,17 @@
 
 #include "nsComponentManagerUtils.h"  // do_CreateInstance
 #include "nsIHttpActivityObserver.h"
 #include "nsSocketTransportService2.h"
 #include "nsICancelable.h"
 #include "nsIClassOfService.h"
 #include "nsIEventTarget.h"
 #include "nsIHttpChannelInternal.h"
+#include "nsIMultiplexInputStream.h"
 #include "nsIInputStream.h"
 #include "nsIThrottledInputChannel.h"
 #include "nsITransport.h"
 #include "nsIOService.h"
 #include "nsIRequestContext.h"
 #include "nsIHttpAuthenticator.h"
 #include "nsQueryObject.h"
 #include "NSSErrorsService.h"
--- a/netwerk/protocol/res/ExtensionProtocolHandler.cpp
+++ b/netwerk/protocol/res/ExtensionProtocolHandler.cpp
@@ -32,19 +32,17 @@
 #include "nsIFileURL.h"
 #include "nsIJARChannel.h"
 #include "nsIMIMEService.h"
 #include "nsIURL.h"
 #include "nsIChannel.h"
 #include "nsIInputStreamPump.h"
 #include "nsIJARURI.h"
 #include "nsIStreamListener.h"
-#include "nsIThread.h"
 #include "nsIInputStream.h"
-#include "nsIOutputStream.h"
 #include "nsIStreamConverterService.h"
 #include "nsNetUtil.h"
 #include "nsReadableUtils.h"
 #include "nsURLHelper.h"
 #include "prio.h"
 #include "SimpleChannel.h"
 
 #if defined(XP_WIN)
--- a/netwerk/protocol/res/nsResProtocolHandler.cpp
+++ b/netwerk/protocol/res/nsResProtocolHandler.cpp
@@ -3,18 +3,16 @@
  * 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/chrome/RegistryMessageUtils.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/Unused.h"
 
 #include "nsResProtocolHandler.h"
-#include "nsIIOService.h"
-#include "nsIFile.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsURLHelper.h"
 #include "nsEscape.h"
 
 #include "mozilla/Omnijar.h"
 
 using mozilla::LogLevel;
--- a/netwerk/protocol/websocket/WebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/WebSocketChannel.cpp
@@ -11,43 +11,38 @@
 #include "mozilla/Atomics.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/EndianUtils.h"
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/Utf8.h"
 #include "mozilla/net/WebSocketEventService.h"
 
 #include "nsIURI.h"
-#include "nsIURIMutator.h"
 #include "nsIChannel.h"
 #include "nsICryptoHash.h"
 #include "nsIRunnable.h"
 #include "nsIPrefBranch.h"
-#include "nsIPrefService.h"
 #include "nsICancelable.h"
 #include "nsIClassOfService.h"
 #include "nsIDNSRecord.h"
 #include "nsIDNSService.h"
-#include "nsIStreamConverterService.h"
 #include "nsIIOService.h"
 #include "nsIProtocolProxyService.h"
 #include "nsIProxyInfo.h"
 #include "nsIProxiedChannel.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "nsIDashboardEventNotifier.h"
 #include "nsIEventTarget.h"
 #include "nsIHttpChannel.h"
-#include "nsILoadGroup.h"
 #include "nsIProtocolHandler.h"
 #include "nsIRandomGenerator.h"
 #include "nsISocketTransport.h"
 #include "nsThreadUtils.h"
 #include "nsINetworkLinkService.h"
 #include "nsIObserverService.h"
-#include "nsITransportProvider.h"
 #include "nsCharSeparatedTokenizer.h"
 
 #include "nsAutoPtr.h"
 #include "nsNetCID.h"
 #include "nsServiceManagerUtils.h"
 #include "nsCRT.h"
 #include "nsThreadUtils.h"
 #include "nsError.h"
--- a/netwerk/protocol/websocket/WebSocketChannel.h
+++ b/netwerk/protocol/websocket/WebSocketChannel.h
@@ -14,17 +14,16 @@
 #include "nsIAsyncOutputStream.h"
 #include "nsITimer.h"
 #include "nsIDNSListener.h"
 #include "nsINamed.h"
 #include "nsIObserver.h"
 #include "nsIProtocolProxyCallback.h"
 #include "nsIChannelEventSink.h"
 #include "nsIHttpChannelInternal.h"
-#include "nsIStringStream.h"
 #include "BaseWebSocketChannel.h"
 
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "nsDeque.h"
 #include "mozilla/Atomics.h"
 
 class nsIAsyncVerifyRedirectCallback;
--- a/netwerk/protocol/websocket/WebSocketFrame.h
+++ b/netwerk/protocol/websocket/WebSocketFrame.h
@@ -2,16 +2,18 @@
 /* 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/. */
 
 #ifndef mozilla_net_WebSocketFrame_h
 #define mozilla_net_WebSocketFrame_h
 
+#include "nsIWebSocketEventService.h"
+
 #include "nsAutoPtr.h"
 #include "nsIWebSocketEventService.h"
 #include "nsString.h"
 
 namespace IPC {
 class Message;
 }
 
--- a/netwerk/socket/nsNamedPipeIOLayer.cpp
+++ b/netwerk/socket/nsNamedPipeIOLayer.cpp
@@ -9,17 +9,16 @@
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Logging.h"
 #include "mozilla/Move.h"
 #include "mozilla/net/DNS.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/Unused.h"
 #include "nsNamedPipeService.h"
 #include "nsISupportsImpl.h"
-#include "nsIThread.h"
 #include "nsNamedPipeIOLayer.h"
 #include "nsNetCID.h"
 #include "nspr.h"
 #include "nsServiceManagerUtils.h"
 #include "nsSocketTransportService2.h"
 #include "nsString.h"
 #include "nsThreadUtils.h"
 #include "private/pprio.h"
--- a/netwerk/socket/nsNamedPipeService.cpp
+++ b/netwerk/socket/nsNamedPipeService.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; 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 "mozilla/Services.h"
 #include "nsCOMPtr.h"
 #include "nsIObserverService.h"
-#include "nsIThread.h"
 #include "nsNamedPipeService.h"
 #include "nsNetCID.h"
 #include "nsThreadUtils.h"
 #include "mozilla/ClearOnShutdown.h"
 
 namespace mozilla {
 namespace net {
 
--- a/netwerk/socket/nsSOCKSIOLayer.cpp
+++ b/netwerk/socket/nsSOCKSIOLayer.cpp
@@ -4,17 +4,16 @@
  * 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 "nspr.h"
 #include "private/pprio.h"
 #include "nsString.h"
 #include "nsCRT.h"
 
-#include "nsIServiceManager.h"
 #include "nsIDNSService.h"
 #include "nsIDNSRecord.h"
 #include "nsISOCKSSocketInfo.h"
 #include "nsISocketProvider.h"
 #include "nsNamedPipeIOLayer.h"
 #include "nsSOCKSIOLayer.h"
 #include "nsNetCID.h"
 #include "nsIDNSListener.h"
--- a/netwerk/socket/nsSOCKSSocketProvider.cpp
+++ b/netwerk/socket/nsSOCKSSocketProvider.cpp
@@ -1,15 +1,14 @@
 /* -*- Mode: C++; tab-width: 4; 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 "nsIServiceManager.h"
 #include "nsNamedPipeIOLayer.h"
 #include "nsSOCKSSocketProvider.h"
 #include "nsSOCKSIOLayer.h"
 #include "nsCOMPtr.h"
 #include "nsError.h"
 
 using mozilla::OriginAttributes;
 
--- a/netwerk/socket/nsSocketProviderService.cpp
+++ b/netwerk/socket/nsSocketProviderService.cpp
@@ -1,15 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; 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 "nsString.h"
-#include "nsIServiceManager.h"
 #include "nsISocketProvider.h"
 #include "nsError.h"
 #include "nsNSSComponent.h"
 #include "nsSOCKSSocketProvider.h"
 #include "nsSocketProviderService.h"
 #include "nsSSLSocketProvider.h"
 #include "nsTLSSocketProvider.h"
 #include "nsUDPSocketProvider.h"
--- a/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
+++ b/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
@@ -5,17 +5,16 @@
 
 #include "mozilla/TextUtils.h"
 #include "mozTXTToHTMLConv.h"
 #include "nsNetUtil.h"
 #include "nsUnicharUtils.h"
 #include "nsUnicodeProperties.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/nsIndexedToHTML.cpp
+++ b/netwerk/streamconv/converters/nsIndexedToHTML.cpp
@@ -8,25 +8,20 @@
 #include "DateTimeFormat.h"
 #include "mozilla/Encoding.h"
 #include "mozilla/intl/LocaleService.h"
 #include "nsNetUtil.h"
 #include "netCore.h"
 #include "nsStringStream.h"
 #include "nsIFile.h"
 #include "nsIFileURL.h"
-#include "nsIURIMutator.h"
 #include "nsEscape.h"
 #include "nsIDirIndex.h"
 #include "nsURLHelper.h"
-#include "nsIPrefService.h"
-#include "nsIPrefBranch.h"
-#include "nsIPrefLocalizedString.h"
 #include "nsIStringBundle.h"
-#include "nsITextToSubURI.h"
 #include "nsDirIndexParser.h"
 #include "nsNativeCharsetUtils.h"
 #include "nsString.h"
 #include "nsContentUtils.h"
 #include <algorithm>
 #include "nsIChannel.h"
 #include "mozilla/Unused.h"
 
--- a/netwerk/streamconv/converters/nsMultiMixedConv.cpp
+++ b/netwerk/streamconv/converters/nsMultiMixedConv.cpp
@@ -8,17 +8,16 @@
 #include "nsIHttpChannel.h"
 #include "nsNetCID.h"
 #include "nsMimeTypes.h"
 #include "nsIStringStream.h"
 #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"
 #include "nsHttpHeaderArray.h"
 #include "mozilla/AutoRestore.h"
 
--- a/netwerk/streamconv/converters/nsMultiMixedConv.h
+++ b/netwerk/streamconv/converters/nsMultiMixedConv.h
@@ -5,17 +5,16 @@
 #ifndef __nsmultimixedconv__h__
 #define __nsmultimixedconv__h__
 
 #include "nsIStreamConverter.h"
 #include "nsIChannel.h"
 #include "nsString.h"
 #include "nsCOMPtr.h"
 #include "nsIByteRangeRequest.h"
-#include "nsILoadInfo.h"
 #include "nsIMultiPartChannel.h"
 #include "nsAutoPtr.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/IncrementalTokenizer.h"
 #include "nsHttpResponseHead.h"
 
 #define NS_MULTIMIXEDCONVERTER_CID                 \
   { /* 7584CE90-5B25-11d3-A175-0050041CAF44 */     \
--- a/netwerk/streamconv/converters/nsUnknownDecoder.cpp
+++ b/netwerk/streamconv/converters/nsUnknownDecoder.cpp
@@ -3,17 +3,16 @@
  * 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 "nsUnknownDecoder.h"
 #include "nsIPipe.h"
 #include "nsIInputStream.h"
 #include "nsIOutputStream.h"
 #include "nsMimeTypes.h"
-#include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 
 #include "nsCRT.h"
 
 #include "nsIMIMEService.h"
 
 #include "nsIDivertableChannel.h"
 #include "nsIViewSourceChannel.h"
--- a/netwerk/streamconv/nsStreamConverterService.cpp
+++ b/netwerk/streamconv/nsStreamConverterService.cpp
@@ -1,14 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; 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 "nsComponentManagerUtils.h"
 #include "nsStreamConverterService.h"
 #include "nsIComponentRegistrar.h"
 #include "nsAutoPtr.h"
 #include "nsString.h"
 #include "nsAtom.h"
 #include "nsDeque.h"
 #include "nsIInputStream.h"
 #include "nsIStreamConverter.h"
--- a/netwerk/system/netlink/NetlinkService.h
+++ b/netwerk/system/netlink/NetlinkService.h
@@ -4,23 +4,21 @@
  * 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 NETLINKSERVICE_H_
 #define NETLINKSERVICE_H_
 
 #include <netinet/in.h>
 #include <linux/netlink.h>
 
-#include "nsINetworkLinkService.h"
 #include "nsIRunnable.h"
 #include "nsThreadUtils.h"
 #include "nsCOMPtr.h"
 #include "mozilla/Mutex.h"
 #include "mozilla/TimeStamp.h"
-#include "nsITimer.h"
 #include "nsClassHashtable.h"
 #include "mozilla/SHA1.h"
 
 namespace mozilla {
 namespace net {
 
 #if defined(NIGHTLY_BUILD) || defined(MOZ_DEV_EDITION) || defined(DEBUG)
 #  define NL_DEBUG_LOG
--- a/netwerk/system/win32/nsNotifyAddrListener.cpp
+++ b/netwerk/system/win32/nsNotifyAddrListener.cpp
@@ -23,16 +23,17 @@
 #include <ws2ipdef.h>
 #include <tcpmib.h>
 #include <iphlpapi.h>
 #include <netioapi.h>
 #include <netlistmgr.h>
 #include <iprtrmib.h>
 #include "plstr.h"
 #include "mozilla/Logging.h"
+#include "nsComponentManagerUtils.h"
 #include "nsThreadUtils.h"
 #include "nsIObserverService.h"
 #include "nsIWindowsRegKey.h"
 #include "nsServiceManagerUtils.h"
 #include "nsNotifyAddrListener.h"
 #include "nsString.h"
 #include "nsPrintfCString.h"
 #include "nsAutoPtr.h"
--- a/netwerk/test/TestBind.cpp
+++ b/netwerk/test/TestBind.cpp
@@ -3,17 +3,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "TestCommon.h"
 #include "gtest/gtest.h"
 #include "nsISocketTransportService.h"
 #include "nsISocketTransport.h"
 #include "nsIServerSocket.h"
 #include "nsIAsyncInputStream.h"
-#include "nsINetAddr.h"
 #include "mozilla/net/DNS.h"
 #include "prerror.h"
 #include "nsComponentManagerUtils.h"
 #include "nsServiceManagerUtils.h"
 
 using namespace mozilla::net;
 using namespace mozilla;
 
--- a/netwerk/test/TestCookie.cpp
+++ b/netwerk/test/TestCookie.cpp
@@ -1,29 +1,27 @@
 /* -*- Mode: C++; tab-width: 2; 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 "TestCommon.h"
 #include "gtest/gtest.h"
-#include "nsIServiceManager.h"
 #include "nsICookieService.h"
 #include "nsICookieManager.h"
 #include "nsICookie.h"
 #include <stdio.h>
 #include "plstr.h"
 #include "nsNetUtil.h"
 #include "nsIChannel.h"
 #include "nsIPrincipal.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsServiceManagerUtils.h"
 #include "nsNetCID.h"
 #include "nsIPrefBranch.h"
-#include "nsIPrefService.h"
 #include "mozilla/Unused.h"
 #include "mozilla/net/CookieSettings.h"
 #include "nsIURI.h"
 
 using mozilla::Unused;
 
 static NS_DEFINE_CID(kCookieServiceCID, NS_COOKIESERVICE_CID);
 static NS_DEFINE_CID(kPrefServiceCID, NS_PREFSERVICE_CID);
--- a/netwerk/test/TestUDPSocket.cpp
+++ b/netwerk/test/TestUDPSocket.cpp
@@ -1,21 +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 "TestCommon.h"
 #include "gtest/gtest.h"
 #include "nsIUDPSocket.h"
-#include "nsISocketTransportService.h"
 #include "nsISocketTransport.h"
 #include "nsIOutputStream.h"
-#include "nsIInputStream.h"
 #include "nsINetAddr.h"
-#include "nsIScriptSecurityManager.h"
 #include "nsITimer.h"
 #include "nsContentUtils.h"
 #include "mozilla/net/DNS.h"
 #include "prerror.h"
 
 #define REQUEST 0x68656c6f
 #define RESPONSE 0x6f6c6568
 #define MULTICAST_TIMEOUT 2000
--- a/netwerk/test/fuzz/TestFtpFuzzing.cpp
+++ b/netwerk/test/fuzz/TestFtpFuzzing.cpp
@@ -1,24 +1,22 @@
 #include "mozilla/Preferences.h"
 
 #include "nsCOMPtr.h"
 #include "nsNetCID.h"
 #include "nsString.h"
 #include "nsComponentManagerUtils.h"
 #include "nsContentUtils.h"
-#include "nsIPrincipal.h"
 #include "nsScriptSecurityManager.h"
 #include "nsServiceManagerUtils.h"
 #include "nsNetUtil.h"
 #include "NullPrincipal.h"
 #include "nsCycleCollector.h"
 
 #include "nsFtpProtocolHandler.h"
-#include "nsIFTPChannel.h"
 
 #include "FuzzingInterface.h"
 #include "FuzzingStreamListener.h"
 #include "FuzzyLayer.h"
 
 namespace mozilla {
 namespace net {
 
--- a/netwerk/test/fuzz/TestHttpFuzzing.cpp
+++ b/netwerk/test/fuzz/TestHttpFuzzing.cpp
@@ -2,17 +2,16 @@
 #include "mozilla/Preferences.h"
 
 #include "nsCOMPtr.h"
 #include "nsNetCID.h"
 #include "nsString.h"
 #include "nsComponentManagerUtils.h"
 #include "nsContentUtils.h"
 #include "nsILoadInfo.h"
-#include "nsIPrincipal.h"
 #include "nsIProxiedProtocolHandler.h"
 #include "nsIOService.h"
 #include "nsProtocolProxyService.h"
 #include "nsScriptSecurityManager.h"
 #include "nsServiceManagerUtils.h"
 #include "nsNetUtil.h"
 #include "NullPrincipal.h"
 #include "nsCycleCollector.h"
--- a/netwerk/test/gtest/TestMIMEInputStream.cpp
+++ b/netwerk/test/gtest/TestMIMEInputStream.cpp
@@ -1,13 +1,13 @@
 #include "gtest/gtest.h"
 
 #include "Helpers.h"
+#include "nsComponentManagerUtils.h"
 #include "nsCOMPtr.h"
-#include "nsIPipe.h"
 #include "nsStreamUtils.h"
 #include "nsString.h"
 #include "nsStringStream.h"
 #include "nsIMIMEInputStream.h"
 
 using mozilla::GetCurrentThreadSerialEventTarget;
 using mozilla::SpinEventLoopUntil;
 
--- a/netwerk/test/gtest/TestPartiallySeekableInputStream.cpp
+++ b/netwerk/test/gtest/TestPartiallySeekableInputStream.cpp
@@ -1,13 +1,12 @@
 #include "gtest/gtest.h"
 
 #include "Helpers.h"
 #include "nsCOMPtr.h"
-#include "nsIPipe.h"
 #include "nsStreamUtils.h"
 #include "nsString.h"
 #include "nsStringStream.h"
 #include "mozilla/net/PartiallySeekableInputStream.h"
 
 using mozilla::GetCurrentThreadSerialEventTarget;
 using mozilla::SpinEventLoopUntil;
 using mozilla::net::PartiallySeekableInputStream;
--- a/netwerk/test/gtest/TestURIMutator.cpp
+++ b/netwerk/test/gtest/TestURIMutator.cpp
@@ -1,13 +1,12 @@
 #include "gtest/gtest.h"
 #include "nsCOMPtr.h"
 #include "nsNetCID.h"
 #include "nsIURL.h"
-#include "nsIURIMutator.h"
 #include "nsThreadPool.h"
 #include "nsNetUtil.h"
 
 TEST(TestURIMutator, Mutator)
 {
   nsAutoCString out;
 
   // This test instantiates a new nsStandardURL::Mutator (via contractID)
--- a/netwerk/url-classifier/AsyncUrlChannelClassifier.cpp
+++ b/netwerk/url-classifier/AsyncUrlChannelClassifier.cpp
@@ -9,18 +9,16 @@
 #include "mozilla/ErrorNames.h"
 #include "mozilla/net/AsyncUrlChannelClassifier.h"
 #include "mozilla/net/UrlClassifierCommon.h"
 #include "mozilla/net/UrlClassifierFeatureFactory.h"
 #include "mozilla/net/UrlClassifierFeatureResult.h"
 #include "nsContentUtils.h"
 #include "nsIChannel.h"
 #include "nsIHttpChannel.h"
-#include "nsIHttpChannelInternal.h"
-#include "nsIURIClassifier.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsPrintfCString.h"
 #include "nsProxyRelease.h"
 #include "nsServiceManagerUtils.h"
 #include "nsUrlClassifierDBService.h"
 #include "nsUrlClassifierUtils.h"
 
--- a/netwerk/url-classifier/nsChannelClassifier.cpp
+++ b/netwerk/url-classifier/nsChannelClassifier.cpp
@@ -5,28 +5,22 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsChannelClassifier.h"
 
 #include "nsCharSeparatedTokenizer.h"
 #include "nsICacheEntry.h"
 #include "nsICachingChannel.h"
 #include "nsIChannel.h"
-#include "nsIIOService.h"
 #include "nsIObserverService.h"
-#include "nsIPermissionManager.h"
 #include "nsIProtocolHandler.h"
 #include "nsIScriptSecurityManager.h"
-#include "nsISecureBrowserUI.h"
-#include "nsISupportsPriority.h"
 #include "nsNetUtil.h"
 #include "nsXULAppAPI.h"
 #include "nsQueryObject.h"
-#include "nsIUrlClassifierDBService.h"
-#include "nsIUrlClassifierFeature.h"
 #include "nsPrintfCString.h"
 
 #include "mozilla/Components.h"
 #include "mozilla/ErrorNames.h"
 #include "mozilla/Logging.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/net/UrlClassifierCommon.h"
 #include "mozilla/net/UrlClassifierFeatureFactory.h"
--- a/netwerk/wifi/nsWifiMonitor.h
+++ b/netwerk/wifi/nsWifiMonitor.h
@@ -13,19 +13,17 @@
 #include "nsIRunnable.h"
 #include "nsCOMArray.h"
 #include "nsIWifiListener.h"
 #include "mozilla/Atomics.h"
 #include "mozilla/ReentrantMonitor.h"
 #include "mozilla/Logging.h"
 #include "nsIObserver.h"
 #include "nsTArray.h"
-#include "nsITimer.h"
 #include "mozilla/Attributes.h"
-#include "nsIInterfaceRequestor.h"
 
 #ifdef XP_WIN
 #  include "win_wifiScanner.h"
 #endif
 
 extern mozilla::LazyLogModule gWifiMonitorLog;
 #define LOG(args) MOZ_LOG(gWifiMonitorLog, mozilla::LogLevel::Debug, args)
 
--- a/netwerk/wifi/nsWifiScannerMac.cpp
+++ b/netwerk/wifi/nsWifiScannerMac.cpp
@@ -10,17 +10,16 @@
 
 #include "nsAutoPtr.h"
 #include "nsCOMArray.h"
 #include "nsWifiMonitor.h"
 #include "nsWifiAccessPoint.h"
 
 #include "nsServiceManagerUtils.h"
 #include "nsComponentManagerUtils.h"
-#include "nsIMutableArray.h"
 
 using namespace mozilla;
 
 // defined in osx_corewlan.mm
 // basically replaces accesspoints in the passed reference
 // it lives in a separate file so that we can use objective c.
 extern nsresult GetAccessPointsFromWLAN(
     nsCOMArray<nsWifiAccessPoint>& accessPoints);
--- a/netwerk/wifi/nsWifiScannerSolaris.cpp
+++ b/netwerk/wifi/nsWifiScannerSolaris.cpp
@@ -2,17 +2,16 @@
  * 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 "nsWifiMonitor.h"
 #include "nsWifiAccessPoint.h"
 
 #include "nsServiceManagerUtils.h"
 #include "nsComponentManagerUtils.h"
-#include "nsIMutableArray.h"
 
 #include <glib.h>
 
 #define DLADM_STRSIZE 256
 #define DLADM_SECTIONS 3
 
 using namespace mozilla;
 
--- a/netwerk/wifi/nsWifiScannerWin.cpp
+++ b/netwerk/wifi/nsWifiScannerWin.cpp
@@ -3,17 +3,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsWifiMonitor.h"
 
 // moz headers (alphabetical)
 #include "nsAutoPtr.h"
 #include "nsCOMArray.h"
 #include "nsComponentManagerUtils.h"
-#include "nsIMutableArray.h"
 #include "nsServiceManagerUtils.h"
 #include "nsWifiAccessPoint.h"
 #include "win_wifiScanner.h"
 
 using namespace mozilla;
 
 /**
  * `nsWifiMonitor` is declared in the cross-platform nsWifiMonitor.h and
--- a/parser/html/nsHtml5Module.cpp
+++ b/parser/html/nsHtml5Module.cpp
@@ -12,17 +12,16 @@
 #include "nsHtml5HtmlAttributes.h"
 #include "nsHtml5NamedCharacters.h"
 #include "nsHtml5Portability.h"
 #include "nsHtml5StackNode.h"
 #include "nsHtml5Tokenizer.h"
 #include "nsHtml5TreeBuilder.h"
 #include "nsHtml5UTF16Buffer.h"
 #include "nsIObserverService.h"
-#include "nsIServiceManager.h"
 
 using namespace mozilla;
 
 // static
 nsIThread* nsHtml5Module::sStreamParserThread = nullptr;
 nsIThread* nsHtml5Module::sMainThread = nullptr;
 
 // static
--- a/parser/html/nsHtml5OplessBuilder.cpp
+++ b/parser/html/nsHtml5OplessBuilder.cpp
@@ -3,17 +3,16 @@
 /* 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 "nsHtml5OplessBuilder.h"
 
 #include "mozilla/css/Loader.h"
 #include "mozilla/dom/ScriptLoader.h"
-#include "nsIDocShell.h"
 
 nsHtml5OplessBuilder::nsHtml5OplessBuilder() : nsHtml5DocumentBuilder(true) {}
 
 nsHtml5OplessBuilder::~nsHtml5OplessBuilder() {}
 
 void nsHtml5OplessBuilder::Start() {
   BeginFlush();
   BeginDocUpdate();
--- a/parser/html/nsHtml5Parser.h
+++ b/parser/html/nsHtml5Parser.h
@@ -4,26 +4,24 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef NS_HTML5_PARSER
 #define NS_HTML5_PARSER
 
 #include "nsAutoPtr.h"
 #include "nsIParser.h"
 #include "nsDeque.h"
-#include "nsIURL.h"
 #include "nsParserCIID.h"
 #include "nsITokenizer.h"
 #include "nsIContentSink.h"
 #include "nsIRequest.h"
 #include "nsIChannel.h"
 #include "nsCOMArray.h"
 #include "nsContentSink.h"
 #include "nsCycleCollectionParticipant.h"
-#include "nsIInputStream.h"
 #include "nsDetectionConfident.h"
 #include "nsHtml5OwningUTF16Buffer.h"
 #include "nsHtml5TreeOpExecutor.h"
 #include "nsHtml5StreamParser.h"
 #include "nsHtml5AtomTable.h"
 #include "nsWeakReference.h"
 #include "nsHtml5StreamListener.h"
 
--- a/parser/html/nsHtml5TreeBuilder.cpp
+++ b/parser/html/nsHtml5TreeBuilder.cpp
@@ -28,17 +28,16 @@
  * Please edit TreeBuilder.java instead and regenerate.
  */
 
 #define nsHtml5TreeBuilder_cpp__
 
 #include "nsContentUtils.h"
 #include "nsAtom.h"
 #include "nsHtml5AtomTable.h"
-#include "nsITimer.h"
 #include "nsHtml5String.h"
 #include "nsNameSpaceManager.h"
 #include "nsIContent.h"
 #include "nsTraceRefcnt.h"
 #include "jArray.h"
 #include "nsHtml5DocumentMode.h"
 #include "nsHtml5ArrayCopy.h"
 #include "nsHtml5Parser.h"
--- a/parser/html/nsHtml5TreeBuilder.h
+++ b/parser/html/nsHtml5TreeBuilder.h
@@ -29,17 +29,16 @@
  */
 
 #ifndef nsHtml5TreeBuilder_h
 #define nsHtml5TreeBuilder_h
 
 #include "nsContentUtils.h"
 #include "nsAtom.h"
 #include "nsHtml5AtomTable.h"
-#include "nsITimer.h"
 #include "nsHtml5String.h"
 #include "nsNameSpaceManager.h"
 #include "nsIContent.h"
 #include "nsTraceRefcnt.h"
 #include "jArray.h"
 #include "nsHtml5DocumentMode.h"
 #include "nsHtml5ArrayCopy.h"
 #include "nsHtml5Parser.h"
--- a/parser/html/nsHtml5TreeOpExecutor.cpp
+++ b/parser/html/nsHtml5TreeOpExecutor.cpp
@@ -23,17 +23,16 @@
 #include "nsError.h"
 #include "nsHtml5AutoPauseUpdate.h"
 #include "nsHtml5Parser.h"
 #include "nsHtml5StreamParser.h"
 #include "nsHtml5Tokenizer.h"
 #include "nsHtml5TreeBuilder.h"
 #include "nsHtml5TreeOpExecutor.h"
 #include "nsIContentSecurityPolicy.h"
-#include "nsIContentViewer.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsINestedURI.h"
 #include "nsIScriptContext.h"
 #include "nsIScriptError.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIViewSourceChannel.h"
 #include "nsNetUtil.h"
--- a/parser/html/nsHtml5TreeOperation.cpp
+++ b/parser/html/nsHtml5TreeOperation.cpp
@@ -24,20 +24,18 @@
 #include "nsHtml5DocumentMode.h"
 #include "nsHtml5HtmlAttributes.h"
 #include "nsHtml5SVGLoadDispatcher.h"
 #include "nsHtml5TreeBuilder.h"
 #include "nsIDTD.h"
 #include "nsIFormControl.h"
 #include "nsIMutationObserver.h"
 #include "nsINode.h"
-#include "nsIObserverService.h"
 #include "nsIProtocolHandler.h"
 #include "nsIScriptElement.h"
-#include "nsIServiceManager.h"
 #include "nsIStyleSheetLinkingElement.h"
 #include "nsISupportsImpl.h"
 #include "nsIURI.h"
 #include "nsNetUtil.h"
 #include "nsTextNode.h"
 
 using namespace mozilla;
 using mozilla::dom::Document;
--- a/parser/html/nsParserUtils.cpp
+++ b/parser/html/nsParserUtils.cpp
@@ -11,25 +11,23 @@
 #include "nsAttrName.h"
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsContentCID.h"
 #include "nsContentUtils.h"
 #include "nsEscape.h"
 #include "nsHTMLParts.h"
 #include "nsHtml5Module.h"
-#include "nsIComponentManager.h"
 #include "nsIContent.h"
 #include "nsIContentSink.h"
 #include "nsIDTD.h"
 #include "mozilla/dom/Document.h"
 #include "nsIDocumentEncoder.h"
 #include "nsIFragmentContentSink.h"
 #include "nsIParser.h"
-#include "nsISupportsPrimitives.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsParserCIID.h"
 #include "nsString.h"
 #include "nsTreeSanitizer.h"
 #include "nsXPCOM.h"
 
 #define XHTML_DIV_TAG "div xmlns=\"http://www.w3.org/1999/xhtml\""
--- a/parser/htmlparser/CParserContext.h
+++ b/parser/htmlparser/CParserContext.h
@@ -8,19 +8,17 @@
  * @update  gess 4/1/98
  *
  */
 
 #ifndef __CParserContext
 #define __CParserContext
 
 #include "nsIParser.h"
-#include "nsIURL.h"
 #include "nsIDTD.h"
-#include "nsIStreamListener.h"
 #include "nsIRequest.h"
 #include "nsScanner.h"
 #include "nsString.h"
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 
 /**
  * Note that the parser is given FULL access to all
--- a/parser/htmlparser/nsParser.cpp
+++ b/parser/htmlparser/nsParser.cpp
@@ -5,31 +5,26 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsAtom.h"
 #include "nsParser.h"
 #include "nsString.h"
 #include "nsCRT.h"
 #include "nsScanner.h"
 #include "plstr.h"
-#include "nsIStringStream.h"
 #include "nsIChannel.h"
-#include "nsICachingChannel.h"
 #include "nsIInputStream.h"
 #include "CNavDTD.h"
 #include "prenv.h"
 #include "prlock.h"
 #include "prcvar.h"
 #include "nsParserCIID.h"
 #include "nsReadableUtils.h"
 #include "nsCOMPtr.h"
 #include "nsExpatDriver.h"
-#include "nsIServiceManager.h"
-#include "nsICategoryManager.h"
-#include "nsISupportsPrimitives.h"
 #include "nsIFragmentContentSink.h"
 #include "nsStreamUtils.h"
 #include "nsHTMLTokenizer.h"
 #include "nsDataHashtable.h"
 #include "nsXPCOMCIDInternal.h"
 #include "nsMimeTypes.h"
 #include "mozilla/CondVar.h"
 #include "mozilla/Mutex.h"
--- a/parser/htmlparser/nsParser.h
+++ b/parser/htmlparser/nsParser.h
@@ -38,17 +38,16 @@
  *
  */
 
 #ifndef NS_PARSER__
 #define NS_PARSER__
 
 #include "nsIParser.h"
 #include "nsDeque.h"
-#include "nsIURL.h"
 #include "CParserContext.h"
 #include "nsParserCIID.h"
 #include "nsITokenizer.h"
 #include "nsHTMLTags.h"
 #include "nsIContentSink.h"
 #include "nsCOMArray.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsWeakReference.h"
--- a/parser/htmlparser/nsParserMsgUtils.cpp
+++ b/parser/htmlparser/nsParserMsgUtils.cpp
@@ -1,14 +1,13 @@
 /* -*- Mode: C++; tab-width: 2; 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 "nsIServiceManager.h"
 #include "nsIStringBundle.h"
 #include "nsString.h"
 #include "nsParserMsgUtils.h"
 #include "nsNetCID.h"
 #include "mozilla/Services.h"
 
 static nsresult GetBundle(const char* aPropFileName,
                           nsIStringBundle** aBundle) {
--- a/parser/htmlparser/nsScanner.cpp
+++ b/parser/htmlparser/nsScanner.cpp
@@ -8,18 +8,16 @@
 
 #include "nsScanner.h"
 
 #include "mozilla/Attributes.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Encoding.h"
 #include "nsDebug.h"
 #include "nsReadableUtils.h"
-#include "nsIInputStream.h"
-#include "nsIFile.h"
 #include "nsUTF8Utils.h"  // for LossyConvertEncoding
 #include "nsCRT.h"
 #include "nsParser.h"
 #include "nsCharsetSource.h"
 
 nsReadEndCondition::nsReadEndCondition(const char16_t* aTerminateChars)
     : mChars(aTerminateChars),
       mFilter(char16_t(~0))  // All bits set
--- a/security/apps/AppSignatureVerification.cpp
+++ b/security/apps/AppSignatureVerification.cpp
@@ -20,19 +20,17 @@
 #include "mozilla/Preferences.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/Unused.h"
 #include "nsCOMPtr.h"
 #include "nsComponentManagerUtils.h"
 #include "nsDependentString.h"
 #include "nsHashKeys.h"
-#include "nsIDirectoryEnumerator.h"
 #include "nsIFile.h"
-#include "nsIFileStreams.h"
 #include "nsIInputStream.h"
 #include "nsIStringEnumerator.h"
 #include "nsIZipReader.h"
 #include "nsNSSCertificate.h"
 #include "nsNetUtil.h"
 #include "nsProxyRelease.h"
 #include "nsString.h"
 #include "nsTHashtable.h"
--- a/security/apps/AppTrustDomain.h
+++ b/security/apps/AppTrustDomain.h
@@ -4,17 +4,16 @@
  * 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 AppTrustDomain_h
 #define AppTrustDomain_h
 
 #include "mozpkix/pkixtypes.h"
 #include "nsDebug.h"
-#include "nsIX509CertDB.h"
 #include "ScopedNSSTypes.h"
 
 namespace mozilla {
 namespace psm {
 
 class AppTrustDomain final : public mozilla::pkix::TrustDomain {
  public:
   typedef mozilla::pkix::Result Result;
--- a/security/certverifier/tests/gtest/TrustOverrideTest.cpp
+++ b/security/certverifier/tests/gtest/TrustOverrideTest.cpp
@@ -2,16 +2,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 "gtest/gtest.h"
 #include "nsCOMPtr.h"
 #include "nsIPrefService.h"
 #include "nsIX509Cert.h"
+#include "nsIX509CertDB.h"
 #include "nsServiceManagerUtils.h"
 #include "TrustOverrideUtils.h"
 
 // certspec (for pycert.py)
 //
 // issuer:ca
 // subject:ca
 // extension:basicConstraints:cA,
--- a/security/manager/pki/nsASN1Tree.h
+++ b/security/manager/pki/nsASN1Tree.h
@@ -1,20 +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/. */
 #ifndef _NSSASNTREE_H_
 #define _NSSASNTREE_H_
 
 #include "nscore.h"
-#include "nsIX509Cert.h"
 #include "nsIASN1Tree.h"
 #include "nsIASN1Object.h"
 #include "nsIASN1Sequence.h"
-#include "nsITreeView.h"
 #include "nsITreeSelection.h"
 #include "nsCOMPtr.h"
 
 /* Disable the "base class XXX should be explicitly initialized
    in the copy constructor" warning. */
 #if defined(__clang__)
 #  pragma clang diagnostic push
 #  pragma clang diagnostic ignored "-Wextra"
--- a/security/manager/pki/nsNSSDialogHelper.cpp
+++ b/security/manager/pki/nsNSSDialogHelper.cpp
@@ -3,17 +3,16 @@
  * 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 "nsNSSDialogHelper.h"
 
 #include "mozilla/dom/ScriptSettings.h"
 #include "nsCOMPtr.h"
-#include "nsIServiceManager.h"
 #include "nsIWindowWatcher.h"
 
 static const char kOpenDialogParam[] = "centerscreen,chrome,modal,titlebar";
 static const char kOpenWindowParam[] = "centerscreen,chrome,titlebar";
 
 nsresult nsNSSDialogHelper::openDialog(mozIDOMWindowProxy* window,
                                        const char* url, nsISupports* params,
                                        bool modal) {
--- a/security/manager/ssl/CSTrustDomain.h
+++ b/security/manager/ssl/CSTrustDomain.h
@@ -11,17 +11,16 @@
 #include "mozilla/StaticMutex.h"
 #include "mozilla/UniquePtr.h"
 #include "nsDebug.h"
 #ifdef MOZ_NEW_CERT_STORAGE
 #  include "nsICertStorage.h"
 #else
 #  include "nsICertBlocklist.h"
 #endif
-#include "nsIX509CertDB.h"
 #include "ScopedNSSTypes.h"
 
 namespace mozilla {
 namespace psm {
 
 class CSTrustDomain final : public mozilla::pkix::TrustDomain {
  public:
   typedef mozilla::pkix::Result Result;
--- a/security/manager/ssl/CertBlocklist.cpp
+++ b/security/manager/ssl/CertBlocklist.cpp
@@ -15,17 +15,16 @@
 #include "mozilla/Unused.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsDependentString.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsICryptoHash.h"
 #include "nsIFileStreams.h"
 #include "nsILineInputStream.h"
 #include "nsISafeOutputStream.h"
-#include "nsIX509Cert.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsPromiseFlatString.h"
 #include "nsTHashtable.h"
 #include "nsThreadUtils.h"
 #include "mozpkix/Input.h"
 #include "prtime.h"
 
--- a/security/manager/ssl/CertBlocklist.h
+++ b/security/manager/ssl/CertBlocklist.h
@@ -5,18 +5,16 @@
 
 #ifndef CertBlocklist_h
 #define CertBlocklist_h
 
 #include "mozilla/Mutex.h"
 #include "nsCOMPtr.h"
 #include "nsClassHashtable.h"
 #include "nsICertBlocklist.h"
-#include "nsIOutputStream.h"
-#include "nsIX509CertDB.h"
 #include "nsString.h"
 #include "nsTHashtable.h"
 #include "mozpkix/Input.h"
 
 #define NS_CERT_BLOCKLIST_CID                        \
   {                                                  \
     0x11aefd53, 0x2fbb, 0x4c92, {                    \
       0xa0, 0xc1, 0x05, 0x32, 0x12, 0xae, 0x42, 0xd0 \
--- a/security/manager/ssl/NSSErrorsService.cpp
+++ b/security/manager/ssl/NSSErrorsService.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 "NSSErrorsService.h"
 
+#include "nsIStringBundle.h"
 #include "nsNSSComponent.h"
 #include "nsServiceManagerUtils.h"
 #include "mozpkix/pkixnss.h"
 #include "secerr.h"
 #include "sslerr.h"
 
 #define PIPNSS_STRBUNDLE_URL "chrome://pipnss/locale/pipnss.properties"
 #define NSSERR_STRBUNDLE_URL "chrome://pipnss/locale/nsserrors.properties"
--- a/security/manager/ssl/NSSErrorsService.h
+++ b/security/manager/ssl/NSSErrorsService.h
@@ -10,16 +10,18 @@
 #include "nsCOMPtr.h"
 #ifdef MOZ_NEW_CERT_STORAGE
 #  include "nsILineInputStream.h"
 #  include "nsISafeOutputStream.h"
 #endif
 #include "nsIStringBundle.h"
 #include "prerror.h"
 
+class nsIStringBundle;
+
 namespace mozilla {
 namespace psm {
 
 class NSSErrorsService final : public nsINSSErrorsService {
   NS_DECL_ISUPPORTS
   NS_DECL_NSINSSERRORSSERVICE
 
  public:
--- a/security/manager/ssl/OSKeyStore.cpp
+++ b/security/manager/ssl/OSKeyStore.cpp
@@ -3,17 +3,16 @@
  * 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 "OSKeyStore.h"
 
 #include "mozilla/Base64.h"
 #include "mozilla/dom/Promise.h"
-#include "nsIRandomGenerator.h"
 #include "nsXPCOM.h"
 #include "pk11pub.h"
 
 #if defined(XP_MACOSX)
 #  include "KeychainSecret.h"
 #elif defined(XP_WIN)
 #  include "CredentialManagerSecret.h"
 #elif defined(MOZ_WIDGET_GTK)
--- a/security/manager/ssl/PSMContentListener.cpp
+++ b/security/manager/ssl/PSMContentListener.cpp
@@ -15,17 +15,16 @@
 #include "mozilla/net/ChannelDiverterParent.h"
 #include "nsDependentString.h"
 #include "nsIChannel.h"
 #include "nsIDivertableChannel.h"
 #include "nsIInputStream.h"
 #include "nsIStreamListener.h"
 #include "nsIURI.h"
 #include "nsIX509CertDB.h"
-#include "nsIXULAppInfo.h"
 #include "nsNSSHelper.h"
 #include "nsNetUtil.h"
 #include "nsPromiseFlatString.h"
 
 extern mozilla::LazyLogModule gPIPNSSLog;
 
 namespace mozilla {
 namespace psm {
--- a/security/manager/ssl/SecretDecoderRing.cpp
+++ b/security/manager/ssl/SecretDecoderRing.cpp
@@ -11,17 +11,16 @@
 #include "mozilla/Casting.h"
 #include "mozilla/Services.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/dom/Promise.h"
 #include "nsCOMPtr.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIObserverService.h"
-#include "nsIServiceManager.h"
 #include "nsITokenPasswordDialogs.h"
 #include "nsNSSComponent.h"
 #include "nsNSSHelper.h"
 #include "nsNetCID.h"
 #include "nsPK11TokenDB.h"
 #include "pk11func.h"
 #include "pk11sdr.h"  // For PK11SDR_Encrypt, PK11SDR_Decrypt
 #include "ssl.h"      // For SSL_ClearSessionCache
--- a/security/manager/ssl/TransportSecurityInfo.cpp
+++ b/security/manager/ssl/TransportSecurityInfo.cpp
@@ -6,22 +6,20 @@
 
 #include "TransportSecurityInfo.h"
 
 #include "DateTimeFormat.h"
 #include "PSMRunnable.h"
 #include "ipc/IPCMessageUtils.h"
 #include "mozilla/Casting.h"
 #include "nsComponentManagerUtils.h"
-#include "nsIArray.h"
 #include "nsICertOverrideService.h"
 #include "nsIObjectInputStream.h"
 #include "nsIObjectOutputStream.h"
 #include "nsIWebProgressListener.h"
-#include "nsIX509CertValidity.h"
 #include "nsNSSCertHelper.h"
 #include "nsNSSCertificate.h"
 #include "nsNSSComponent.h"
 #include "nsNSSHelper.h"
 #include "nsReadableUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsXULAppAPI.h"
 #include "mozpkix/pkixtypes.h"
--- a/security/manager/ssl/nsCertTree.h
+++ b/security/manager/ssl/nsCertTree.h
@@ -1,25 +1,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 _NS_CERTTREE_H_
 #define _NS_CERTTREE_H_
 
 #include "nsCOMPtr.h"
-#include "nsIServiceManager.h"
 #include "nsICertTree.h"
-#include "nsITreeView.h"
 #include "nsITreeSelection.h"
 #include "nsIMutableArray.h"
 #include "nsNSSComponent.h"
 #include "nsTArray.h"
 #include "PLDHashTable.h"
-#include "nsIX509CertDB.h"
 #include "nsCertOverrideService.h"
 #include "mozilla/Attributes.h"
 
 /* Disable the "base class XXX should be explicitly initialized
    in the copy constructor" warning. */
 #if defined(__clang__)
 #  pragma clang diagnostic push
 #  pragma clang diagnostic ignored "-Wextra"
--- a/security/manager/ssl/nsClientAuthRemember.cpp
+++ b/security/manager/ssl/nsClientAuthRemember.cpp
@@ -1,24 +1,22 @@
 /* -*- Mode: C++; tab-width: 2; 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 "nsClientAuthRemember.h"
 
-#include "nsIX509Cert.h"
 #include "mozilla/BasePrincipal.h"
 #include "mozilla/RefPtr.h"
 #include "nsCRT.h"
 #include "nsNSSCertHelper.h"
 #include "nsIObserverService.h"
 #include "nsNetUtil.h"
-#include "nsISupportsPrimitives.h"
 #include "nsPromiseFlatString.h"
 #include "nsThreadUtils.h"
 #include "nsStringBuffer.h"
 #include "cert.h"
 #include "nspr.h"
 #include "pk11pub.h"
 #include "certdb.h"
 #include "sechash.h"
--- a/security/manager/ssl/nsClientAuthRemember.h
+++ b/security/manager/ssl/nsClientAuthRemember.h
@@ -7,17 +7,16 @@
 #ifndef __NSCLIENTAUTHREMEMBER_H__
 #define __NSCLIENTAUTHREMEMBER_H__
 
 #include "mozilla/HashFunctions.h"
 #include "mozilla/Move.h"
 #include "mozilla/ReentrantMonitor.h"
 #include "nsTHashtable.h"
 #include "nsIObserver.h"
-#include "nsIX509Cert.h"
 #include "nsNSSCertificate.h"
 #include "nsString.h"
 #include "nsWeakReference.h"
 #include "mozilla/Attributes.h"
 
 namespace mozilla {
 class OriginAttributes;
 }
--- a/security/manager/ssl/nsNSSASN1Object.cpp
+++ b/security/manager/ssl/nsNSSASN1Object.cpp
@@ -1,16 +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 "nsNSSASN1Object.h"
 
 #include "nsArray.h"
 #include "nsArrayUtils.h"
-#include "nsIComponentManager.h"
 #include "nsReadableUtils.h"
 #include "nsXPCOMCID.h"
 #include "secasn1.h"
 
 NS_IMPL_ISUPPORTS(nsNSSASN1Sequence, nsIASN1Sequence, nsIASN1Object)
 NS_IMPL_ISUPPORTS(nsNSSASN1PrintableItem, nsIASN1PrintableItem, nsIASN1Object)
 
 // This function is used to interpret an integer that
--- a/security/manager/ssl/nsNSSCallbacks.cpp
+++ b/security/manager/ssl/nsNSSCallbacks.cpp
@@ -13,17 +13,16 @@
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/Casting.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/Span.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/Unused.h"
 #include "nsContentUtils.h"
-#include "nsICertOverrideService.h"
 #include "nsIHttpChannelInternal.h"
 #include "nsIPrompt.h"
 #include "nsIProtocolProxyService.h"
 #include "nsISupportsPriority.h"
 #include "nsIStreamLoader.h"
 #include "nsITokenDialogs.h"
 #include "nsIUploadChannel.h"
 #include "nsIWebProgressListener.h"
--- a/security/manager/ssl/nsNSSCertificate.cpp
+++ b/security/manager/ssl/nsNSSCertificate.cpp
@@ -15,22 +15,19 @@
 #include "mozilla/Casting.h"
 #include "mozilla/ipc/TransportSecurityInfoUtils.h"
 #include "mozilla/NotNull.h"
 #include "mozilla/Span.h"
 #include "mozilla/TextUtils.h"
 #include "mozilla/Unused.h"
 #include "nsArray.h"
 #include "nsCOMPtr.h"
-#include "nsICertificateDialogs.h"
 #include "nsIClassInfoImpl.h"
 #include "nsIObjectInputStream.h"
 #include "nsIObjectOutputStream.h"
-#include "nsISupportsPrimitives.h"
-#include "nsIURI.h"
 #include "nsIX509Cert.h"
 #include "nsNSSASN1Object.h"
 #include "nsNSSCertHelper.h"
 #include "nsNSSCertTrust.h"
 #include "nsNSSCertValidity.h"
 #include "nsPK11TokenDB.h"
 #include "nsPKCS12Blob.h"
 #include "nsProxyRelease.h"
--- a/security/manager/ssl/nsNSSCertificate.h
+++ b/security/manager/ssl/nsNSSCertificate.h
@@ -11,17 +11,16 @@
 
 #include "ScopedNSSTypes.h"
 #include "certt.h"
 #include "nsCOMPtr.h"
 #include "nsIASN1Object.h"
 #include "nsIClassInfo.h"
 #include "nsISerializable.h"
 #include "nsIX509Cert.h"
-#include "nsIX509CertDB.h"
 #include "nsSimpleEnumerator.h"
 #include "nsStringFwd.h"
 
 namespace mozilla {
 namespace pkix {
 class DERArray;
 }
 }  // namespace mozilla
--- a/security/manager/ssl/nsNSSCertificateDB.cpp
+++ b/security/manager/ssl/nsNSSCertificateDB.cpp
@@ -21,18 +21,16 @@
 #include "nsArray.h"
 #include "nsArrayUtils.h"
 #include "nsCOMPtr.h"
 #include "nsComponentManagerUtils.h"
 #include "nsICertificateDialogs.h"
 #include "nsIFile.h"
 #include "nsIMutableArray.h"
 #include "nsIObserverService.h"
-#include "nsIPrefBranch.h"
-#include "nsIPrefService.h"
 #include "nsIPrompt.h"
 #include "nsNSSCertHelper.h"
 #include "nsNSSCertTrust.h"
 #include "nsNSSCertificate.h"
 #include "nsNSSComponent.h"
 #include "nsNSSHelper.h"
 #include "nsPKCS12Blob.h"
 #include "nsPromiseFlatString.h"
--- a/security/manager/ssl/nsNSSComponent.cpp
+++ b/security/manager/ssl/nsNSSComponent.cpp
@@ -33,17 +33,16 @@
 #include "nsComponentManagerUtils.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsICertOverrideService.h"
 #include "nsIFile.h"
 #include "nsILocalFileWin.h"
 #include "nsIObserverService.h"
 #include "nsIPrompt.h"
 #include "nsIProperties.h"
-#include "nsISiteSecurityService.h"
 #include "nsITokenPasswordDialogs.h"
 #include "nsIWindowWatcher.h"
 #include "nsIXULRuntime.h"
 #include "nsLiteralString.h"
 #include "nsNSSCertificateDB.h"
 #include "nsNSSHelper.h"
 #include "nsNetCID.h"
 #include "nsPK11TokenDB.h"
--- a/security/manager/ssl/nsNSSIOLayer.cpp
+++ b/security/manager/ssl/nsNSSIOLayer.cpp
@@ -25,18 +25,16 @@
 #include "mozilla/Telemetry.h"
 #include "nsArray.h"
 #include "nsArrayUtils.h"
 #include "nsCRT.h"
 #include "nsCharSeparatedTokenizer.h"
 #include "nsClientAuthRemember.h"
 #include "nsContentUtils.h"
 #include "nsIClientAuthDialogs.h"
-#include "nsIConsoleService.h"
-#include "nsIPrefService.h"
 #include "nsISocketProvider.h"
 #include "nsIWebProgressListener.h"
 #include "nsNSSCertHelper.h"
 #include "nsNSSComponent.h"
 #include "nsNSSHelper.h"
 #include "nsPrintfCString.h"
 #include "nsServiceManagerUtils.h"
 #include "mozpkix/pkixnss.h"
--- a/security/manager/ssl/nsNSSIOLayer.h
+++ b/security/manager/ssl/nsNSSIOLayer.h
@@ -8,17 +8,16 @@
 #define nsNSSIOLayer_h
 
 #include "CommonSocketControl.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/UniquePtr.h"
 #include "nsCOMPtr.h"
 #include "nsDataHashtable.h"
-#include "nsIClientAuthDialogs.h"
 #include "nsIProxyInfo.h"
 #include "nsISSLSocketControl.h"
 #include "nsNSSCertificate.h"
 #include "nsTHashtable.h"
 #include "sslt.h"
 
 namespace mozilla {
 class OriginAttributes;
--- a/security/manager/ssl/nsNSSModule.cpp
+++ b/security/manager/ssl/nsNSSModule.cpp
@@ -18,17 +18,16 @@
 #include "SecretDecoderRing.h"
 #include "TransportSecurityInfo.h"
 #include "mozilla/MacroArgs.h"
 #include "mozilla/ModuleUtils.h"
 #include "mozilla/SyncRunnable.h"
 #include "nsCURILoader.h"
 #include "nsCertOverrideService.h"
 #include "nsCryptoHash.h"
-#include "nsICategoryManager.h"
 #include "nsKeyModule.h"
 #include "nsNSSCertificate.h"
 #include "nsNSSCertificateDB.h"
 #include "nsNSSComponent.h"
 #include "nsNSSVersion.h"
 #include "nsNetCID.h"
 #include "nsPK11TokenDB.h"
 #include "nsPKCS11Slot.h"
--- a/security/manager/ssl/nsPKCS12Blob.cpp
+++ b/security/manager/ssl/nsPKCS12Blob.cpp
@@ -3,21 +3,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsPKCS12Blob.h"
 
 #include "ScopedNSSTypes.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/Casting.h"
 #include "mozilla/Unused.h"
-#include "nsICertificateDialogs.h"
 #include "nsIFile.h"
 #include "nsIInputStream.h"
-#include "nsIPrompt.h"
-#include "nsIWindowWatcher.h"
 #include "nsIX509CertDB.h"
 #include "nsNSSCertHelper.h"
 #include "nsNSSCertificate.h"
 #include "nsNSSHelper.h"
 #include "nsNetUtil.h"
 #include "nsReadableUtils.h"
 #include "nsTArray.h"
 #include "nsThreadUtils.h"
--- a/security/manager/ssl/nsPKCS12Blob.h
+++ b/security/manager/ssl/nsPKCS12Blob.h
@@ -6,17 +6,16 @@
 
 #ifndef nsPKCS12Blob_h
 #define nsPKCS12Blob_h
 
 #include "mozilla/RefPtr.h"
 #include "mozilla/UniquePtr.h"
 #include "nsCOMPtr.h"
 #include "nsIInterfaceRequestor.h"
-#include "nsIMutableArray.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "p12.h"
 #include "prerror.h"
 #include "ScopedNSSTypes.h"
 #include "seccomon.h"
 
 class nsIFile;
--- a/security/manager/ssl/tests/gtest/CertDBTest.cpp
+++ b/security/manager/ssl/tests/gtest/CertDBTest.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; 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 "gtest/gtest.h"
 #include "nsCOMPtr.h"
 #include "nsIPrefService.h"
-#include "nsISimpleEnumerator.h"
 #include "nsIX509Cert.h"
 #include "nsIX509CertDB.h"
 #include "nsServiceManagerUtils.h"
 
 TEST(psm_CertDB, Test)
 {
   {
     nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
--- a/security/manager/ssl/tests/gtest/CertListTest.cpp
+++ b/security/manager/ssl/tests/gtest/CertListTest.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; 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 "gtest/gtest.h"
 #include "nsCOMPtr.h"
 #include "nsIPrefService.h"
-#include "nsISimpleEnumerator.h"
 #include "nsIX509Cert.h"
 #include "nsIX509CertDB.h"
 #include "nsNSSCertificate.h"
 #include "nsServiceManagerUtils.h"
 #include "nsString.h"
 
 // certspec (for pycert.py)
 //
--- a/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp
+++ b/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp
@@ -22,16 +22,17 @@
 #include "nsThreadUtils.h"
 #include "nsXULAppAPI.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "SpecialSystemDirectory.h"
 #include "nsReadableUtils.h"
 #include "nsIFileStreams.h"
 #include "nsILineInputStream.h"
+
 #include "nsNetCID.h"
 
 #ifdef ANDROID
 #  include "cutils/properties.h"
 #endif
 
 #ifdef MOZ_WIDGET_GTK
 #  include <glib.h>
--- a/security/sandbox/win/src/remotesandboxbroker/RemoteSandboxBrokerProcessParent.cpp
+++ b/security/sandbox/win/src/remotesandboxbroker/RemoteSandboxBrokerProcessParent.cpp
@@ -1,16 +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 https://mozilla.org/MPL/2.0/. */
 
 #include "RemoteSandboxBrokerProcessParent.h"
-#include "nsIRunnable.h"
 #include <windows.h>
 
 using mozilla::ipc::GeckoChildProcessHost;
 using mozilla::ipc::LaunchError;
 using mozilla::ipc::ProcessHandlePromise;
 
 namespace mozilla {
 
--- a/startupcache/StartupCache.cpp
+++ b/startupcache/StartupCache.cpp
@@ -18,25 +18,19 @@
 #include "nsAutoPtr.h"
 #include "nsClassHashtable.h"
 #include "nsComponentManagerUtils.h"
 #include "nsCRT.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsIClassInfo.h"
 #include "nsIFile.h"
 #include "nsIObserver.h"
-#include "nsIObserverService.h"
 #include "nsIOutputStream.h"
-#include "nsIStorageStream.h"
-#include "nsIStreamBufferAccess.h"
-#include "nsIStringStream.h"
 #include "nsISupports.h"
 #include "nsITimer.h"
-#include "nsIZipWriter.h"
-#include "nsIZipReader.h"
 #include "nsZipArchive.h"
 #include "mozilla/Omnijar.h"
 #include "prenv.h"
 #include "mozilla/Telemetry.h"
 #include "nsThreadUtils.h"
 #include "nsXULAppAPI.h"
 #include "nsIProtocolHandler.h"
 #include "GeckoProfiler.h"
--- a/startupcache/StartupCache.h
+++ b/startupcache/StartupCache.h
@@ -10,17 +10,16 @@
 #include "nsComponentManagerUtils.h"
 #include "nsTArray.h"
 #include "nsZipArchive.h"
 #include "nsITimer.h"
 #include "nsIMemoryReporter.h"
 #include "nsIObserverService.h"
 #include "nsIObserver.h"
 #include "nsIObjectOutputStream.h"
-#include "nsIOutputStream.h"
 #include "nsIFile.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/AutoMemMap.h"
 #include "mozilla/Compression.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/Pair.h"
 #include "mozilla/Result.h"
 #include "mozilla/UniquePtr.h"
--- a/startupcache/StartupCacheUtils.cpp
+++ b/startupcache/StartupCacheUtils.cpp
@@ -1,15 +1,14 @@
 /* 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 "nsCOMPtr.h"
 #include "nsIInputStream.h"
-#include "nsIStringStream.h"
 #include "nsNetUtil.h"
 #include "nsIFileURL.h"
 #include "nsIJARURI.h"
 #include "nsIResProtocolHandler.h"
 #include "nsIChromeRegistry.h"
 #include "nsAutoPtr.h"
 #include "nsStringStream.h"
 #include "StartupCacheUtils.h"
--- a/startupcache/test/TestStartupCache.cpp
+++ b/startupcache/test/TestStartupCache.cpp
@@ -4,29 +4,22 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "gtest/gtest.h"
 
 #include "mozilla/scache/StartupCache.h"
 #include "mozilla/scache/StartupCacheUtils.h"
 
 #include "nsDirectoryServiceDefs.h"
-#include "nsIClassInfo.h"
 #include "nsIOutputStream.h"
-#include "nsIObserver.h"
-#include "nsISerializable.h"
 #include "nsISupports.h"
-#include "nsIStringStream.h"
 #include "nsIStorageStream.h"
 #include "nsIObjectInputStream.h"
 #include "nsIObjectOutputStream.h"
 #include "nsIURI.h"
-#include "nsIPrefBranch.h"
-#include "nsIPrefService.h"
-#include "nsIXPConnect.h"
 #include "nsThreadUtils.h"
 #include "prenv.h"
 #include "prio.h"
 #include "prprf.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/Printf.h"
 #include "mozilla/UniquePtr.h"
 #include "nsNetCID.h"
--- a/storage/FileSystemModule.cpp
+++ b/storage/FileSystemModule.cpp
@@ -2,16 +2,17 @@
  * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
  * 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 "FileSystemModule.h"
 
 #include "sqlite3.h"
+#include "nsComponentManagerUtils.h"
 #include "nsString.h"
 #include "nsIDirectoryEnumerator.h"
 #include "nsIFile.h"
 
 namespace {
 
 struct VirtualTableCursorBase {
   VirtualTableCursorBase() { memset(&mBase, 0, sizeof(mBase)); }
--- a/storage/VacuumManager.h
+++ b/storage/VacuumManager.h
@@ -4,17 +4,16 @@
  * 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_storage_VacuumManager_h__
 #define mozilla_storage_VacuumManager_h__
 
 #include "nsCOMPtr.h"
 #include "nsIObserver.h"
-#include "mozIStorageStatementCallback.h"
 #include "mozIStorageVacuumParticipant.h"
 #include "nsCategoryCache.h"
 #include "mozilla/Attributes.h"
 
 namespace mozilla {
 namespace storage {
 
 class VacuumManager final : public nsIObserver {
--- a/storage/mozStorageAsyncStatement.cpp
+++ b/storage/mozStorageAsyncStatement.cpp
@@ -9,18 +9,16 @@
 
 #include "nsError.h"
 #include "nsMemory.h"
 #include "nsProxyRelease.h"
 #include "nsThreadUtils.h"
 #include "nsIClassInfoImpl.h"
 #include "Variant.h"
 
-#include "mozIStorageError.h"
-
 #include "mozStorageBindingParams.h"
 #include "mozStorageConnection.h"
 #include "mozStorageAsyncStatementJSHelper.h"
 #include "mozStorageAsyncStatementParams.h"
 #include "mozStoragePrivateHelpers.h"
 #include "mozStorageStatementRow.h"
 #include "mozStorageStatement.h"
 
--- a/storage/mozStorageAsyncStatementJSHelper.h
+++ b/storage/mozStorageAsyncStatementJSHelper.h
@@ -3,17 +3,16 @@
  * 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_storage_mozStorageAsyncStatementJSHelper_h_
 #define mozilla_storage_mozStorageAsyncStatementJSHelper_h_
 
 #include "nsIXPCScriptable.h"
-#include "nsIXPConnect.h"
 
 namespace mozilla {
 namespace storage {
 
 class AsyncStatement;
 class AsyncStatementParams;
 
 /**
--- a/storage/mozStorageConnection.cpp
+++ b/storage/mozStorageConnection.cpp
@@ -2,22 +2,21 @@
  * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
  * 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 <stdio.h>
 
 #include "nsError.h"
-#include "nsIMutableArray.h"
 #include "nsAutoPtr.h"
-#include "nsIMemoryReporter.h"
 #include "nsThreadUtils.h"
 #include "nsIFile.h"
 #include "nsIFileURL.h"
+#include "nsIXPConnect.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/Mutex.h"
 #include "mozilla/CondVar.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/ErrorNames.h"
 #include "mozilla/Unused.h"
 #include "mozilla/dom/quota/QuotaObject.h"
 #include "mozilla/ScopeExit.h"
--- a/storage/mozStorageConnection.h
+++ b/storage/mozStorageConnection.h
@@ -18,17 +18,16 @@
 #include "nsDataHashtable.h"
 #include "mozIStorageProgressHandler.h"
 #include "SQLiteMutex.h"
 #include "mozIStorageConnection.h"
 #include "mozStorageService.h"
 #include "mozIStorageAsyncConnection.h"
 #include "mozIStorageCompletionCallback.h"
 
-#include "nsIMutableArray.h"
 #include "mozilla/Attributes.h"
 
 #include "sqlite3.h"
 
 class nsIFile;
 class nsIFileURL;
 class nsIEventTarget;
 class nsIThread;
--- a/storage/mozStorageHelper.h
+++ b/storage/mozStorageHelper.h
@@ -4,25 +4,21 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef MOZSTORAGEHELPER_H
 #define MOZSTORAGEHELPER_H
 
 #include "nsAutoPtr.h"
 #include "nsString.h"
 #include "mozilla/DebugOnly.h"
-#include "nsIConsoleService.h"
-#include "nsIScriptError.h"
 
-#include "mozIStorageAsyncConnection.h"
 #include "mozIStorageConnection.h"
 #include "mozIStorageStatement.h"
 #include "mozIStoragePendingStatement.h"
 #include "nsError.h"
-#include "nsIXPConnect.h"
 
 /**
  * This class wraps a transaction inside a given C++ scope, guaranteeing that
  * the transaction will be completed even if you have an exception or
  * return early.
  *
  * A common use is to create an instance with aCommitOnComplete = false
  * (rollback), then call Commit() on this object manually when your function
--- a/storage/mozStoragePrivateHelpers.cpp
+++ b/storage/mozStoragePrivateHelpers.cpp
@@ -14,19 +14,17 @@
 #include "mozilla/Mutex.h"
 #include "mozilla/CondVar.h"
 #include "nsQueryObject.h"
 #include "nsThreadUtils.h"
 #include "nsJSUtils.h"
 
 #include "Variant.h"
 #include "mozStoragePrivateHelpers.h"
-#include "mozIStorageStatement.h"
 #include "mozIStorageCompletionCallback.h"
-#include "mozIStorageBindingParams.h"
 
 #include "mozilla/Logging.h"
 extern mozilla::LazyLogModule gStorageLog;
 
 namespace mozilla {
 namespace storage {
 
 nsresult convertResultCode(int aSQLiteResultCode) {
--- a/storage/mozStorageService.cpp
+++ b/storage/mozStorageService.cpp
@@ -6,21 +6,21 @@
 
 #include "mozilla/Attributes.h"
 #include "mozilla/DebugOnly.h"
 
 #include "mozStorageService.h"
 #include "mozStorageConnection.h"
 #include "nsAutoPtr.h"
 #include "nsCollationCID.h"
+#include "nsComponentManagerUtils.h"
 #include "nsEmbedCID.h"
 #include "nsExceptionHandler.h"
 #include "nsThreadUtils.h"
 #include "mozStoragePrivateHelpers.h"
-#include "nsIXPConnect.h"
 #include "nsIObserverService.h"
 #include "nsIPropertyBag2.h"
 #include "mozilla/Services.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/LateWriteChecks.h"
 #include "mozIStorageCompletionCallback.h"
 #include "mozIStoragePendingStatement.h"
 
--- a/storage/mozStorageStatementData.h
+++ b/storage/mozStorageStatementData.h
@@ -6,21 +6,19 @@
 
 #ifndef mozStorageStatementData_h
 #define mozStorageStatementData_h
 
 #include "sqlite3.h"
 
 #include "nsAutoPtr.h"
 #include "nsTArray.h"
-#include "nsIEventTarget.h"
 #include "MainThreadUtils.h"
 
 #include "mozStorageBindingParamsArray.h"
-#include "mozIStorageBaseStatement.h"
 #include "mozStorageConnection.h"
 #include "StorageBaseStatementInternal.h"
 
 struct sqlite3_stmt;
 
 namespace mozilla {
 namespace storage {
 
--- a/storage/mozStorageStatementJSHelper.h
+++ b/storage/mozStorageStatementJSHelper.h
@@ -3,17 +3,16 @@
  * 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 MOZSTORAGESTATEMENTJSHELPER_H
 #define MOZSTORAGESTATEMENTJSHELPER_H
 
 #include "nsIXPCScriptable.h"
-#include "nsIXPConnect.h"
 
 class Statement;
 
 namespace mozilla {
 namespace storage {
 
 class StatementParams;
 class StatementRow;
--- a/storage/storage.h
+++ b/storage/storage.h
@@ -6,33 +6,18 @@
 
 #ifndef mozilla_storage_h_
 #define mozilla_storage_h_
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Public Interfaces
 
 #include "mozStorageCID.h"
-#include "mozIStorageAggregateFunction.h"
-#include "mozIStorageConnection.h"
-#include "mozIStorageError.h"
-#include "mozIStorageFunction.h"
-#include "mozIStoragePendingStatement.h"
-#include "mozIStorageProgressHandler.h"
-#include "mozIStorageResultSet.h"
-#include "mozIStorageRow.h"
-#include "mozIStorageService.h"
 #include "mozIStorageStatement.h"
-#include "mozIStorageStatementCallback.h"
-#include "mozIStorageBindingParamsArray.h"
 #include "mozIStorageBindingParams.h"
-#include "mozIStorageVacuumParticipant.h"
-#include "mozIStorageCompletionCallback.h"
-#include "mozIStorageAsyncStatement.h"
-#include "mozIStorageAsyncConnection.h"
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Native Language Helpers
 
 #include "mozStorageHelper.h"
 #include "mozilla/storage/StatementCache.h"
 #include "mozilla/storage/Variant.h"
 
--- a/storage/test/gtest/storage_test_harness.h
+++ b/storage/test/gtest/storage_test_harness.h
@@ -6,16 +6,17 @@
 
 #ifndef storage_test_harness_h__
 #define storage_test_harness_h__
 
 #include "gtest/gtest.h"
 
 #include "prthread.h"
 #include "nsAppDirectoryServiceDefs.h"
+#include "nsComponentManagerUtils.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsMemory.h"
 #include "nsServiceManagerUtils.h"
 #include "nsThreadUtils.h"
 #include "mozilla/ReentrantMonitor.h"
 
 #include "mozIStorageService.h"
--- a/storage/test/gtest/test_AsXXX_helpers.cpp
+++ b/storage/test/gtest/test_AsXXX_helpers.cpp
@@ -1,16 +1,17 @@
 /*
  *Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 #include "storage_test_harness.h"
 #include "mozIStorageRow.h"
 #include "mozIStorageResultSet.h"
+#include "nsComponentManagerUtils.h"
 
 /**
  * This file tests AsXXX (AsInt32, AsInt64, ...) helpers.
  */
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Event Loop Spinning
 
--- a/storage/test/gtest/test_asyncStatementExecution_transaction.cpp
+++ b/storage/test/gtest/test_asyncStatementExecution_transaction.cpp
@@ -1,14 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 #include "storage_test_harness.h"
 
-#include "nsIEventTarget.h"
 #include "mozStorageConnection.h"
 
 #include "sqlite3.h"
 
 using namespace mozilla;
 using namespace mozilla::storage;
 
 ////////////////////////////////////////////////////////////////////////////////
--- a/storage/test/gtest/test_async_callbacks_with_spun_event_loops.cpp
+++ b/storage/test/gtest/test_async_callbacks_with_spun_event_loops.cpp
@@ -1,14 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 #include "storage_test_harness.h"
 #include "prthread.h"
-#include "nsIEventTarget.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "mozilla/Attributes.h"
 
 #include "sqlite3.h"
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Async Helpers
 
--- a/toolkit/components/alerts/nsAlertsService.cpp
+++ b/toolkit/components/alerts/nsAlertsService.cpp
@@ -7,17 +7,16 @@
 #include "mozilla/dom/PermissionMessageUtils.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Telemetry.h"
 #include "nsXULAppAPI.h"
 
 #include "nsAlertsService.h"
 
 #include "nsXPCOM.h"
-#include "nsIServiceManager.h"
 #include "nsPromiseFlatString.h"
 #include "nsToolkitCompsCID.h"
 
 #ifdef MOZ_PLACES
 #  include "nsIFaviconService.h"
 #endif  // MOZ_PLACES
 
 #ifdef XP_WIN
--- a/toolkit/components/alerts/nsAlertsUtils.cpp
+++ b/toolkit/components/alerts/nsAlertsUtils.cpp
@@ -1,17 +1,16 @@
 /* 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 "nsAlertsUtils.h"
 
 #include "nsCOMPtr.h"
 #include "nsContentUtils.h"
-#include "nsIStringBundle.h"
 #include "nsIURI.h"
 #include "nsString.h"
 
 /* static */
 bool nsAlertsUtils::IsActionablePrincipal(nsIPrincipal* aPrincipal) {
   return aPrincipal &&
          !nsContentUtils::IsSystemOrExpandedPrincipal(aPrincipal) &&
          !aPrincipal->GetIsNullPrincipal();
--- a/toolkit/components/alerts/nsXULAlerts.cpp
+++ b/toolkit/components/alerts/nsXULAlerts.cpp
@@ -7,17 +7,16 @@
 
 #include "nsArray.h"
 #include "nsComponentManagerUtils.h"
 #include "nsCOMPtr.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/dom/Notification.h"
 #include "mozilla/Unused.h"
-#include "nsIServiceManager.h"
 #include "nsISupportsPrimitives.h"
 #include "nsPIDOMWindow.h"
 #include "nsIWindowWatcher.h"
 
 using namespace mozilla;
 
 #define ALERT_CHROME_URL "chrome://global/content/alerts/alert.xul"
 
--- a/toolkit/components/antitracking/AntiTrackingCommon.cpp
+++ b/toolkit/components/antitracking/AntiTrackingCommon.cpp
@@ -21,25 +21,23 @@
 #include "mozIThirdPartyUtil.h"
 #include "nsContentUtils.h"
 #include "nsGlobalWindowInner.h"
 #include "nsIClassifiedChannel.h"
 #include "nsICookiePermission.h"
 #include "nsICookieService.h"
 #include "nsIDocShell.h"
 #include "nsIHttpChannelInternal.h"
-#include "nsIIOService.h"
 #include "nsIParentChannel.h"
 #include "nsIPermission.h"
 #include "nsPermissionManager.h"
 #include "nsIPrincipal.h"
 #include "nsIScriptError.h"
 #include "nsIURI.h"
 #include "nsIURIFixup.h"
-#include "nsIURL.h"
 #include "nsIWebProgressListener.h"
 #include "nsNetUtil.h"
 #include "nsPIDOMWindow.h"
 #include "nsPrintfCString.h"
 #include "nsScriptSecurityManager.h"
 #include "nsSandboxFlags.h"
 #include "prtime.h"
 
--- a/toolkit/components/antitracking/StoragePrincipalHelper.cpp
+++ b/toolkit/components/antitracking/StoragePrincipalHelper.cpp
@@ -6,17 +6,16 @@
 
 #include "StoragePrincipalHelper.h"
 
 #include "mozilla/ipc/PBackgroundSharedTypes.h"
 #include "mozilla/AntiTrackingCommon.h"
 #include "mozilla/ScopeExit.h"
 #include "mozilla/StorageAccess.h"
 #include "nsContentUtils.h"
-#include "nsIHttpChannel.h"
 
 namespace mozilla {
 
 namespace {
 
 bool ChooseOriginAttributes(nsIChannel* aChannel, OriginAttributes& aAttrs) {
   MOZ_ASSERT(aChannel);
 
--- a/toolkit/components/autocomplete/nsAutoCompleteController.cpp
+++ b/toolkit/components/autocomplete/nsAutoCompleteController.cpp
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsAutoCompleteController.h"
 #include "nsAutoCompleteSimpleResult.h"
 
 #include "nsAutoPtr.h"
 #include "nsNetCID.h"
 #include "nsIIOService.h"
-#include "nsIServiceManager.h"
 #include "nsReadableUtils.h"
 #include "nsUnicharUtils.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIObserverService.h"
 #include "mozilla/Services.h"
 #include "mozilla/Unused.h"
 #include "mozilla/dom/KeyboardEventBinding.h"
 #include "mozilla/dom/Event.h"
--- a/toolkit/components/browser/nsWebBrowser.cpp
+++ b/toolkit/components/browser/nsWebBrowser.cpp
@@ -12,28 +12,24 @@
 #include "nsWidgetsCID.h"
 
 #include "gfxUtils.h"
 #include "mozilla/gfx/2D.h"
 
 // Interfaces Needed
 #include "gfxContext.h"
 #include "nsReadableUtils.h"
-#include "nsIComponentManager.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIWebBrowserChrome.h"
 #include "nsPIDOMWindow.h"
 #include "nsIWebProgress.h"
 #include "nsIWebProgressListener.h"
-#include "nsIURIContentListener.h"
-#include "nsISHistoryListener.h"
 #include "nsIURI.h"
 #include "nsIWebBrowserPersist.h"
-#include "nsIServiceManager.h"
 #include "nsFocusManager.h"
 #include "Layers.h"
 #include "nsILoadContext.h"
 #include "nsDocShell.h"
 
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/BrowsingContext.h"
 #include "mozilla/dom/LoadURIOptionsBinding.h"
--- a/toolkit/components/browser/nsWebBrowser.h
+++ b/toolkit/components/browser/nsWebBrowser.h
@@ -17,20 +17,18 @@
 
 // Interfaces needed
 #include "nsIBaseWindow.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIScrollable.h"
-#include "nsISHistory.h"
 #include "nsIWidget.h"
 #include "nsIWebProgress.h"
-#include "nsISecureBrowserUI.h"
 #include "nsIWebBrowser.h"
 #include "nsIWebNavigation.h"
 #include "nsIWebBrowserPersist.h"
 #include "nsIWindowWatcher.h"
 #include "nsIPrintSettings.h"
 #include "nsIWidgetListener.h"
 
 #include "mozilla/BasePrincipal.h"
--- a/toolkit/components/browser/nsWebBrowserContentPolicy.cpp
+++ b/toolkit/components/browser/nsWebBrowserContentPolicy.cpp
@@ -3,17 +3,16 @@
 /* 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 "nsWebBrowserContentPolicy.h"
 #include "nsIDocShell.h"
 #include "nsCOMPtr.h"
 #include "nsContentPolicyUtils.h"
-#include "nsIContentViewer.h"
 #include "nsNetUtil.h"
 
 nsWebBrowserContentPolicy::nsWebBrowserContentPolicy() {}
 
 nsWebBrowserContentPolicy::~nsWebBrowserContentPolicy() {}
 
 NS_IMPL_ISUPPORTS(nsWebBrowserContentPolicy, nsIContentPolicy)
 
--- a/toolkit/components/commandlines/nsCommandLine.cpp
+++ b/toolkit/components/commandlines/nsCommandLine.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 "nsCommandLine.h"
 
+#include "nsComponentManagerUtils.h"
 #include "nsICategoryManager.h"
 #include "nsICommandLineHandler.h"
 #include "nsICommandLineValidator.h"
 #include "nsIConsoleService.h"
 #include "nsIClassInfoImpl.h"
 #include "nsIFile.h"
 #include "nsISimpleEnumerator.h"
 #include "mozilla/SimpleEnumerator.h"
--- a/toolkit/components/downloads/DownloadPlatform.cpp
+++ b/toolkit/components/downloads/DownloadPlatform.cpp
@@ -5,18 +5,16 @@
 #include "DownloadPlatform.h"
 #include "nsAutoPtr.h"
 #include "nsNetUtil.h"
 #include "nsString.h"
 #include "nsINestedURI.h"
 #include "nsIProtocolHandler.h"
 #include "nsIURI.h"
 #include "nsIFile.h"
-#include "nsIObserverService.h"
-#include "nsISupportsPrimitives.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsThreadUtils.h"
 #include "xpcpublic.h"
 
 #include "mozilla/dom/Promise.h"
 #include "mozilla/LazyIdleThread.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
--- a/toolkit/components/extensions/webrequest/ChannelWrapper.cpp
+++ b/toolkit/components/extensions/webrequest/ChannelWrapper.cpp
@@ -26,17 +26,16 @@
 #include "mozIThirdPartyUtil.h"
 #include "nsIContentPolicy.h"
 #include "nsIClassifiedChannel.h"
 #include "nsIHttpChannelInternal.h"
 #include "nsIHttpHeaderVisitor.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsILoadContext.h"
-#include "nsILoadGroup.h"
 #include "nsIProxiedChannel.h"
 #include "nsIProxyInfo.h"
 #include "nsITraceableChannel.h"
 #include "nsIWritablePropertyBag.h"
 #include "nsIWritablePropertyBag2.h"
 #include "nsNetUtil.h"
 #include "nsProxyRelease.h"
 #include "nsPrintfCString.h"
--- a/toolkit/components/extensions/webrequest/StreamFilterParent.cpp
+++ b/toolkit/components/extensions/webrequest/StreamFilterParent.cpp
@@ -7,17 +7,16 @@
 #include "StreamFilterParent.h"
 
 #include "mozilla/ScopeExit.h"
 #include "mozilla/Unused.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/net/ChannelEventQueue.h"
 #include "nsHttpChannel.h"
 #include "nsIChannel.h"
-#include "nsIHttpChannelInternal.h"
 #include "nsIInputStream.h"
 #include "nsITraceableChannel.h"
 #include "nsProxyRelease.h"
 #include "nsQueryObject.h"
 #include "nsSocketTransportService2.h"
 #include "nsStringStream.h"
 #include "mozilla/net/DocumentChannelChild.h"
 
--- a/toolkit/components/extensions/webrequest/WebRequestService.cpp
+++ b/toolkit/components/extensions/webrequest/WebRequestService.cpp
@@ -3,17 +3,16 @@
 /* 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 "WebRequestService.h"
 
 #include "mozilla/Assertions.h"
 #include "mozilla/ClearOnShutdown.h"
-#include "nsIChannel.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::extensions;
 
 static WebRequestService* sWeakWebRequestService;
 
 WebRequestService::~WebRequestService() { sWeakWebRequestService = nullptr; }
--- a/toolkit/components/filewatcher/NativeFileWatcherWin.cpp
+++ b/toolkit/components/filewatcher/NativeFileWatcherWin.cpp
@@ -7,16 +7,17 @@
 /**
  * Native implementation of Watcher operations.
  */
 #include "NativeFileWatcherWin.h"
 
 #include "mozilla/Services.h"
 #include "mozilla/UniquePtr.h"
 #include "nsClassHashtable.h"
+#include "nsComponentManagerUtils.h"
 #include "nsDataHashtable.h"
 #include "nsIFile.h"
 #include "nsIObserverService.h"
 #include "nsProxyRelease.h"
 #include "nsTArray.h"
 #include "mozilla/Logging.h"
 #include "mozilla/Scoped.h"
 
--- a/toolkit/components/find/nsFind.cpp
+++ b/toolkit/components/find/nsFind.cpp
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //#define DEBUG_FIND 1
 
 #include "nsFind.h"
 #include "nsContentCID.h"
 #include "nsIContent.h"
 #include "nsINode.h"
-#include "nsISelectionController.h"
 #include "nsIFrame.h"
 #include "nsITextControlFrame.h"
 #include "nsIFormControl.h"
 #include "nsTextFragment.h"
 #include "nsString.h"
 #include "nsAtom.h"
 #include "nsServiceManagerUtils.h"
 #include "nsUnicharUtils.h"
--- a/toolkit/components/find/nsWebBrowserFind.cpp
+++ b/toolkit/components/find/nsWebBrowserFind.cpp
@@ -5,32 +5,28 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsWebBrowserFind.h"
 
 // Only need this for NS_FIND_CONTRACTID,
 // else we could use nsRange.h and nsIFind.h.
 #include "nsFind.h"
 
-#include "nsIComponentManager.h"
-#include "nsIScriptSecurityManager.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsPIDOMWindow.h"
-#include "nsIURI.h"
 #include "nsIDocShell.h"
 #include "nsPresContext.h"
 #include "mozilla/dom/Document.h"
 #include "nsISelectionController.h"
 #include "nsIFrame.h"
 #include "nsITextControlFrame.h"
 #include "nsReadableUtils.h"
 #include "nsIContent.h"
 #include "nsContentCID.h"
-#include "nsIServiceManager.h"
 #include "nsIObserverService.h"
 #include "nsISupportsPrimitives.h"
 #include "nsFind.h"
 #include "nsError.h"
 #include "nsFocusManager.h"
 #include "nsRange.h"
 #include "mozilla/PresShell.h"
 #include "mozilla/Services.h"
--- a/toolkit/components/find/nsWebBrowserFind.h
+++ b/toolkit/components/find/nsWebBrowserFind.h
@@ -7,18 +7,16 @@
 #ifndef nsWebBrowserFindImpl_h__
 #define nsWebBrowserFindImpl_h__
 
 #include "nsIWebBrowserFind.h"
 
 #include "nsCOMPtr.h"
 #include "nsIWeakReferenceUtils.h"
 
-#include "nsIFind.h"
-
 #include "nsString.h"
 
 class nsIDOMWindow;
 class nsIDocShell;
 class nsRange;
 
 namespace mozilla {
 namespace dom {
--- a/toolkit/components/fuzzyfox/Fuzzyfox.cpp
+++ b/toolkit/components/fuzzyfox/Fuzzyfox.cpp
@@ -8,17 +8,16 @@
 #include "mozilla/Logging.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "mozilla/StaticPrefs_privacy.h"
 #include "mozilla/SystemGroup.h"
 #include "mozilla/TimeStamp.h"
 #include "nsComponentManagerUtils.h"
 #include "nsIPrefBranch.h"
-#include "nsIPrefService.h"
 #include "nsServiceManagerUtils.h"
 #include "prrng.h"
 #include "prtime.h"
 
 // For usleep/Sleep & QueryPerformanceFrequency
 #ifdef XP_WIN
 #  include <windows.h>
 #else
--- a/toolkit/components/kvstore/nsKeyValueModule.cpp
+++ b/toolkit/components/kvstore/nsKeyValueModule.cpp
@@ -1,15 +1,14 @@
 /* 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/ModuleUtils.h"
 #include "nsIClassInfoImpl.h"
-#include "nsIKeyValue.h"
 #include "nsToolkitCompsCID.h"
 
 extern "C" {
 // Implemented in Rust.
 nsresult nsKeyValueServiceConstructor(nsISupports* aOuter, REFNSIID aIID,
                                       void** aResult);
 }  // extern "C"
 
--- a/toolkit/components/mediasniffer/nsMediaSniffer.cpp
+++ b/toolkit/components/mediasniffer/nsMediaSniffer.cpp
@@ -6,17 +6,17 @@
 
 #include "ADTSDemuxer.h"
 #include "FlacDemuxer.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/ModuleUtils.h"
 #include "mp3sniff.h"
 #include "nestegg/nestegg.h"
 #include "nsIClassInfoImpl.h"
-#include "nsIHttpChannel.h"
+#include "nsIChannel.h"
 #include "nsMediaSniffer.h"
 #include "nsMimeTypes.h"
 #include "nsString.h"
 
 #include <algorithm>
 
 // The minimum number of bytes that are needed to attempt to sniff an mp4 file.
 static const unsigned MP4_MIN_BYTES_COUNT = 12;
--- a/toolkit/components/mediasniffer/nsMediaSniffer.h
+++ b/toolkit/components/mediasniffer/nsMediaSniffer.h
@@ -2,21 +2,16 @@
 /* vim:set ts=2 sw=2 sts=2 tw=80 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/. */
 
 #ifndef nsMediaSniffer_h
 #define nsMediaSniffer_h
 
-#include "nsIModule.h"
-#include "nsIFactory.h"
-
-#include "nsIComponentManager.h"
-#include "nsIComponentRegistrar.h"
 #include "nsIContentSniffer.h"
 #include "mozilla/Attributes.h"
 
 // ed905ba3-c656-480e-934e-6bc35bd36aff
 #define NS_MEDIA_SNIFFER_CID                         \
   {                                                  \
     0x3fdd6c28, 0x5b87, 0x4e3e, {                    \
       0x8b, 0x57, 0x8e, 0x83, 0xc2, 0x3c, 0x1a, 0x6d \
--- a/toolkit/components/osfile/NativeOSFileInternals.cpp
+++ b/toolkit/components/osfile/NativeOSFileInternals.cpp
@@ -13,17 +13,16 @@
 #include "nsString.h"
 #include "nsNetCID.h"
 #include "nsThreadUtils.h"
 #include "nsXPCOMCID.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsServiceManagerUtils.h"
 #include "nsProxyRelease.h"
 
-#include "nsINativeOSFileInternals.h"
 #include "mozilla/dom/NativeOSFileInternalsBinding.h"
 
 #include "mozilla/Encoding.h"
 #include "nsIEventTarget.h"
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Scoped.h"
 #include "mozilla/HoldDropJSObjects.h"
--- a/toolkit/components/osfile/NativeOSFileInternals.h
+++ b/toolkit/components/osfile/NativeOSFileInternals.h
@@ -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/. */
 
 #ifndef mozilla_nativeosfileinternalservice_h__
 #define mozilla_nativeosfileinternalservice_h__
 
 #include "nsINativeOSFileInternals.h"
+
 #include "mozilla/Attributes.h"
 
 namespace mozilla {
 
 class NativeOSFileInternalsService final
     : public nsINativeOSFileInternalsService {
  public:
   NS_DECL_ISUPPORTS
--- a/toolkit/components/parentalcontrols/nsParentalControlsServiceWin.cpp
+++ b/toolkit/components/parentalcontrols/nsParentalControlsServiceWin.cpp
@@ -1,14 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; 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 "nsParentalControlsService.h"
+#include "nsComponentManagerUtils.h"
 #include "nsString.h"
 #include "nsIArray.h"
 #include "nsIWidget.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIFile.h"
 #include "nsILocalFileWin.h"
 #include "nsArrayUtils.h"
--- a/toolkit/components/places/Database.cpp
+++ b/toolkit/components/places/Database.cpp
@@ -5,20 +5,18 @@
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/ScopeExit.h"
 #include "mozilla/JSONWriter.h"
 
 #include "Database.h"
 
-#include "nsIAnnotationService.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIFile.h"
-#include "nsIWritablePropertyBag2.h"
 
 #include "nsNavBookmarks.h"
 #include "nsNavHistory.h"
 #include "nsPlacesTables.h"
 #include "nsPlacesIndexes.h"
 #include "nsPlacesTriggers.h"
 #include "nsPlacesMacros.h"
 #include "nsVariant.h"
@@ -29,16 +27,17 @@
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsDirectoryServiceUtils.h"
 #include "prenv.h"
 #include "prsystem.h"
 #include "nsPrintfCString.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "mozilla/Unused.h"
+#include "mozIStorageService.h"
 #include "prtime.h"
 
 #include "nsXULAppAPI.h"
 
 // Time between corrupt database backups.
 #define RECENT_BACKUP_TIME_MICROSEC (int64_t)86400 * PR_USEC_PER_SEC  // 24H
 
 // Filename of the database.
--- a/toolkit/components/places/Database.h
+++ b/toolkit/components/places/Database.h
@@ -4,17 +4,16 @@
 
 #ifndef mozilla_places_Database_h_
 #define mozilla_places_Database_h_
 
 #include "MainThreadUtils.h"
 #include "nsWeakReference.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIObserver.h"
-#include "nsIAsyncShutdown.h"
 #include "mozilla/storage.h"
 #include "mozilla/storage/StatementCache.h"
 #include "mozilla/Attributes.h"
 #include "nsIEventTarget.h"
 #include "Shutdown.h"
 #include "nsCategoryCache.h"
 
 // This is the schema version. Update it at any schema change and add a
@@ -34,16 +33,18 @@
 #define TOPIC_PLACES_SHUTDOWN "places-shutdown"
 // Fired when the connection has gone, nothing will work from now on.
 #define TOPIC_PLACES_CONNECTION_CLOSED "places-connection-closed"
 
 // Simulate profile-before-change. This topic may only be used by
 // calling `observe` directly on the database. Used for testing only.
 #define TOPIC_SIMULATE_PLACES_SHUTDOWN "test-simulate-places-shutdown"
 
+class mozIStorageService;
+class nsIAsyncShutdownClient;
 class nsIRunnable;
 
 namespace mozilla {
 namespace places {
 
 enum JournalMode {
   // Default SQLite journal mode.
   JOURNAL_DELETE = 0
--- a/toolkit/components/places/FaviconHelpers.h
+++ b/toolkit/components/places/FaviconHelpers.h
@@ -8,18 +8,16 @@
 
 #include "nsIFaviconService.h"
 #include "nsIChannelEventSink.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIStreamListener.h"
 #include "mozIPlacesPendingOperation.h"
 #include "nsThreadUtils.h"
 #include "nsProxyRelease.h"
-#include "imgITools.h"
-#include "imgIContainer.h"
 #include "imgLoader.h"
 
 class nsIPrincipal;
 
 #include "Database.h"
 #include "mozilla/storage.h"
 
 #define ICON_STATUS_UNKNOWN 0
--- a/toolkit/components/places/Helpers.h
+++ b/toolkit/components/places/Helpers.h
@@ -11,16 +11,17 @@
  */
 
 #include "mozilla/storage.h"
 #include "nsIURI.h"
 #include "nsThreadUtils.h"
 #include "nsProxyRelease.h"
 #include "prtime.h"
 #include "mozilla/Telemetry.h"
+#include "mozIStorageStatementCallback.h"
 
 namespace mozilla {
 namespace places {
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Asynchronous Statement Callback Helper
 
 class WeakAsyncStatementCallback : public mozIStorageStatementCallback {
--- a/toolkit/components/places/History.cpp
+++ b/toolkit/components/places/History.cpp
@@ -22,17 +22,16 @@
 #include "nsPlacesMacros.h"
 
 #include "mozilla/storage.h"
 #include "mozilla/dom/Link.h"
 #include "nsDocShellCID.h"
 #include "mozilla/Services.h"
 #include "nsThreadUtils.h"
 #include "nsNetUtil.h"
-#include "nsIFileURL.h"
 #include "nsIWidget.h"
 #include "nsIXPConnect.h"
 #include "nsIXULRuntime.h"
 #include "mozilla/Unused.h"
 #include "nsContentUtils.h"  // for nsAutoScriptBlocker
 #include "nsJSUtils.h"
 #include "mozilla/ipc/URIUtils.h"
 #include "nsPrintfCString.h"
--- a/toolkit/components/places/Shutdown.cpp
+++ b/toolkit/components/places/Shutdown.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 "Shutdown.h"
 #include "mozilla/Unused.h"
+#include "nsIWritablePropertyBag2.h"
 
 namespace mozilla {
 namespace places {
 
 uint16_t PlacesShutdownBlocker::sCounter = 0;
 Atomic<bool> PlacesShutdownBlocker::sIsStarted(false);
 
 PlacesShutdownBlocker::PlacesShutdownBlocker(const nsString& aName)
--- a/toolkit/components/places/Shutdown.h
+++ b/toolkit/components/places/Shutdown.h
@@ -1,15 +1,16 @@
 /* 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_places_Shutdown_h_
 #define mozilla_places_Shutdown_h_
 
+#include "mozIStorageCompletionCallback.h"
 #include "nsIAsyncShutdown.h"
 #include "nsProxyRelease.h"
 
 namespace mozilla {
 namespace places {
 
 class Database;
 
--- a/toolkit/components/places/nsAnnoProtocolHandler.cpp
+++ b/toolkit/components/places/nsAnnoProtocolHandler.cpp
@@ -11,33 +11,29 @@
  * The reference to annotations ("moz-anno") is a leftover from previous
  * iterations of this component. As of now the moz-anno protocol is independent
  * of annotations.
  */
 
 #include "nsAnnoProtocolHandler.h"
 #include "nsFaviconService.h"
 #include "nsIChannel.h"
-#include "nsIInputStreamChannel.h"
-#include "nsILoadGroup.h"
-#include "nsIStandardURL.h"
-#include "nsIStringStream.h"
 #include "nsIInputStream.h"
 #include "nsISupportsUtils.h"
 #include "nsIURI.h"
-#include "nsIURIMutator.h"
 #include "nsNetUtil.h"
-#include "nsIOutputStream.h"
 #include "nsInputStreamPump.h"
 #include "nsContentUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsStringStream.h"
 #include "SimpleChannel.h"
 #include "mozilla/ScopeExit.h"
 #include "mozilla/storage.h"
+#include "mozIStorageResultSet.h"
+#include "mozIStorageRow.h"
 #include "Helpers.h"
 #include "FaviconHelpers.h"
 
 using namespace mozilla;
 using namespace mozilla::places;
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Global Functions
--- a/toolkit/components/places/nsFaviconService.cpp
+++ b/toolkit/components/places/nsFaviconService.cpp
@@ -25,16 +25,17 @@
 #include "plbase64.h"
 #include "nsIClassInfoImpl.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/LoadInfo.h"
 #include "mozilla/NullPrincipal.h"
 #include "mozilla/Preferences.h"
 #include "nsILoadInfo.h"
 #include "nsIContentPolicy.h"
+#include "nsIScriptError.h"
 #include "nsContentUtils.h"
 #include "imgICache.h"
 
 #define UNASSOCIATED_FAVICONS_LENGTH 32
 
 // When replaceFaviconData is called, we store the icons in an in-memory cache
 // instead of in storage. Icons in the cache are expired according to this
 // interval.
--- a/toolkit/components/places/nsNavHistory.h
+++ b/toolkit/components/places/nsNavHistory.h
@@ -2,35 +2,33 @@
 /* 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 nsNavHistory_h_
 #define nsNavHistory_h_
 
 #include "nsINavHistoryService.h"
-#include "nsINavBookmarksService.h"
-#include "nsIFaviconService.h"
 
-#include "nsIObserverService.h"
 #include "nsICollation.h"
 #include "nsIStringBundle.h"
 #include "nsITimer.h"
 #include "nsMaybeWeakPtr.h"
 #include "nsCategoryCache.h"
 #include "nsNetCID.h"
 #include "nsToolkitCompsCID.h"
 #include "nsURIHashKey.h"
 #include "nsTHashtable.h"
 
 #include "nsNavHistoryResult.h"
 #include "nsNavHistoryQuery.h"
 #include "Database.h"
+#include "mozilla/Atomics.h"
 #include "mozilla/Attributes.h"
-#include "mozilla/Atomics.h"
+#include "mozIStorageVacuumParticipant.h"
 
 #ifdef XP_WIN
 #  include "WinUtils.h"
 #  include <wincrypt.h>
 #endif
 
 #define QUERYUPDATE_TIME 0
 #define QUERYUPDATE_SIMPLE 1
@@ -58,16 +56,17 @@
 
 #define ROOT_GUID "root________"
 #define MENU_ROOT_GUID "menu________"
 #define TOOLBAR_ROOT_GUID "toolbar_____"
 #define UNFILED_ROOT_GUID "unfiled_____"
 #define TAGS_ROOT_GUID "tags________"
 #define MOBILE_ROOT_GUID "mobile______"
 
+class mozIStorageValueArray;
 class nsIAutoCompleteController;
 class nsIEffectiveTLDService;
 class nsIIDNService;
 class nsNavHistory;
 class PlacesSQLQueryBuilder;
 
 // nsNavHistory
 
--- a/toolkit/components/places/nsNavHistoryResult.cpp
+++ b/toolkit/components/places/nsNavHistoryResult.cpp
@@ -3,17 +3,16 @@
 /* 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 <stdio.h>
 #include "nsNavHistory.h"
 #include "nsNavBookmarks.h"
 #include "nsFaviconService.h"
-#include "nsITaggingService.h"
 #include "nsAnnotationService.h"
 #include "Helpers.h"
 #include "mozilla/DebugOnly.h"
 #include "nsDebug.h"
 #include "nsNetUtil.h"
 #include "nsString.h"
 #include "nsReadableUtils.h"
 #include "nsUnicharUtils.h"
--- a/toolkit/components/places/nsPlacesMacros.h
+++ b/toolkit/components/places/nsPlacesMacros.h
@@ -1,16 +1,13 @@
 /* -*- Mode: C++; tab-width: 8; 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 "nsIConsoleService.h"
-#include "nsIScriptError.h"
-
 // Call a method on each observer in a category cache, then call the same
 // method on the observer array.
 #define NOTIFY_OBSERVERS(canFire, array, type, method) \
   PR_BEGIN_MACRO                                       \
   if (canFire) {                                       \
     ENUMERATE_WEAKARRAY(array, type, method)           \
   }                                                    \
   PR_END_MACRO;
--- a/toolkit/components/places/tests/gtest/places_test_harness_tail.h
+++ b/toolkit/components/places/tests/gtest/places_test_harness_tail.h
@@ -1,17 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
  * 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 "nsWidgetsCID.h"
-#include "nsIComponentRegistrar.h"
-#include "nsICrashReporter.h"
 #include "nsIIdleService.h"
 
 #ifndef TEST_NAME
 #  error "Must #define TEST_NAME before including places_test_harness_tail.h"
 #endif
 
 int gTestsIndex = 0;
 
--- a/toolkit/components/places/tests/gtest/test_IHistory.cpp
+++ b/toolkit/components/places/tests/gtest/test_IHistory.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
  * 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 "places_test_harness.h"
-#include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsString.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/StaticPrefs_layout.h"
 #include "nsNetUtil.h"
 
 #include "mock_Link.h"
 using namespace mozilla;
--- a/toolkit/components/printingui/ipc/PrintDataUtils.cpp
+++ b/toolkit/components/printingui/ipc/PrintDataUtils.cpp
@@ -1,17 +1,16 @@
 /* -*- 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 "PrintDataUtils.h"
 #include "nsIPrintSettings.h"
-#include "nsIServiceManager.h"
 #include "nsIWebBrowserPrint.h"
 #include "nsString.h"
 
 namespace mozilla {
 namespace embedding {
 
 /**
  * MockWebBrowserPrint is a mostly useless implementation of nsIWebBrowserPrint,
--- a/toolkit/components/printingui/ipc/PrintProgressDialogChild.cpp
+++ b/toolkit/components/printingui/ipc/PrintProgressDialogChild.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 "mozilla/Unused.h"
 #include "nsIObserver.h"
+#include "nsIPrintProgressParams.h"
 #include "PrintProgressDialogChild.h"
 
 class nsIWebProgress;
 class nsIRequest;
 
 using mozilla::Unused;
 
 namespace mozilla {
--- a/toolkit/components/printingui/ipc/PrintProgressDialogChild.h
+++ b/toolkit/components/printingui/ipc/PrintProgressDialogChild.h
@@ -1,17 +1,16 @@
 /* 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_embedding_PrintProgressDialogChild_h
 #define mozilla_embedding_PrintProgressDialogChild_h
 
 #include "mozilla/embedding/PPrintProgressDialogChild.h"
-#include "nsIPrintProgressParams.h"
 #include "nsIPrintSettings.h"
 #include "nsIWebProgressListener.h"
 
 class nsIObserver;
 
 namespace mozilla {
 namespace embedding {
 
--- a/toolkit/components/printingui/ipc/PrintProgressDialogParent.cpp
+++ b/toolkit/components/printingui/ipc/PrintProgressDialogParent.cpp
@@ -1,14 +1,13 @@
 /* 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/Unused.h"
-#include "nsIPrintProgressParams.h"
 #include "nsIWebProgressListener.h"
 #include "PrintProgressDialogParent.h"
 
 using mozilla::Unused;
 
 namespace mozilla {
 namespace embedding {
 
--- a/toolkit/components/printingui/ipc/PrintingParent.cpp
+++ b/toolkit/components/printingui/ipc/PrintingParent.cpp
@@ -6,19 +6,17 @@
 
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/BrowserParent.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Unused.h"
 #include "nsIContent.h"
 #include "mozilla/dom/Document.h"
 #include "nsIPrintingPromptService.h"
-#include "nsIPrintProgressParams.h"
 #include "nsIPrintSettingsService.h"
-#include "nsIServiceManager.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIWebProgressListener.h"
 #include "PrintingParent.h"
 #include "PrintDataUtils.h"
 #include "PrintProgressDialogParent.h"
 #include "PrintSettingsDialogParent.h"
 #include "mozilla/layout/RemotePrintJobParent.h"
 
--- a/toolkit/components/printingui/ipc/nsPrintingProxy.cpp
+++ b/toolkit/components/printingui/ipc/nsPrintingProxy.cpp
@@ -7,17 +7,16 @@
 #include "nsPrintingProxy.h"
 
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/BrowserChild.h"
 #include "mozilla/layout/RemotePrintJobChild.h"
 #include "mozilla/Unused.h"
 #include "nsIDocShell.h"
-#include "nsIDocShellTreeOwner.h"
 #include "nsIPrintingPromptService.h"
 #include "nsIPrintSession.h"
 #include "nsPIDOMWindow.h"
 #include "nsPrintSettingsService.h"
 #include "nsServiceManagerUtils.h"
 #include "PrintDataUtils.h"
 #include "PrintProgressDialogChild.h"
 #include "PrintSettingsDialogChild.h"
--- a/toolkit/components/printingui/nsPrintProgress.cpp
+++ b/toolkit/components/printingui/nsPrintProgress.cpp
@@ -2,20 +2,20 @@
 /* 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 "nsPrintProgress.h"
 
 #include "mozilla/dom/BrowsingContext.h"
 #include "nsArray.h"
-#include "nsIBaseWindow.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeOwner.h"
 #include "nsIInterfaceRequestorUtils.h"
+#include "nsIPrintSettings.h"
 #include "nsIAppWindow.h"
 #include "nsXPCOM.h"
 #include "nsISupportsPrimitives.h"
 #include "nsIComponentManager.h"
 #include "nsPIDOMWindow.h"
 #include "nsXULAppAPI.h"
 
 NS_IMPL_ADDREF(nsPrintProgress)
--- a/toolkit/components/printingui/nsPrintProgress.h
+++ b/toolkit/components/printingui/nsPrintProgress.h
@@ -2,24 +2,24 @@
 /* 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 __nsPrintProgress_h
 #define __nsPrintProgress_h
 
 #include "nsIPrintProgress.h"
-#include "nsIPrintingPromptService.h"
 
 #include "nsCOMArray.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
 
 class nsIDOMWindow;
 class nsIObserver;
+class nsIPrintSettings;
 
 class nsPrintProgress : public nsIPrintProgress {
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIPRINTPROGRESS
   NS_DECL_NSIWEBPROGRESSLISTENER
 
   explicit nsPrintProgress(nsIPrintSettings* aPrintSettings);
--- a/toolkit/components/printingui/nsPrintingPromptService.cpp
+++ b/toolkit/components/printingui/nsPrintingPromptService.cpp
@@ -3,17 +3,16 @@
  * 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 "nsPrintingPromptService.h"
 
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/StaticPtr.h"
-#include "nsIServiceManager.h"
 #include "nsISupportsUtils.h"
 #include "nsString.h"
 #include "nsIPrintDialogService.h"
 #include "nsPIDOMWindow.h"
 #include "nsXULAppAPI.h"
 
 // Printing Progress Includes
 #if !defined(XP_MACOSX)
--- a/toolkit/components/printingui/nsPrintingPromptService.h
+++ b/toolkit/components/printingui/nsPrintingPromptService.h
@@ -13,17 +13,16 @@
       0xa6, 0xe0, 0x79, 0x8e, 0x3c, 0x7, 0xb4, 0xdf \
     }                                               \
   }
 #define NS_PRINTINGPROMPTSERVICE_CONTRACTID \
   "@mozilla.org/embedcomp/printingprompt-service;1"
 
 #include "nsCOMPtr.h"
 #include "nsIPrintingPromptService.h"
-#include "nsPIPromptService.h"
 #include "nsIWindowWatcher.h"
 
 // Printing Progress Includes
 #include "nsIWebProgressListener.h"
 #if !defined(XP_MACOSX)
 #  include "nsPrintProgress.h"
 
 class nsIDOMWindow;
--- a/toolkit/components/remote/nsDBusRemoteServer.cpp
+++ b/toolkit/components/remote/nsDBusRemoteServer.cpp
@@ -2,24 +2,20 @@
 /* vim:expandtab:shiftwidth=2:tabstop=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 "nsDBusRemoteServer.h"
 
-#include "nsIBaseWindow.h"
-#include "nsIDocShell.h"
 #include "nsPIDOMWindow.h"
 #include "mozilla/ModuleUtils.h"
 #include "mozilla/Base64.h"
-#include "nsIServiceManager.h"
 #include "nsIWidget.h"
-#include "nsIAppShellService.h"
 #include "nsAppShellCID.h"
 #include "nsPrintfCString.h"
 
 #include "nsCOMPtr.h"
 
 #include "nsGTKToolkit.h"
 
 #include <dbus/dbus.h>
--- a/toolkit/components/remote/nsGTKRemoteServer.cpp
+++ b/toolkit/components/remote/nsGTKRemoteServer.cpp
@@ -6,21 +6,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsGTKRemoteServer.h"
 
 #include <gtk/gtk.h>
 #include <gdk/gdk.h>
 #include <gdk/gdkx.h>
 
-#include "nsIBaseWindow.h"
-#include "nsIDocShell.h"
 #include "mozilla/ModuleUtils.h"
-#include "nsIServiceManager.h"
-#include "nsIAppShellService.h"
 #include "nsAppShellCID.h"
 
 #include "nsCOMPtr.h"
 
 #include "nsGTKToolkit.h"
 
 nsresult nsGTKRemoteServer::Startup(const char* aAppName,
                                     const char* aProfileName) {
--- a/toolkit/components/remote/nsRemoteService.cpp
+++ b/toolkit/components/remote/nsRemoteService.cpp
@@ -19,16 +19,17 @@
 #  endif
 #elif defined(XP_WIN)
 #  include "nsWinRemoteServer.h"
 #  include "nsWinRemoteClient.h"
 #endif
 #include "nsRemoteService.h"
 
 #include "nsAutoPtr.h"
+#include "nsIObserverService.h"
 #include "nsString.h"
 #include "nsServiceManagerUtils.h"
 #include "mozilla/ModuleUtils.h"
 #include "SpecialSystemDirectory.h"
 #include "mozilla/CmdLineAndEnvUtils.h"
 
 // Time to wait for the remoting service to start
 #define START_TIMEOUT_SEC 5
--- a/toolkit/components/remote/nsRemoteService.h
+++ b/toolkit/components/remote/nsRemoteService.h
@@ -4,17 +4,16 @@
 /* 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 __nsRemoteService_h__
 #define __nsRemoteService_h__
 
 #include "nsRemoteServer.h"
-#include "nsIObserverService.h"
 #include "nsIObserver.h"
 #include "mozilla/UniquePtr.h"
 #include "nsIFile.h"
 #include "nsProfileLock.h"
 
 enum RemoteResult {
   REMOTE_NOT_FOUND = 0,
   REMOTE_FOUND = 1,
--- a/toolkit/components/remote/nsWinRemoteServer.cpp
+++ b/toolkit/components/remote/nsWinRemoteServer.cpp
@@ -3,19 +3,16 @@
  */
 /* 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 "nsWinRemoteServer.h"
 #include "nsWinRemoteUtils.h"
 #include "nsCOMPtr.h"
-#include "nsIComponentManager.h"
-#include "nsIServiceManager.h"
-#include "nsIDOMChromeWindow.h"
 #include "nsXPCOM.h"
 #include "nsPIDOMWindow.h"
 #include "nsIWindowMediator.h"
 #include "nsIBaseWindow.h"
 #include "nsIWidget.h"
 #include "nsICommandLineRunner.h"
 #include "nsICommandLine.h"
 #include "nsCommandLine.h"
--- a/toolkit/components/remote/nsXRemoteServer.cpp
+++ b/toolkit/components/remote/nsXRemoteServer.cpp
@@ -3,28 +3,20 @@
  */
 /* 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/ArrayUtils.h"
 
 #include "nsXRemoteServer.h"
-#include "nsIObserverService.h"
 #include "nsCOMPtr.h"
-#include "nsIServiceManager.h"
-#include "nsICommandLineRunner.h"
 #include "nsICommandLine.h"
 
-#include "nsIBaseWindow.h"
-#include "nsIDocShell.h"
-#include "nsIFile.h"
-#include "nsIServiceManager.h"
 #include "nsIWidget.h"
-#include "nsIAppShellService.h"
 #include "nsAppShellCID.h"
 #include "nsPIDOMWindow.h"
 #include "mozilla/X11Util.h"
 
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "prenv.h"
 #include "nsCRT.h"
--- a/toolkit/components/reputationservice/ApplicationReputation.cpp
+++ b/toolkit/components/reputationservice/ApplicationReputation.cpp
@@ -9,17 +9,16 @@
 #include "ApplicationReputation.h"
 #include "chrome/common/safe_browsing/csd.pb.h"
 
 #include "nsIArray.h"
 #include "nsIApplicationReputation.h"
 #include "nsIChannel.h"
 #include "nsIHttpChannel.h"
 #include "nsIIOService.h"
-#include "nsIPrefService.h"
 #include "nsISimpleEnumerator.h"
 #include "nsIStreamListener.h"
 #include "nsIStringStream.h"
 #include "nsITimer.h"
 #include "nsIUploadChannel2.h"
 #include "nsIURI.h"
 #include "nsIURL.h"
 #include "nsIUrlClassifierDBService.h"
--- a/toolkit/components/reputationservice/ApplicationReputation.h
+++ b/toolkit/components/reputationservice/ApplicationReputation.h
@@ -3,18 +3,16 @@
 /* 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 ApplicationReputation_h__
 #define ApplicationReputation_h__
 
 #include "nsIApplicationReputation.h"
-#include "nsIRequestObserver.h"
-#include "nsIStreamListener.h"
 #include "nsISupports.h"
 
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "mozilla/Logging.h"
 
 class nsIRequest;
 class PendingDBLookup;
--- a/toolkit/components/reputationservice/LoginReputation.cpp
+++ b/toolkit/components/reputationservice/LoginReputation.cpp
@@ -10,16 +10,17 @@
 #include "mozilla/Logging.h"
 #include "mozilla/net/UrlClassifierFeatureFactory.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/StaticPrefs_browser.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/HTMLInputElement.h"
 #include "mozilla/ipc/URIUtils.h"
+#include "nsIURIClassifier.h"
 #include "nsIUrlClassifierFeature.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 #define PREF_PP_ENABLED "browser.safebrowsing.passwords.enabled"
 
 // MOZ_LOG=LoginReputation:5
--- a/toolkit/components/reputationservice/LoginReputation.h
+++ b/toolkit/components/reputationservice/LoginReputation.h
@@ -6,17 +6,16 @@
 #ifndef LoginReputation_h__
 #define LoginReputation_h__
 
 #include "mozilla/Logging.h"
 #include "mozilla/MozPromise.h"
 #include "nsILoginReputation.h"
 #include "nsIObserver.h"
 #include "nsISupportsImpl.h"
-#include "nsIURIClassifier.h"
 
 class LoginWhitelist;
 
 namespace mozilla {
 
 typedef uint32_t VerdictType;
 typedef MozPromise<VerdictType, nsresult, false> ReputationPromise;
 
--- a/toolkit/components/resistfingerprinting/nsRFPService.cpp
+++ b/toolkit/components/resistfingerprinting/nsRFPService.cpp
@@ -24,21 +24,18 @@
 #include "nsCoord.h"
 #include "nsServiceManagerUtils.h"
 #include "nsString.h"
 #include "nsXULAppAPI.h"
 #include "nsPrintfCString.h"
 
 #include "nsICryptoHash.h"
 #include "nsIObserverService.h"
-#include "nsIPrefBranch.h"
-#include "nsIPrefService.h"
 #include "nsIRandomGenerator.h"
 #include "nsIXULAppInfo.h"
-#include "nsIXULRuntime.h"
 #include "nsJSUtils.h"
 
 #include "prenv.h"
 #include "nss.h"
 
 #include "js/Date.h"
 
 using namespace mozilla;
--- a/toolkit/components/resistfingerprinting/tests/test_reduceprecision.cpp
+++ b/toolkit/components/resistfingerprinting/tests/test_reduceprecision.cpp
@@ -2,17 +2,16 @@
  * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
  * 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 <math.h>
 
 #include "gtest/gtest.h"
-#include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsRFPService.h"
 
 using namespace mozilla;
 
 // clang-format off
 /*
    Hello! Are you looking at this file because you got an error you don't understand?
--- a/toolkit/components/satchel/nsFormFillController.cpp
+++ b/toolkit/components/satchel/nsFormFillController.cpp
@@ -20,26 +20,21 @@
 #include "mozilla/Logging.h"
 #include "mozilla/PresShell.h"
 #include "mozilla/StaticPrefs_ui.h"
 #include "nsIFormAutoComplete.h"
 #include "nsIInputListAutoComplete.h"
 #include "nsIAutoCompleteSimpleResult.h"
 #include "nsString.h"
 #include "nsReadableUtils.h"
-#include "nsIServiceManager.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
-#include "nsIDocShellTreeItem.h"
 #include "nsPIDOMWindow.h"
-#include "nsIWebNavigation.h"
-#include "nsIContentViewer.h"
 #include "nsIContent.h"
 #include "nsRect.h"
-#include "nsILoginAutoCompleteSearch.h"
 #include "nsToolkitCompsCID.h"
 #include "nsEmbedCID.h"
 #include "nsContentUtils.h"
 #include "nsGenericHTMLElement.h"
 #include "nsILoadContext.h"
 #include "nsIFrame.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsFocusManager.h"
--- a/toolkit/components/satchel/nsFormFillController.h
+++ b/toolkit/components/satchel/nsFormFillController.h
@@ -7,17 +7,16 @@
 #define __nsFormFillController__
 
 #include "nsIFormFillController.h"
 #include "nsIAutoCompleteInput.h"
 #include "nsIAutoCompleteSearch.h"
 #include "nsIAutoCompleteController.h"
 #include "nsIAutoCompletePopup.h"
 #include "nsIFormAutoComplete.h"
-#include "nsIDOMEventListener.h"
 #include "nsCOMPtr.h"
 #include "nsDataHashtable.h"
 #include "nsInterfaceHashtable.h"
 #include "nsIDocShell.h"
 #include "nsILoginAutoCompleteSearch.h"
 #include "nsIMutationObserver.h"
 #include "nsTArray.h"
 #include "nsCycleCollectionParticipant.h"
--- a/toolkit/components/sessionstore/SessionStoreListener.cpp
+++ b/toolkit/components/sessionstore/SessionStoreListener.cpp
@@ -6,22 +6,20 @@
 #include "mozilla/dom/Document.h"
 #include "mozilla/dom/SessionStoreListener.h"
 #include "mozilla/dom/SessionStoreUtils.h"
 #include "mozilla/dom/SessionStoreUtilsBinding.h"
 #include "mozilla/dom/StorageEvent.h"
 #include "mozilla/dom/BrowserChild.h"
 #include "nsGenericHTMLElement.h"
 #include "nsIAppWindow.h"
-#include "nsIBrowser.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeOwner.h"
 #include "nsImportModule.h"
 #include "nsIPrefBranch.h"
-#include "nsIPrefService.h"
 #include "nsITimer.h"
 #include "nsIWebProgress.h"
 #include "nsIXPConnect.h"
 #include "nsPresContext.h"
 #include "nsPrintfCString.h"
 #include "SessionStoreFunctions.h"
 
 using namespace mozilla;
--- a/toolkit/components/startup/nsAppStartup.cpp
+++ b/toolkit/components/startup/nsAppStartup.cpp
@@ -1,30 +1,27 @@
 /* -*- Mode: C++; tab-width: 2; 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 "nsAppStartup.h"
 
+#include "nsComponentManagerUtils.h"
 #include "nsIAppShellService.h"
 #include "nsPIDOMWindow.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIFile.h"
 #include "nsIObserverService.h"
 #include "nsIPrefBranch.h"
 #include "nsIPrefService.h"
 #include "nsIProcess.h"
-#include "nsIPromptService.h"
-#include "nsIStringBundle.h"
-#include "nsISupportsPrimitives.h"
 #include "nsIToolkitProfile.h"
 #include "nsIWebBrowserChrome.h"
 #include "nsIWindowMediator.h"
-#include "nsIWindowWatcher.h"
 #include "nsIXULRuntime.h"
 #include "nsIAppWindow.h"
 #include "nsNativeCharsetUtils.h"
 #include "nsThreadUtils.h"
 #include "nsAutoPtr.h"
 #include "nsString.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/ResultExtensions.h"
@@ -33,17 +30,16 @@
 
 #include "prprf.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsWidgetsCID.h"
 #include "nsAppRunner.h"
 #include "nsAppShellCID.h"
 #include "nsXPCOMCIDInternal.h"
 #include "mozilla/Services.h"
-#include "nsIXPConnect.h"
 #include "jsapi.h"
 #include "js/Date.h"
 #include "prenv.h"
 #include "nsAppDirectoryServiceDefs.h"
 
 #if defined(XP_WIN)
 // Prevent collisions with nsAppStartup::GetStartupInfo()
 #  undef GetStartupInfo
--- a/toolkit/components/startup/nsAppStartup.h
+++ b/toolkit/components/startup/nsAppStartup.h
@@ -6,17 +6,16 @@
 #ifndef nsAppStartup_h__
 #define nsAppStartup_h__
 
 #include "nsIAppStartup.h"
 #include "nsIWindowCreator.h"
 #include "nsIObserver.h"
 #include "nsWeakReference.h"
 
-#include "nsINativeAppSupport.h"
 #include "nsIAppShell.h"
 #include "mozilla/Attributes.h"
 
 #if defined(XP_WIN)
 // XPerf-backed probes
 #  include "mozilla/perfprobe.h"
 #  include "nsAutoPtr.h"
 #endif  // defined(XP_WIN)
--- a/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp
+++ b/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp
@@ -1,18 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; 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 "nsBrowserStatusFilter.h"
 #include "mozilla/SystemGroup.h"
-#include "nsIChannel.h"
 #include "nsITimer.h"
-#include "nsIServiceManager.h"
 #include "nsString.h"
 #include "nsThreadUtils.h"
 
 using namespace mozilla;
 
 //-----------------------------------------------------------------------------
 // nsBrowserStatusFilter <public>
 //-----------------------------------------------------------------------------
--- a/toolkit/components/telemetry/core/Stopwatch.cpp
+++ b/toolkit/components/telemetry/core/Stopwatch.cpp
@@ -8,18 +8,16 @@
 
 #include "TelemetryHistogram.h"
 
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/TimeStamp.h"
 #include "nsHashKeys.h"
 #include "nsContentUtils.h"
-#include "nsIConsoleService.h"
-#include "nsIScriptError.h"
 #include "nsPrintfCString.h"
 #include "nsQueryObject.h"
 #include "nsRefPtrHashtable.h"
 #include "nsString.h"
 #include "xpcpublic.h"
 
 using mozilla::dom::AutoJSAPI;
 
--- a/toolkit/components/telemetry/core/Telemetry.cpp
+++ b/toolkit/components/telemetry/core/Telemetry.cpp
@@ -49,26 +49,21 @@
 #endif
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsBaseHashtable.h"
 #include "nsClassHashtable.h"
 #include "nsCOMArray.h"
 #include "nsCOMPtr.h"