Bug 912129 - Minimize the #includes in docshell/base; r=bzbarsky
authorEhsan Akhgari <ehsan.akhgari@gmail.com>
Tue, 03 Sep 2013 16:17:26 -0400
changeset 145377 f4858cb48e2d3799e31a9771bed84a64aca910fa
parent 145376 7af0a1d83403a51a375828887ffa3f24723fa862
child 145378 9e282f0c00b862f8ffc9778fabff5a7da92d5a74
push id33251
push usereakhgari@mozilla.com
push dateTue, 03 Sep 2013 21:51:04 +0000
treeherdermozilla-inbound@f4858cb48e2d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs912129
milestone26.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 912129 - Minimize the #includes in docshell/base; r=bzbarsky
docshell/base/LoadContext.cpp
docshell/base/LoadContext.h
docshell/base/SerializedLoadContext.h
docshell/base/nsAboutRedirector.cpp
docshell/base/nsDSURIContentListener.cpp
docshell/base/nsDSURIContentListener.h
docshell/base/nsDefaultURIFixup.cpp
docshell/base/nsDefaultURIFixup.h
docshell/base/nsDocShell.cpp
docshell/base/nsDocShell.h
docshell/base/nsDocShellEditorData.cpp
docshell/base/nsDocShellEditorData.h
docshell/base/nsDocShellEnumerator.h
docshell/base/nsDocShellLoadInfo.cpp
docshell/base/nsDocShellLoadInfo.h
docshell/base/nsDocShellTransferableHooks.cpp
docshell/base/nsDocShellTransferableHooks.h
docshell/base/nsDownloadHistory.cpp
docshell/base/nsWebNavigationInfo.cpp
docshell/base/nsWebNavigationInfo.h
docshell/build/nsDocShellModule.cpp
--- a/docshell/base/LoadContext.cpp
+++ b/docshell/base/LoadContext.cpp
@@ -1,18 +1,15 @@
 /* -*- 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/LoadContext.h"
-#include "nsIScriptSecurityManager.h"
-#include "nsServiceManagerUtils.h"
-#include "mozIApplication.h"
 
 namespace mozilla {
 
 NS_IMPL_ISUPPORTS1(LoadContext, nsILoadContext)
 
 //-----------------------------------------------------------------------------
 // LoadContext::nsILoadContext
 //-----------------------------------------------------------------------------
--- a/docshell/base/LoadContext.h
+++ b/docshell/base/LoadContext.h
@@ -4,17 +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/. */
 
 #ifndef LoadContext_h
 #define LoadContext_h
 
 #include "SerializedLoadContext.h"
 #include "mozilla/Attributes.h"
