Bug 912195 - Minimize the #includes in docshell/shistory; r=bzbarsky
authorEhsan Akhgari <ehsan.akhgari@gmail.com>
Wed, 04 Sep 2013 11:26:20 -0400
changeset 145444 5a5948b148fc6d35637fec9a4fa72f9b81f15497
parent 145443 1faf7273eaae20e57906eb5227362922497640a6
child 145445 e7486d3f5ce818916127b6a92fee5ac20f0be6a4
push id25213
push userkwierso@gmail.com
push dateWed, 04 Sep 2013 23:18:26 +0000
treeherdermozilla-central@dffedf20a02d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs912195
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 912195 - Minimize the #includes in docshell/shistory; r=bzbarsky
docshell/shistory/src/nsSHEntry.cpp
docshell/shistory/src/nsSHEntry.h
docshell/shistory/src/nsSHEntryShared.cpp
docshell/shistory/src/nsSHEntryShared.h
docshell/shistory/src/nsSHTransaction.cpp
docshell/shistory/src/nsSHTransaction.h
docshell/shistory/src/nsSHistory.cpp
docshell/shistory/src/nsSHistory.h
--- a/docshell/shistory/src/nsSHEntry.cpp
+++ b/docshell/shistory/src/nsSHEntry.cpp
@@ -1,27 +1,25 @@
 /* -*- 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/. */
 
 // Local Includes
 #include "nsSHEntry.h"
-#include "nsXPIDLString.h"
-#include "nsReadableUtils.h"
 #include "nsIDocShellLoadInfo.h"
 #include "nsIDocShellTreeItem.h"
-#include "nsISHistory.h"
-#include "nsISHistoryInternal.h"
 #include "nsDocShellEditorData.h"
 #include "nsSHEntryShared.h"
 #include "nsILayoutHistoryState.h"
 #include "nsIContentViewer.h"
 #include "nsISupportsArray.h"
 #include "nsIStructuredCloneContainer.h"
+#include "nsIInputStream.h"
+#include "nsIURI.h"
 #include <algorithm>
 
 namespace dom = mozilla::dom;
 
 static uint32_t gEntryID = 0;
 
 //*****************************************************************************
 //***    nsSHEntry: Object Management
--- a/docshell/shistory/src/nsSHEntry.h
+++ b/docshell/shistory/src/nsSHEntry.h
@@ -10,22 +10,22 @@
 // Helper Classes
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 #include "nsCOMArray.h"
 #include "nsString.h"
 #include "mozilla/Attributes.h"
 
 // Interfaces needed
-#include "nsIInputStream.h"
 #include "nsISHEntry.h"
 #include "nsISHContainer.h"
-#include "nsIURI.h"
 
 class nsSHEntryShared;