-#include "nsWeakReference.h"
+#include "nsIWeakReferenceUtils.h"
 #include "mozilla/dom/Element.h"
 
 class mozIApplication;
 
 namespace mozilla {
 
 /**
  * Class that provides nsILoadContext info in Parent process.  Typically copied
--- a/docshell/base/SerializedLoadContext.h
+++ b/docshell/base/SerializedLoadContext.h
@@ -4,17 +4,18 @@
  * 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 SerializedLoadContext_h
 #define SerializedLoadContext_h
 
 #include "base/basictypes.h"
 #include "ipc/IPCMessageUtils.h"
-#include "nsILoadContext.h"
+
+class nsILoadContext;
 
 /*
  *  This file contains the IPC::SerializedLoadContext class, which is used to
  *  copy data across IPDL from Child process contexts so it is available in the
  *  Parent.
  */
 
 class nsIChannel;
--- a/docshell/base/nsAboutRedirector.cpp
+++ b/docshell/base/nsAboutRedirector.cpp
@@ -1,18 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* vim:set ts=4 sw=4 sts=4 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsAboutRedirector.h"
 #include "nsNetUtil.h"
-#include "plstr.h"
-#include "nsIScriptSecurityManager.h"
 #include "nsAboutProtocolUtils.h"
 
 NS_IMPL_ISUPPORTS1(nsAboutRedirector, nsIAboutModule)
 
 struct RedirEntry {
     const char* id;
     const char* url;
     uint32_t flags;
--- a/docshell/base/nsDSURIContentListener.cpp
+++ b/docshell/base/nsDSURIContentListener.cpp
@@ -2,30 +2,29 @@
 /* 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 "nsDocShell.h"
 #include "nsDSURIContentListener.h"
 #include "nsIChannel.h"
 #include "nsServiceManagerUtils.h"
-#include "nsXPIDLString.h"
 #include "nsDocShellCID.h"
 #include "nsIWebNavigationInfo.h"
 #include "nsIDocument.h"
 #include "nsIDOMWindow.h"
 #include "nsNetUtil.h"
 #include "nsAutoPtr.h"
 #include "nsIHttpChannel.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsError.h"
 #include "nsCharSeparatedTokenizer.h"
-#include "mozilla/Preferences.h"
 #include "nsIConsoleService.h"
 #include "nsIScriptError.h"
+#include "nsDocShellLoadTypes.h"
 
 using namespace mozilla;
 
 //*****************************************************************************
 //***    nsDSURIContentListener: Object Management
 //*****************************************************************************
 
 nsDSURIContentListener::nsDSURIContentListener(nsDocShell* aDocShell)
--- a/docshell/base/nsDSURIContentListener.h
+++ b/docshell/base/nsDSURIContentListener.h
@@ -3,23 +3,23 @@
  * 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 nsDSURIContentListener_h__
 #define nsDSURIContentListener_h__
 
 #include "nsCOMPtr.h"
-#include "nsString.h"
 #include "nsIURIContentListener.h"
 #include "nsWeakReference.h"
 
 class nsDocShell;
 class nsIWebNavigationInfo;
 class nsIHttpChannel;
+class nsAString;
 
 class nsDSURIContentListener :
     public nsIURIContentListener,
     public nsSupportsWeakReference
 
 {
 friend class nsDocShell;
 public:
--- a/docshell/base/nsDefaultURIFixup.cpp
+++ b/docshell/base/nsDefaultURIFixup.cpp
@@ -1,18 +1,15 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsString.h"
-#include "nsReadableUtils.h"
 #include "nsNetUtil.h"
-#include "nsEscape.h"
 #include "nsCRT.h"
 
 #include "nsIPlatformCharset.h"
 #include "nsIFile.h"
 #include <algorithm>
 
 #ifdef MOZ_TOOLKIT_SEARCH
 #include "nsIBrowserSearchService.h"
--- a/docshell/base/nsDefaultURIFixup.h
+++ b/docshell/base/nsDefaultURIFixup.h
@@ -4,20 +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 NSDEFAULTURIFIXUP_H
 #define NSDEFAULTURIFIXUP_H
 
 #include "nsIURIFixup.h"
 
-#include "nsCOMPtr.h"
-
-#include "nsCDefaultURIFixup.h"
-
 /* Header file */
 class nsDefaultURIFixup : public nsIURIFixup
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIURIFIXUP
 
     nsDefaultURIFixup();
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -22,75 +22,56 @@
 #include "mozilla/Util.h"
 #include "mozilla/VisualEventTracer.h"
 
 #ifdef MOZ_LOGGING
 // so we can get logging even in release builds (but only for some things)
 #define FORCE_PR_LOG 1
 #endif
 
-#include "nsIBrowserDOMWindow.h"
-#include "nsIComponentManager.h"
 #include "nsIContent.h"
 #include "nsIDocument.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMStorage.h"
 #include "nsPIDOMStorage.h"
 #include "nsIContentViewer.h"
 #include "nsIDocumentLoaderFactory.h"
 #include "nsCURILoader.h"
-#include "nsURILoader.h"
 #include "nsDocShellCID.h"
-#include "nsLayoutCID.h"
 #include "nsDOMCID.h"
-#include "nsIDOMScriptObjectFactory.h"
 #include "nsNetUtil.h"
 #include "nsRect.h"
-#include "prprf.h"
 #include "prenv.h"
 #include "nsIMarkupDocumentViewer.h"
-#include "nsXPIDLString.h"
-#include "nsReadableUtils.h"
-#include "nsIDOMChromeWindow.h"
 #include "nsIDOMWindow.h"
 #include "nsIWebBrowserChrome.h"
 #include "nsPoint.h"
-#include "nsGfxCIID.h"
 #include "nsIObserverService.h"
 #include "nsIPrompt.h"
 #include "nsIAuthPrompt.h"
 #include "nsIAuthPrompt2.h"
-#include "nsTextFormatter.h"
 #include "nsIChannelEventSink.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
-#include "nsIUploadChannel.h"
-#include "nsISecurityEventSink.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIScriptObjectPrincipal.h"
 #include "nsIScrollableFrame.h"
 #include "nsContentPolicyUtils.h" // NS_CheckContentLoadPolicy(...)
-#include "nsICategoryManager.h"
-#include "nsXPCOMCID.h"
 #include "nsISeekableStream.h"
 #include "nsAutoPtr.h"
 #include "nsIWritablePropertyBag2.h"
 #include "nsIAppShell.h"
 #include "nsWidgetsCID.h"
-#include "nsDOMJSUtils.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsView.h"
 #include "nsViewManager.h"
 #include "nsIScriptChannel.h"
-#include "nsIOfflineCacheUpdate.h"
 #include "nsITimedChannel.h"
 #include "nsIPrivacyTransitionObserver.h"
 #include "nsIReflowObserver.h"
-#include "nsCPrefetchService.h"
-#include "nsJSON.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIChannel.h"
 #include "IHistory.h"
 #include "nsViewSourceHandler.h"
 
 // we want to explore making the document own the load group
 // so we can associate the document URI with the load group.
 // until this point, we have an evil hack:
@@ -105,35 +86,29 @@
 #include "nsDocShellEditorData.h"
 
 // Helper Classes
 #include "nsError.h"
 #include "nsEscape.h"
 
 // Interfaces Needed
 #include "nsIUploadChannel.h"
-#include "nsIProgressEventSink.h"
 #include "nsIWebProgress.h"
 #include "nsILayoutHistoryState.h"
 #include "nsITimer.h"
 #include "nsISHistoryInternal.h"
 #include "nsIPrincipal.h"
-#include "nsIFileURL.h"
 #include "nsISHEntry.h"
-#include "nsISHistoryListener.h"
 #include "nsIWindowWatcher.h"
 #include "nsIPromptFactory.h"
 #include "nsIObserver.h"
-#include "nsINestedURI.h"
 #include "nsITransportSecurityInfo.h"
 #include "nsINSSErrorsService.h"
-#include "nsIApplicationCache.h"
 #include "nsIApplicationCacheChannel.h"
 #include "nsIApplicationCacheContainer.h"
-#include "nsIPermissionManager.h"
 #include "nsStreamUtils.h"
 #include "nsIController.h"
 #include "nsPICommandUpdater.h"
 #include "nsIDOMHTMLAnchorElement.h"
 #include "nsIWebBrowserChrome3.h"
 #include "nsITabChild.h"
 #include "nsISiteSecurityService.h"
 #include "nsStructuredCloneContainer.h"
@@ -144,20 +119,17 @@
 #endif
 
 // Editor-related
 #include "nsIEditingSession.h"
 
 #include "nsPIDOMWindow.h"
 #include "nsGlobalWindow.h"
 #include "nsPIWindowRoot.h"
-#include "nsIDOMDocument.h"
 #include "nsICachingChannel.h"
-#include "nsICacheVisitor.h"
-#include "nsICacheEntryDescriptor.h"
 #include "nsIMultiPartChannel.h"
 #include "nsIWyciwygChannel.h"
 
 // For reporting errors with the console service.
 // These can go away if error reporting is propagated up past nsDocShell.
 #include "nsIScriptError.h"
 
 // used to dispatch urls to default protocol handlers
@@ -189,28 +161,36 @@
 #include "nsIWebBrowserPrint.h"
 #endif
 
 #include "nsContentUtils.h"
 #include "nsCxPusher.h"
 #include "nsIChannelPolicy.h"
 #include "nsIContentSecurityPolicy.h"
 #include "nsSandboxFlags.h"
-
 #include "nsXULAppAPI.h"
-
 #include "nsDOMNavigationTiming.h"
-#include "nsITimedChannel.h"
-
 #include "nsISecurityUITelemetry.h"
-
-#include "nsIAppShellService.h"
-#include "nsAppShellCID.h"
-
 #include "nsIAppsService.h"
+#include "nsDSURIContentListener.h"
+#include "nsDocShellLoadTypes.h"
+#include "nsDocShellTransferableHooks.h"
+#include "nsICommandManager.h"
+#include "nsIDOMNode.h"
+#include "nsIDocShellTreeOwner.h"
+#include "nsIHttpChannel.h"
+#include "nsISHContainer.h"
+#include "nsISHistory.h"
+#include "nsISecureBrowserUI.h"
+#include "nsIStringBundle.h"
+#include "nsISupportsArray.h"
+#include "nsIURIFixup.h"
+#include "nsIURILoader.h"
+#include "nsIWebBrowserFind.h"
+#include "nsIWidget.h"
 
 static NS_DEFINE_CID(kDOMScriptObjectFactoryCID,
                      NS_DOM_SCRIPT_OBJECT_FACTORY_CID);
 static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
 
 #if defined(DEBUG_bryner) || defined(DEBUG_chb)
 //#define DEBUG_DOCSHELL_FOCUS
 #define DEBUG_PAGE_CACHE
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -3,98 +3,87 @@
  *
  * 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 nsDocShell_h__
 #define nsDocShell_h__
 
-#include "nsIDOMNode.h"
-#include "nsIDOMNodeList.h"
-#include "nsIContentViewer.h"
-#include "nsInterfaceHashtable.h"
-#include "nsIScriptContext.h"
 #include "nsITimer.h"
-
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocShellTreeNode.h"
 #include "nsIBaseWindow.h"
 #include "nsIScrollable.h"
 #include "nsITextScroll.h"
-#include "nsIDocShellTreeOwner.h"
 #include "nsIContentViewerContainer.h"
 #include "nsIDOMStorageManager.h"
-
 #include "nsDocLoader.h"
-#include "nsIURILoader.h"
-
-#include "nsWeakReference.h"
-
-// Local Includes
-#include "nsDSURIContentListener.h"
-#include "nsDocShellEditorData.h"
 
 // Helper Classes
 #include "nsCOMPtr.h"
 #include "nsPoint.h" // mCurrent/mDefaultScrollbarPreferences
 #include "nsString.h"
 #include "nsAutoPtr.h"
 #include "nsThreadUtils.h"
 
 // Threshold value in ms for META refresh based redirects
 #define REFRESH_REDIRECT_TIMER 15000
 
 // Interfaces Needed
 #include "nsIDocCharset.h"
-#include "nsIGlobalHistory2.h"
 #include "nsIInterfaceRequestor.h"
-#include "nsIInterfaceRequestorUtils.h"
-#include "nsIPrompt.h"
 #include "nsIRefreshURI.h"
 #include "nsIScriptGlobalObjectOwner.h"
-#include "nsISHistory.h"
-#include "nsILayoutHistoryState.h"
-#include "nsIStringBundle.h"
-#include "nsISupportsArray.h"
 #include "nsIWebNavigation.h"
 #include "nsIWebPageDescriptor.h"
 #include "nsIWebProgressListener.h"
-#include "nsISHContainer.h"
 #include "nsIDocShellLoadInfo.h"
-#include "nsIURIFixup.h"
-#include "nsIWebBrowserFind.h"
-#include "nsIHttpChannel.h"
-#include "nsDocShellTransferableHooks.h"
 #include "nsIAuthPromptProvider.h"
-#include "nsISecureBrowserUI.h"
 #include "nsIObserver.h"
-#include "nsDocShellLoadTypes.h"
 #include "nsILoadContext.h"
-#include "nsIWidget.h"
 #include "nsIWebShellServices.h"
 #include "nsILinkHandler.h"
 #include "nsIClipboardCommands.h"
-#include "nsICommandManager.h"
 #include "nsCRT.h"
 #include "prtime.h"
+#include "nsRect.h"
 
 namespace mozilla {
 namespace dom {
 class EventTarget;
 }
 }
 
 class nsDocShell;
 class nsDOMNavigationTiming;
 class nsGlobalWindow;
 class nsIController;
 class nsIScrollableFrame;
 class OnLinkClickEvent;
+class nsDSURIContentListener;
+class nsDocShellEditorData;
+class nsIClipboardDragDropHookList;
+class nsICommandManager;
+class nsIContentViewer;
+class nsIDocument;
+class nsIDOMNode;
+class nsIDocShellTreeOwner;
+class nsIGlobalHistory2;
+class nsIHttpChannel;
+class nsIPrompt;
+class nsISHistory;
+class nsISecureBrowserUI;
+class nsIStringBundle;
+class nsISupportsArray;
+class nsIURIFixup;
+class nsIURILoader;
+class nsIWebBrowserFind;
+class nsIWidget;
 
 /* load commands were moved to nsIDocShell.h */
 /* load types were moved to nsDocShellLoadTypes.h */
 
 /* internally used ViewMode types */
 enum ViewMode {
     viewNormal = 0x0,
     viewSource = 0x1
--- a/docshell/base/nsDocShellEditorData.cpp
+++ b/docshell/base/nsDocShellEditorData.cpp
@@ -1,21 +1,23 @@
 /* -*- 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 "nsIComponentManager.h"
+#include "nsDocShellEditorData.h"
 #include "nsIInterfaceRequestorUtils.h"
+#include "nsComponentManagerUtils.h"
 #include "nsIDOMWindow.h"
-#include "nsIDocShellTreeItem.h"
 #include "nsIDOMDocument.h"
-#include "nsDocShellEditorData.h"
+#include "nsIEditor.h"
+#include "nsIEditingSession.h"
+#include "nsIDocShell.h"
 
 /*---------------------------------------------------------------------------
 
   nsDocShellEditorData
 
 ----------------------------------------------------------------------------*/
 
 nsDocShellEditorData::nsDocShellEditorData(nsIDocShell* inOwningDocShell)
--- a/docshell/base/nsDocShellEditorData.h
+++ b/docshell/base/nsDocShellEditorData.h
@@ -5,29 +5,21 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef nsDocShellEditorData_h__
 #define nsDocShellEditorData_h__
 
 #ifndef nsCOMPtr_h___
 #include "nsCOMPtr.h"
 #endif
 
-#ifndef __gen_nsIDocShell_h__
-#include "nsIDocShell.h"
-#endif
+#include "nsIHTMLDocument.h"
 
-#ifndef __gen_nsIEditingSession_h__
-#include "nsIEditingSession.h"
-#endif
-
-
-#include "nsIHTMLDocument.h"
-#include "nsIEditor.h"
-
-class nsIDOMWindow;
+class nsIDocShell;
+class nsIEditingSession;
+class nsIEditor;
 
 class nsDocShellEditorData
 {
 public:
 
   nsDocShellEditorData(nsIDocShell* inOwningDocShell);
   ~nsDocShellEditorData();
 
--- a/docshell/base/nsDocShellEnumerator.h
+++ b/docshell/base/nsDocShellEnumerator.h
@@ -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 "nsISimpleEnumerator.h"
-#include "nsCOMPtr.h"
 #include "nsTArray.h"
 #include "nsIWeakReferenceUtils.h"
 
 class nsIDocShellTreeItem;
 
 
 /*
 // {13cbc281-35ae-11d5-be5b-bde0edece43c}
--- a/docshell/base/nsDocShellLoadInfo.cpp
+++ b/docshell/base/nsDocShellLoadInfo.cpp
@@ -1,17 +1,19 @@
 /* -*- Mode: C++; tab-width: 3; 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/. */
 
 // Local Includes
 #include "nsDocShellLoadInfo.h"
-#include "nsReadableUtils.h"
+#include "nsISHEntry.h"
+#include "nsIInputStream.h"
+#include "nsIURI.h"
 
 //*****************************************************************************
 //***    nsDocShellLoadInfo: Object Management
 //*****************************************************************************
 
 nsDocShellLoadInfo::nsDocShellLoadInfo()
   : mInheritOwner(false),
     mOwnerIsExplicit(false),
--- a/docshell/base/nsDocShellLoadInfo.h
+++ b/docshell/base/nsDocShellLoadInfo.h
@@ -9,19 +9,20 @@
 
 
 // Helper Classes
 #include "nsCOMPtr.h"
 #include "nsString.h"
 
 // Interfaces Needed
 #include "nsIDocShellLoadInfo.h"
-#include "nsIURI.h"
-#include "nsIInputStream.h"
-#include "nsISHEntry.h"
+
+class nsIInputStream;
+class nsISHEntry;
+class nsIURI;
 
 class nsDocShellLoadInfo : public nsIDocShellLoadInfo
 {
 public:
   nsDocShellLoadInfo();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOCSHELLLOADINFO
--- a/docshell/base/nsDocShellTransferableHooks.cpp
+++ b/docshell/base/nsDocShellTransferableHooks.cpp
@@ -1,18 +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 "nsCOMPtr.h"
-#include "nsCOMArray.h"
 #include "nsDocShellTransferableHooks.h"
 #include "nsIClipboardDragDropHooks.h"
 #include "nsIClipboardDragDropHookList.h"
-#include "nsISimpleEnumerator.h"
 #include "nsArrayEnumerator.h"
 
 nsTransferableHookData::nsTransferableHookData()
 {
 }
 
 
 nsTransferableHookData::~nsTransferableHookData()
--- a/docshell/base/nsDocShellTransferableHooks.h
+++ b/docshell/base/nsDocShellTransferableHooks.h
@@ -1,23 +1,19 @@
 /* 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 nsDocShellTransferableHooks_h__
 #define nsDocShellTransferableHooks_h__
 
-#ifndef nsCOMPtr_h___
-#include "nsCOMPtr.h"
-#endif
-
-#include "nsIClipboardDragDropHooks.h"
 #include "nsIClipboardDragDropHookList.h"
 #include "nsCOMArray.h"
 
+class nsIClipboardDragDropHooks;
 
 class nsTransferableHookData : public nsIClipboardDragDropHookList
 {
 public:
     nsTransferableHookData();
     virtual ~nsTransferableHookData();
     NS_DECL_ISUPPORTS
     NS_DECL_NSICLIPBOARDDRAGDROPHOOKLIST
--- a/docshell/base/nsDownloadHistory.cpp
+++ b/docshell/base/nsDownloadHistory.cpp
@@ -5,19 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsDownloadHistory.h"
 #include "nsCOMPtr.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIGlobalHistory2.h"
 #include "nsIObserverService.h"
 #include "nsIURI.h"
-#include "nsIComponentRegistrar.h"
-#include "nsDocShellCID.h"
-#include "nsNetCID.h"
 
 ////////////////////////////////////////////////////////////////////////////////
 //// nsDownloadHistory
 
 NS_IMPL_ISUPPORTS1(nsDownloadHistory, nsIDownloadHistory)
 
 ////////////////////////////////////////////////////////////////////////////////
 //// nsIDownloadHistory
--- a/docshell/base/nsWebNavigationInfo.cpp
+++ b/docshell/base/nsWebNavigationInfo.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 "nsWebNavigationInfo.h"
 #include "nsIWebNavigation.h"
-#include "nsString.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIDocumentLoaderFactory.h"
 #include "nsIPluginHost.h"
 #include "nsIDocShell.h"
 #include "nsContentUtils.h"
 #include "imgLoader.h"
 
 NS_IMPL_ISUPPORTS1(nsWebNavigationInfo, nsIWebNavigationInfo)
--- a/docshell/base/nsWebNavigationInfo.h
+++ b/docshell/base/nsWebNavigationInfo.h
@@ -4,19 +4,20 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsWebNavigationInfo_h__
 #define nsWebNavigationInfo_h__
 
 #include "nsIWebNavigationInfo.h"
 #include "nsCOMPtr.h"
 #include "nsICategoryManager.h"
-#include "nsStringFwd.h"
 #include "mozilla/Attributes.h"
 
+class nsCString;
+
 // Class ID for webnavigationinfo
 #define NS_WEBNAVIGATION_INFO_CID \
  { 0xf30bc0a2, 0x958b, 0x4287,{0xbf, 0x62, 0xce, 0x38, 0xba, 0x0c, 0x81, 0x1e}}
 
 class nsWebNavigationInfo MOZ_FINAL : public nsIWebNavigationInfo
 {
 public:
   nsWebNavigationInfo() {}
--- a/docshell/build/nsDocShellModule.cpp
+++ b/docshell/build/nsDocShellModule.cpp
@@ -5,18 +5,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ModuleUtils.h"
 #include "nsDocShellCID.h"
 
 #include "nsDocShell.h"
 #include "nsDefaultURIFixup.h"
 #include "nsWebNavigationInfo.h"
-
 #include "nsAboutRedirector.h"
+#include "nsCDefaultURIFixup.h"
 
 // uriloader
 #include "nsURILoader.h"
 #include "nsDocLoader.h"
 #include "nsOSHelperAppService.h"
 #include "nsExternalProtocolHandler.h"
 #include "nsPrefetchService.h"
 #include "nsOfflineCacheUpdate.h"