+class nsIInputStream;
+class nsIURI;
 
 class nsSHEntry MOZ_FINAL : public nsISHEntry,
                             public nsISHContainer,
                             public nsISHEntryInternal
 {
 public: 
   nsSHEntry();
   nsSHEntry(const nsSHEntry &other);
--- a/docshell/shistory/src/nsSHEntryShared.cpp
+++ b/docshell/shistory/src/nsSHEntryShared.cpp
@@ -9,18 +9,18 @@
 #include "nsISHistoryInternal.h"
 #include "nsIDocument.h"
 #include "nsIWebNavigation.h"
 #include "nsIContentViewer.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsDocShellEditorData.h"
 #include "nsThreadUtils.h"
 #include "nsILayoutHistoryState.h"
-#include "prprf.h"
 #include "mozilla/Attributes.h"
+#include "nsISupportsArray.h"
 
 namespace dom = mozilla::dom;
 
 namespace {
 
 uint64_t gSHEntrySharedID = 0;
 
 } // anonymous namespace
--- a/docshell/shistory/src/nsSHEntryShared.h
+++ b/docshell/shistory/src/nsSHEntryShared.h
@@ -3,31 +3,31 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsSHEntryShared_h__
 #define nsSHEntryShared_h__
 
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 #include "nsCOMArray.h"
-#include "nsISupportsArray.h"
 #include "nsIBFCacheEntry.h"
 #include "nsIMutationObserver.h"
 #include "nsExpirationTracker.h"
 #include "nsRect.h"
 #include "nsString.h"
 #include "mozilla/Attributes.h"
 
 class nsSHEntry;
 class nsISHEntry;
 class nsIDocument;
 class nsIContentViewer;
 class nsIDocShellTreeItem;
 class nsILayoutHistoryState;
 class nsDocShellEditorData;
+class nsISupportsArray;
 
 // A document may have multiple SHEntries, either due to hash navigations or
 // calls to history.pushState.  SHEntries corresponding to the same document
 // share many members; in particular, they share state related to the
 // back/forward cache.
 //
 // nsSHEntryShared is the vehicle for this sharing.
 class nsSHEntryShared MOZ_FINAL : public nsIBFCacheEntry,
--- a/docshell/shistory/src/nsSHTransaction.cpp
+++ b/docshell/shistory/src/nsSHTransaction.cpp
@@ -1,16 +1,17 @@
 /* -*- 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/. */
 
 // Local Includes
 #include "nsSHTransaction.h"
+#include "nsISHEntry.h"
 
 //*****************************************************************************
 //***    nsSHTransaction: Object Management
 //*****************************************************************************
 
 nsSHTransaction::nsSHTransaction() : mPersist(true), mPrev(nullptr) 
 {
 }
--- a/docshell/shistory/src/nsSHTransaction.h
+++ b/docshell/shistory/src/nsSHTransaction.h
@@ -7,17 +7,18 @@
 #ifndef nsSHTransaction_h
 #define nsSHTransaction_h
 
 // Helper Classes
 #include "nsCOMPtr.h"
 
 // Needed interfaces
 #include "nsISHTransaction.h"
-#include "nsISHEntry.h"
+
+class nsISHEntry;
 
 class nsSHTransaction: public nsISHTransaction
 {
 public:
 	NS_DECL_ISUPPORTS
 	NS_DECL_NSISHTRANSACTION
 
 	nsSHTransaction();
--- a/docshell/shistory/src/nsSHistory.cpp
+++ b/docshell/shistory/src/nsSHistory.cpp
@@ -4,42 +4,42 @@
  * 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 "nsSHistory.h"
 #include <algorithm>
 
 // Helper Classes
-#include "nsXPIDLString.h"
-#include "nsReadableUtils.h"
 #include "mozilla/Preferences.h"
 
 // Interfaces Needed
 #include "nsILayoutHistoryState.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellLoadInfo.h"
 #include "nsISHContainer.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocShellTreeNode.h"
-#include "nsIDocShellLoadInfo.h"
-#include "nsIServiceManager.h"
 #include "nsIURI.h"
 #include "nsIContentViewer.h"
 #include "nsICacheService.h"
 #include "nsIObserverService.h"
 #include "prclist.h"
 #include "mozilla/Services.h"
 #include "nsTArray.h"
 #include "nsCOMArray.h"
 #include "nsDocShell.h"
 #include "mozilla/Attributes.h"
+#include "nsISHEntry.h"
+#include "nsISHTransaction.h"
+#include "nsISHistoryListener.h"
+#include "nsComponentManagerUtils.h"
 
 // For calculating max history entries and max cachable contentviewers
-#include "nspr.h"
+#include "prsystem.h"
 #include "mozilla/MathAlgorithms.h"
 
 using namespace mozilla;
 
 #define PREF_SHISTORY_SIZE "browser.sessionhistory.max_entries"
 #define PREF_SHISTORY_MAX_TOTAL_VIEWERS "browser.sessionhistory.max_total_viewers"
 
 static const char* kObservedPrefs[] = {
--- a/docshell/shistory/src/nsSHistory.h
+++ b/docshell/shistory/src/nsSHistory.h
@@ -8,30 +8,30 @@
 #define nsSHistory_h
 
 // Helper Classes
 #include "nsCOMPtr.h"
 
 //Interfaces Needed
 #include "nsISHistory.h"
 #include "nsISHistoryInternal.h"
-#include "nsISHTransaction.h"
 #include "nsIWebNavigation.h"
-#include "nsIWeakReference.h"
 #include "nsISimpleEnumerator.h"
-#include "nsISHistoryListener.h"
-#include "nsISHEntry.h"
 #include "nsTObserverArray.h"
+#include "nsWeakPtr.h"
 
 // Needed to maintain global list of all SHistory objects
 #include "prclist.h"
 
 class nsIDocShell;
 class nsSHEnumerator;
 class nsSHistoryObserver;
+class nsISHEntry;
+class nsISHTransaction;
+
 class nsSHistory: public PRCList,
                   public nsISHistory,
                   public nsISHistoryInternal,
                   public nsIWebNavigation
 {
 public:
   nsSHistory();