Bug 910161 - Remove nsIHistoryEntry and replace it with nsISHEntry; r=bz
authorTim Taubert <ttaubert@mozilla.com>
Fri, 30 Aug 2013 06:14:59 +0200
changeset 153031 7fbbfe346cadeef2a6696b86d8ec9e6b740256b6
parent 153030 d5dbccdf39fe49b1c0ea5677d049fa0bda3ffd51
child 153032 4732468202263313825992705432952478beb497
push idunknown
push userunknown
push dateunknown
reviewersbz
bugs910161
milestone26.0a1
Bug 910161 - Remove nsIHistoryEntry and replace it with nsISHEntry; r=bz
content/base/src/nsCCUncollectableMarker.cpp
docshell/base/nsDocShell.cpp
docshell/build/nsDocShellModule.cpp
docshell/shistory/public/moz.build
docshell/shistory/public/nsIHistoryEntry.idl
docshell/shistory/public/nsISHEntry.idl
docshell/shistory/public/nsISHistory.idl
docshell/shistory/src/nsSHEntry.cpp
docshell/shistory/src/nsSHEntry.h
docshell/shistory/src/nsSHistory.cpp
docshell/shistory/src/nsSHistory.h
dom/base/nsHistory.cpp
--- a/content/base/src/nsCCUncollectableMarker.cpp
+++ b/content/base/src/nsCCUncollectableMarker.cpp
@@ -258,19 +258,18 @@ MarkDocShell(nsIDocShellTreeNode* aNode,
 
   nsCOMPtr<nsIWebNavigation> webNav = do_QueryInterface(shell);
   nsCOMPtr<nsISHistory> history;
   webNav->GetSessionHistory(getter_AddRefs(history));
   if (history) {
     int32_t i, historyCount;
     history->GetCount(&historyCount);
     for (i = 0; i < historyCount; ++i) {
-      nsCOMPtr<nsIHistoryEntry> historyEntry;
-      history->GetEntryAtIndex(i, false, getter_AddRefs(historyEntry));
-      nsCOMPtr<nsISHEntry> shEntry = do_QueryInterface(historyEntry);
+      nsCOMPtr<nsISHEntry> shEntry;
+      history->GetEntryAtIndex(i, false, getter_AddRefs(shEntry));
 
       MarkSHEntry(shEntry, aCleanupJS, aPrepareForCC);
     }
   }
 
   int32_t i, childCount;
   aNode->GetChildCount(&childCount);
   for (i = 0; i < childCount; ++i) {
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -112,17 +112,17 @@
 #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 "nsIHistoryEntry.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"
@@ -3778,17 +3778,17 @@ nsDocShell::AddChildSHEntry(nsISHEntry *
         /* You are currently in the rootDocShell.
          * You will get here when a subframe has a new url
          * to load and you have walked up the tree all the 
          * way to the top to clone the current SHEntry hierarchy
          * and replace the subframe where a new url was loaded with
          * a new entry.
          */
         int32_t index = -1;
-        nsCOMPtr<nsIHistoryEntry> currentHE;
+        nsCOMPtr<nsISHEntry> currentHE;
         mSessionHistory->GetIndex(&index);
         if (index < 0)
             return NS_ERROR_FAILURE;
 
         rv = mSessionHistory->GetEntryAtIndex(index, false,
                                               getter_AddRefs(currentHE));
         NS_ENSURE_TRUE(currentHE, NS_ERROR_FAILURE);
 
@@ -8044,21 +8044,18 @@ nsDocShell::CreateContentViewer(const ch
 
         // Be sure to have a correct mLSHE, it may have been cleared by
         // EndPageLoad. See bug 302115.
         if (mSessionHistory && !mLSHE) {
             int32_t idx;
             mSessionHistory->GetRequestedIndex(&idx);
             if (idx == -1)
                 mSessionHistory->GetIndex(&idx);
-
-            nsCOMPtr<nsIHistoryEntry> entry;
             mSessionHistory->GetEntryAtIndex(idx, false,
-                                             getter_AddRefs(entry));
-            mLSHE = do_QueryInterface(entry);
+                                             getter_AddRefs(mLSHE));
         }
 
         mLoadType = LOAD_ERROR_PAGE;
     }
 
     bool onLocationChangeNeeded = OnLoadingSite(aOpenedChannel, false);
 
     // let's try resetting the load group if we need to...
@@ -9150,23 +9147,21 @@ nsDocShell::InternalLoad(nsIURI * aURI,
              */
             SetHistoryEntry(&mLSHE, nullptr);
             /* Set the title for the SH entry for this target url. so that
              * SH menus in go/back/forward buttons won't be empty for this.
              */
             if (mSessionHistory) {
                 int32_t index = -1;
                 mSessionHistory->GetIndex(&index);
-                nsCOMPtr<nsIHistoryEntry> hEntry;
+                nsCOMPtr<nsISHEntry> shEntry;
                 mSessionHistory->GetEntryAtIndex(index, false,
-                                                 getter_AddRefs(hEntry));
-                NS_ENSURE_TRUE(hEntry, NS_ERROR_FAILURE);
-                nsCOMPtr<nsISHEntry> shEntry(do_QueryInterface(hEntry));
-                if (shEntry)
-                    shEntry->SetTitle(mTitle);
+                                                 getter_AddRefs(shEntry));
+                NS_ENSURE_TRUE(shEntry, NS_ERROR_FAILURE);
+                shEntry->SetTitle(mTitle);
             }
 
             /* Set the title for the Global History entry for this anchor url.
              */
             if (mUseGlobalHistory && !mInPrivateBrowsing) {
                 nsCOMPtr<IHistory> history = services::GetHistoryService();
                 if (history) {
                     history->SetURITitle(aURI, mTitle);
--- a/docshell/build/nsDocShellModule.cpp
+++ b/docshell/build/nsDocShellModule.cpp
@@ -117,17 +117,16 @@ NS_DEFINE_NAMED_CID(NS_DBUSHANDLERAPP_CI
 #endif
 #if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_ENABLE_MEEGOTOUCHSHARE)
 NS_DEFINE_NAMED_CID(NS_EXTERNALSHARINGAPPSERVICE_CID);
 #endif
 #if defined(MOZ_WIDGET_ANDROID)
 NS_DEFINE_NAMED_CID(NS_EXTERNALURLHANDLERSERVICE_CID);
 #endif
 NS_DEFINE_NAMED_CID(NS_SHENTRY_CID);
-NS_DEFINE_NAMED_CID(NS_HISTORYENTRY_CID);
 NS_DEFINE_NAMED_CID(NS_SHTRANSACTION_CID);
 NS_DEFINE_NAMED_CID(NS_SHISTORY_CID);
 NS_DEFINE_NAMED_CID(NS_SHISTORY_INTERNAL_CID);
 NS_DEFINE_NAMED_CID(NS_DOWNLOADHISTORY_CID);
 
 
 const mozilla::Module::CIDEntry kDocShellCIDs[] = {
   { &kNS_DOCSHELL_CID, false, nullptr, nsDocShellConstructor },
@@ -147,17 +146,16 @@ const mozilla::Module::CIDEntry kDocShel
 #endif
 #if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_ENABLE_MEEGOTOUCHSHARE)
   { &kNS_EXTERNALSHARINGAPPSERVICE_CID, false, nullptr, nsExternalSharingAppServiceConstructor },
 #endif
 #if defined(MOZ_WIDGET_ANDROID)
   { &kNS_EXTERNALURLHANDLERSERVICE_CID, false, nullptr, nsExternalURLHandlerServiceConstructor },
 #endif
   { &kNS_SHENTRY_CID, false, nullptr, nsSHEntryConstructor },
-  { &kNS_HISTORYENTRY_CID, false, nullptr, nsSHEntryConstructor },
   { &kNS_SHTRANSACTION_CID, false, nullptr, nsSHTransactionConstructor },
   { &kNS_SHISTORY_CID, false, nullptr, nsSHistoryConstructor },
   { &kNS_SHISTORY_INTERNAL_CID, false, nullptr, nsSHistoryConstructor },
   { &kNS_DOWNLOADHISTORY_CID, false, nullptr, nsDownloadHistoryConstructor },
   { nullptr }
 };
 
 const mozilla::Module::ContractIDEntry kDocShellContracts[] = {
@@ -200,17 +198,16 @@ const mozilla::Module::ContractIDEntry k
 #endif
 #if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_ENABLE_MEEGOTOUCHSHARE)
   { NS_EXTERNALSHARINGAPPSERVICE_CONTRACTID, &kNS_EXTERNALSHARINGAPPSERVICE_CID },
 #endif
 #if defined(MOZ_WIDGET_ANDROID)
   { NS_EXTERNALURLHANDLERSERVICE_CONTRACTID, &kNS_EXTERNALURLHANDLERSERVICE_CID },
 #endif
   { NS_SHENTRY_CONTRACTID, &kNS_SHENTRY_CID },
-  { NS_HISTORYENTRY_CONTRACTID, &kNS_HISTORYENTRY_CID },
   { NS_SHTRANSACTION_CONTRACTID, &kNS_SHTRANSACTION_CID },
   { NS_SHISTORY_CONTRACTID, &kNS_SHISTORY_CID },
   { NS_SHISTORY_INTERNAL_CONTRACTID, &kNS_SHISTORY_INTERNAL_CID },
   { NS_DOWNLOADHISTORY_CONTRACTID, &kNS_DOWNLOADHISTORY_CID },
   { nullptr }
 };
 
 static const mozilla::Module kDocShellModule = {
--- a/docshell/shistory/public/moz.build
+++ b/docshell/shistory/public/moz.build
@@ -1,17 +1,16 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 XPIDL_SOURCES += [
     'nsIBFCacheEntry.idl',
-    'nsIHistoryEntry.idl',
     'nsISHContainer.idl',
     'nsISHEntry.idl',
     'nsISHTransaction.idl',
     'nsISHistory.idl',
     'nsISHistoryInternal.idl',
     'nsISHistoryListener.idl',
 ]
 
deleted file mode 100644
--- a/docshell/shistory/public/nsIHistoryEntry.idl
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * An interface to individual entries in session history. Each 
- * document or frame will have a nsIHistoryEntry associated with 
- * it. nsIHistoryEntry provides access to information like URI, 
- * title and frame traversal status for that document.
- * This interface is accessible from javascript.
- */
-#include "nsISupports.idl"
-
-interface nsIURI;
-
-[scriptable, uuid(A41661D4-1417-11D5-9882-00C04FA02F40)]
-interface nsIHistoryEntry : nsISupports 
-{
-
-    /** 
-     * A readonly property that returns the URI
-     * of the current entry. The object returned is
-     * of type nsIURI
-     */
-    readonly attribute nsIURI URI;
-
-    /** 
-     * A readonly property that returns the title
-     * of the current entry.  The object returned
-     * is a encoded string
-     */
-    readonly attribute wstring title;
-
-    /** 
-     * A readonly property that returns a boolean
-     * flag which indicates if the entry was created as a 
-     * result of a subframe navigation. This flag will be
-     * 'false' when a frameset page is visited for
-     * the first time. This flag will be 'true' for all
-     * history entries created as a result of a subframe
-     * navigation.
-     */
-    readonly attribute boolean isSubFrame;
-
-};
-
-
-%{ C++
-// {A41661D5-1417-11D5-9882-00C04FA02F40}
-#define NS_HISTORYENTRY_CID \
-{0xa41661d5, 0x1417, 0x11d5, {0x98, 0x82, 0x0, 0xc0, 0x4f, 0xa0, 0x2f, 0x40}}
-
-#define NS_HISTORYENTRY_CONTRACTID \
-    "@mozilla.org/browser/history-entry;1"
-
-%}
-
--- a/docshell/shistory/public/nsISHEntry.idl
+++ b/docshell/shistory/public/nsISHEntry.idl
@@ -4,17 +4,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * The interface to nsISHentry. Each document or subframe in 
  * Session History will have a nsISHEntry associated with it which will
  * hold all information required to recreate the document from history
  * 
  */
-#include "nsIHistoryEntry.idl"
+
+#include "nsISupports.idl"
 
 interface nsILayoutHistoryState;
 interface nsIContentViewer;
 interface nsIURI;
 interface nsIInputStream;
 interface nsIDocShellTreeItem;
 interface nsISupportsArray;
 interface nsIStructuredCloneContainer;
@@ -24,19 +25,44 @@ interface nsIBFCacheEntry;
 struct nsIntRect;
 class nsDocShellEditorData;
 class nsSHEntryShared;
 %}
 [ref] native nsIntRect(nsIntRect);
 [ptr] native nsDocShellEditorDataPtr(nsDocShellEditorData);
 [ptr] native nsSHEntryShared(nsSHEntryShared);
 
-[scriptable, uuid(162EA0EB-E577-4B9A-AF9D-A94E8350B029)]
-interface nsISHEntry : nsIHistoryEntry
+[scriptable, uuid(c2a5827e-0fc0-11e3-bb95-59e799890b3c)]
+interface nsISHEntry : nsISupports
 {
+    /**
+     * A readonly property that returns the URI
+     * of the current entry. The object returned is
+     * of type nsIURI
+     */
+    readonly attribute nsIURI URI;
+
+    /**
+     * A readonly property that returns the title
+     * of the current entry.  The object returned
+     * is a encoded string
+     */
+    readonly attribute wstring title;
+
+    /**
+     * A readonly property that returns a boolean
+     * flag which indicates if the entry was created as a
+     * result of a subframe navigation. This flag will be
+     * 'false' when a frameset page is visited for
+     * the first time. This flag will be 'true' for all
+     * history entries created as a result of a subframe
+     * navigation.
+     */
+    readonly attribute boolean isSubFrame;
+
     /** URI for the document */
     void setURI(in nsIURI aURI);
 
     /** Referrer URI */
     attribute nsIURI referrerURI;
 
     /** Content viewer, for fast restoration of presentation */
     attribute nsIContentViewer contentViewer;
--- a/docshell/shistory/public/nsISHistory.idl
+++ b/docshell/shistory/public/nsISHistory.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface nsIHistoryEntry;
+interface nsISHEntry;
 interface nsISHistoryListener;
 interface nsISimpleEnumerator;
 /**
  * An interface to the primary properties of the Session History
  * component. In an embedded browser environment, the nsIWebBrowser
  * object creates an instance of session history for each open window.
  * A handle to the session history object can be obtained from
  * nsIWebNavigation. In a non-embedded situation, the  owner of the
@@ -22,17 +22,17 @@ interface nsISimpleEnumerator;
 
 %{C++
 #define NS_SHISTORY_CID \
 {0x7294fe9c, 0x14d8, 0x11d5, {0x98, 0x82, 0x00, 0xC0, 0x4f, 0xa0, 0x2f, 0x40}}
 
 #define NS_SHISTORY_CONTRACTID "@mozilla.org/browser/shistory;1"
 %}
 
-[scriptable, uuid(ef2c9bcb-96b8-4095-933a-cb1c506f2c58)]
+[scriptable, uuid(b4440e2e-0fc2-11e3-971f-59e799890b3c)]
 interface nsISHistory: nsISupports
 {
   /**
    * A readonly property of the interface that returns 
    * the number of toplevel documents currently available
    * in session history.
    */
    readonly attribute long count;
@@ -67,17 +67,17 @@ interface nsISHistory: nsISupports
    *                          index of session history should be modified 
    *                          to the parameter index.
    *
    * @return                  <code>NS_OK</code> history entry for 
    *                          the index is obtained successfully.
    *                          <code>NS_ERROR_FAILURE</code> Error in obtaining
    *                          history entry for the given index.
    */
-   nsIHistoryEntry getEntryAtIndex(in long index, in boolean modifyIndex);
+   nsISHEntry getEntryAtIndex(in long index, in boolean modifyIndex);
 
 
   /**
    * Called to purge older documents from history.
    * Documents can be removed from session history for various 
    * reasons. For example to  control memory usage of the browser, to 
    * prevent users from loading documents from history, to erase evidence of
    * prior page loads etc...
@@ -130,20 +130,20 @@ interface nsISHistory: nsISupports
    * @note  To access individual history entries of the enumerator, perform the
    *        following steps:
    *        1) Call nsISHistory->GetSHistoryEnumerator() to obtain handle 
    *           the nsISimpleEnumerator object.
    *        2) Use nsISimpleEnumerator->GetNext() on the object returned
    *           by step #1 to obtain handle to the next object in the list. 
    *           The object returned by this step is of type nsISupports.
    *        3) Perform a QueryInterface on the object returned by step #2 
-   *           to nsIHistoryEntry.
-   *        4) Use nsIHistoryEntry to access properties of each history entry. 
+   *           to nsISHEntry.
+   *        4) Use nsISHEntry to access properties of each history entry. 
    *
    * @see nsISimpleEnumerator
-   * @see nsIHistoryEntry
+   * @see nsISHEntry
    * @see QueryInterface()
    * @see do_QueryInterface()
    */
    readonly attribute nsISimpleEnumerator SHistoryEnumerator;
 
    void reloadCurrentEntry();
 };
--- a/docshell/shistory/src/nsSHEntry.cpp
+++ b/docshell/shistory/src/nsSHEntry.cpp
@@ -72,18 +72,17 @@ nsSHEntry::~nsSHEntry()
   // Null out the mParent pointers on all our kids.
   mChildren.EnumerateForwards(ClearParentPtr, nullptr);
 }
 
 //*****************************************************************************
 //    nsSHEntry: nsISupports
 //*****************************************************************************
 
-NS_IMPL_ISUPPORTS4(nsSHEntry, nsISHContainer, nsISHEntry, nsIHistoryEntry,
-                   nsISHEntryInternal)
+NS_IMPL_ISUPPORTS3(nsSHEntry, nsISHContainer, nsISHEntry, nsISHEntryInternal)
 
 //*****************************************************************************
 //    nsSHEntry: nsISHEntry
 //*****************************************************************************
 
 NS_IMETHODIMP nsSHEntry::SetScrollPosition(int32_t x, int32_t y)
 {
   mScrollPositionX = x;
--- a/docshell/shistory/src/nsSHEntry.h
+++ b/docshell/shistory/src/nsSHEntry.h
@@ -14,30 +14,28 @@
 #include "nsString.h"
 #include "mozilla/Attributes.h"
 
 // Interfaces needed
 #include "nsIInputStream.h"
 #include "nsISHEntry.h"
 #include "nsISHContainer.h"
 #include "nsIURI.h"
-#include "nsIHistoryEntry.h"
 
 class nsSHEntryShared;
 
 class nsSHEntry MOZ_FINAL : public nsISHEntry,
                             public nsISHContainer,
                             public nsISHEntryInternal
 {
 public: 
   nsSHEntry();
   nsSHEntry(const nsSHEntry &other);
 
   NS_DECL_ISUPPORTS
-  NS_DECL_NSIHISTORYENTRY
   NS_DECL_NSISHENTRY
   NS_DECL_NSISHENTRYINTERNAL
   NS_DECL_NSISHCONTAINER
 
   void DropPresentationState();
 
   static nsresult Startup();
   static void Shutdown();
--- a/docshell/shistory/src/nsSHistory.cpp
+++ b/docshell/shistory/src/nsSHistory.cpp
@@ -422,27 +422,24 @@ nsSHistory::AddEntry(nsISHEntry * aSHEnt
     currentTxn->SetPersist(aPersist);
     return NS_OK;
   }
 
   nsCOMPtr<nsISHTransaction> txn(do_CreateInstance(NS_SHTRANSACTION_CONTRACTID));
   NS_ENSURE_TRUE(txn, NS_ERROR_FAILURE);
 
   nsCOMPtr<nsIURI> uri;
-  nsCOMPtr<nsIHistoryEntry> hEntry(do_QueryInterface(aSHEntry));
-  if (hEntry) {
-    int32_t currentIndex = mIndex;
-    hEntry->GetURI(getter_AddRefs(uri));
-    NOTIFY_LISTENERS(OnHistoryNewEntry, (uri));
+  int32_t currentIndex = mIndex;
+  aSHEntry->GetURI(getter_AddRefs(uri));
+  NOTIFY_LISTENERS(OnHistoryNewEntry, (uri));
 
-    // If a listener has changed mIndex, we need to get currentTxn again,
-    // otherwise we'll be left at an inconsistent state (see bug 320742)
-    if (currentIndex != mIndex) {
-      GetTransactionAtIndex(mIndex, getter_AddRefs(currentTxn));
-    }
+  // If a listener has changed mIndex, we need to get currentTxn again,
+  // otherwise we'll be left at an inconsistent state (see bug 320742)
+  if (currentIndex != mIndex) {
+    GetTransactionAtIndex(mIndex, getter_AddRefs(currentTxn));
   }
 
   // Set the ShEntry and parent for the transaction. setting the 
   // parent will properly set the parent child relationship
   txn->SetPersist(aPersist);
   NS_ENSURE_SUCCESS(txn->Create(aSHEntry, currentTxn), NS_ERROR_FAILURE);
    
   // A little tricky math here...  Basically when adding an object regardless of
@@ -484,16 +481,17 @@ nsSHistory::GetIndex(int32_t * aResult)
 NS_IMETHODIMP
 nsSHistory::GetRequestedIndex(int32_t * aResult)
 {
   NS_PRECONDITION(aResult, "null out param?");
   *aResult = mRequestedIndex;
   return NS_OK;
 }
 
+/* Get the entry at a given index */
 NS_IMETHODIMP
 nsSHistory::GetEntryAtIndex(int32_t aIndex, bool aModifyIndex, nsISHEntry** aResult)
 {
   nsresult rv;
   nsCOMPtr<nsISHTransaction> txn;
 
   /* GetTransactionAtIndex ensures aResult is valid and validates aIndex */
   rv = GetTransactionAtIndex(aIndex, getter_AddRefs(txn));
@@ -505,30 +503,16 @@ nsSHistory::GetEntryAtIndex(int32_t aInd
       if (aModifyIndex) {
         mIndex = aIndex;
       }
     } //entry
   }  //Transaction
   return rv;
 }
 
-
-/* Get the entry at a given index */
-NS_IMETHODIMP
-nsSHistory::GetEntryAtIndex(int32_t aIndex, bool aModifyIndex, nsIHistoryEntry** aResult)
-{
-  nsresult rv;
-  nsCOMPtr<nsISHEntry> shEntry;
-  rv = GetEntryAtIndex(aIndex, aModifyIndex, getter_AddRefs(shEntry));
-  if (NS_SUCCEEDED(rv) && shEntry) 
-    rv = CallQueryInterface(shEntry, aResult);
- 
-  return rv;
-}
-
 /* Get the transaction at a given index */
 NS_IMETHODIMP
 nsSHistory::GetTransactionAtIndex(int32_t aIndex, nsISHTransaction ** aResult)
 {
   nsresult rv;
   NS_ENSURE_ARG_POINTER(aResult);
 
   if ((mLength <= 0) || (aIndex < 0) || (aIndex >= mLength))
@@ -594,21 +578,18 @@ nsSHistory::PrintHistory()
     if (NS_FAILED(rv) && !entry)
       return NS_ERROR_FAILURE;
 
     nsCOMPtr<nsILayoutHistoryState> layoutHistoryState;
     nsCOMPtr<nsIURI>  uri;
     nsXPIDLString title;
 
     entry->GetLayoutHistoryState(getter_AddRefs(layoutHistoryState));
-    nsCOMPtr<nsIHistoryEntry> hEntry(do_QueryInterface(entry));
-    if (hEntry) {
-      hEntry->GetURI(getter_AddRefs(uri));
-      hEntry->GetTitle(getter_Copies(title));              
-    }
+    entry->GetURI(getter_AddRefs(uri));
+    entry->GetTitle(getter_Copies(title));
 
 #if 0
     nsAutoCString url;
     if (uri)
      uri->GetSpec(url);
 
     printf("**** SH Transaction #%d, Entry = %x\n", index, entry.get());
     printf("\t\t URL = %s\n", url.get());
@@ -1251,17 +1232,17 @@ RemoveFromSessionHistoryContainer(nsISHC
     }
   }
   return didRemove;
 }
 
 bool RemoveChildEntries(nsISHistory* aHistory, int32_t aIndex,
                           nsTArray<uint64_t>& aEntryIDs)
 {
-  nsCOMPtr<nsIHistoryEntry> rootHE;
+  nsCOMPtr<nsISHEntry> rootHE;
   aHistory->GetEntryAtIndex(aIndex, false, getter_AddRefs(rootHE));
   nsCOMPtr<nsISHContainer> root = do_QueryInterface(rootHE);
   return root ? RemoveFromSessionHistoryContainer(root, aEntryIDs) : false;
 }
 
 bool IsSameTree(nsISHEntry* aEntry1, nsISHEntry* aEntry2)
 {
   if (!aEntry1 && !aEntry2) {
@@ -1299,21 +1280,19 @@ bool IsSameTree(nsISHEntry* aEntry1, nsI
 bool
 nsSHistory::RemoveDuplicate(int32_t aIndex, bool aKeepNext)
 {
   NS_ASSERTION(aIndex >= 0, "aIndex must be >= 0!");
   NS_ASSERTION(aIndex != 0 || aKeepNext,
                "If we're removing index 0 we must be keeping the next");
   NS_ASSERTION(aIndex != mIndex, "Shouldn't remove mIndex!");
   int32_t compareIndex = aKeepNext ? aIndex + 1 : aIndex - 1;
-  nsCOMPtr<nsIHistoryEntry> rootHE1, rootHE2;
-  GetEntryAtIndex(aIndex, false, getter_AddRefs(rootHE1));
-  GetEntryAtIndex(compareIndex, false, getter_AddRefs(rootHE2));
-  nsCOMPtr<nsISHEntry> root1 = do_QueryInterface(rootHE1);
-  nsCOMPtr<nsISHEntry> root2 = do_QueryInterface(rootHE2);
+  nsCOMPtr<nsISHEntry> root1, root2;
+  GetEntryAtIndex(aIndex, false, getter_AddRefs(root1));
+  GetEntryAtIndex(compareIndex, false, getter_AddRefs(root2));
   if (IsSameTree(root1, root2)) {
     nsCOMPtr<nsISHTransaction> txToRemove, txToKeep, txNext, txPrev;
     GetTransactionAtIndex(aIndex, getter_AddRefs(txToRemove));
     GetTransactionAtIndex(compareIndex, getter_AddRefs(txToKeep));
     NS_ENSURE_TRUE(txToRemove, false);
     NS_ENSURE_TRUE(txToKeep, false);
     txToRemove->GetNext(getter_AddRefs(txNext));
     txToRemove->GetPrev(getter_AddRefs(txPrev));
@@ -1452,17 +1431,17 @@ nsSHistory::GetDocument(nsIDOMDocument**
 
 
 NS_IMETHODIMP
 nsSHistory::GetCurrentURI(nsIURI** aResultURI)
 {
   NS_ENSURE_ARG_POINTER(aResultURI);
   nsresult rv;
 
-  nsCOMPtr<nsIHistoryEntry> currentEntry;
+  nsCOMPtr<nsISHEntry> currentEntry;
   rv = GetEntryAtIndex(mIndex, false, getter_AddRefs(currentEntry));
   if (NS_FAILED(rv) && !currentEntry) return rv;
   rv = currentEntry->GetURI(aResultURI);
   return rv;
 }
 
 
 NS_IMETHODIMP
@@ -1526,34 +1505,33 @@ nsSHistory::LoadEntry(int32_t aIndex, lo
   // Keep note of requested history index in mRequestedIndex.
   mRequestedIndex = aIndex;
 
   nsCOMPtr<nsISHEntry> prevEntry;
   GetEntryAtIndex(mIndex, false, getter_AddRefs(prevEntry));
 
   nsCOMPtr<nsISHEntry> nextEntry;
   GetEntryAtIndex(mRequestedIndex, false, getter_AddRefs(nextEntry));
-  nsCOMPtr<nsIHistoryEntry> nHEntry(do_QueryInterface(nextEntry));
-  if (!nextEntry || !prevEntry || !nHEntry) {
+  if (!nextEntry || !prevEntry) {
     mRequestedIndex = -1;
     return NS_ERROR_FAILURE;
   }
 
   // Remember that this entry is getting loaded at this point in the sequence
   nsCOMPtr<nsISHEntryInternal> entryInternal = do_QueryInterface(nextEntry);
 
   if (entryInternal) {
     entryInternal->SetLastTouched(++gTouchCounter);
   }
 
   // Send appropriate listener notifications
   bool canNavigate = true;
   // Get the uri for the entry we are about to visit
   nsCOMPtr<nsIURI> nextURI;
-  nHEntry->GetURI(getter_AddRefs(nextURI));
+  nextEntry->GetURI(getter_AddRefs(nextURI));
 
   if (aHistCmd == HIST_CMD_BACK) {
     // We are going back one entry. Send GoBack notifications
     NOTIFY_LISTENERS_CANCELABLE(OnHistoryGoBack, canNavigate,
                                 (nextURI, &canNavigate));
   } else if (aHistCmd == HIST_CMD_FORWARD) {
     // We are going forward. Send GoForward notification
     NOTIFY_LISTENERS_CANCELABLE(OnHistoryGoForward, canNavigate,
@@ -1748,18 +1726,17 @@ nsSHistory::InitiateLoad(nsISHEntry * aF
    */
   aFrameEntry->SetLoadType(aLoadType);    
   aFrameDS->CreateLoadInfo (getter_AddRefs(loadInfo));
 
   loadInfo->SetLoadType(aLoadType);
   loadInfo->SetSHEntry(aFrameEntry);
 
   nsCOMPtr<nsIURI> nextURI;
-  nsCOMPtr<nsIHistoryEntry> hEntry(do_QueryInterface(aFrameEntry));
-  hEntry->GetURI(getter_AddRefs(nextURI));
+  aFrameEntry->GetURI(getter_AddRefs(nextURI));
   // Time   to initiate a document load
   return aFrameDS->LoadURI(nextURI, loadInfo, nsIWebNavigation::LOAD_FLAGS_NONE, false);
 
 }
 
 
 
 NS_IMETHODIMP
@@ -1828,15 +1805,15 @@ nsSHEnumerator::GetNext(nsISupports **aI
 {
   NS_ENSURE_ARG_POINTER(aItem);
   int32_t cnt= 0;
 
   nsresult  result = NS_ERROR_FAILURE;
   mSHistory->GetCount(&cnt);
   if (mIndex < (cnt-1)) {
     mIndex++;
-    nsCOMPtr<nsIHistoryEntry> hEntry;
+    nsCOMPtr<nsISHEntry> hEntry;
     result = mSHistory->GetEntryAtIndex(mIndex, false, getter_AddRefs(hEntry));
     if (hEntry)
       result = CallQueryInterface(hEntry, aItem);
   }
   return result;
 }
--- a/docshell/shistory/src/nsSHistory.h
+++ b/docshell/shistory/src/nsSHistory.h
@@ -13,17 +13,17 @@
 //Interfaces Needed
 #include "nsISHistory.h"
 #include "nsISHistoryInternal.h"
 #include "nsISHTransaction.h"
 #include "nsIWebNavigation.h"
 #include "nsIWeakReference.h"
 #include "nsISimpleEnumerator.h"
 #include "nsISHistoryListener.h"
-#include "nsIHistoryEntry.h"
+#include "nsISHEntry.h"
 #include "nsTObserverArray.h"
 
 // Needed to maintain global list of all SHistory objects
 #include "prclist.h"
 
 class nsIDocShell;
 class nsSHEnumerator;
 class nsSHistoryObserver;
@@ -52,17 +52,16 @@ public:
   static uint32_t GetMaxTotalViewers() { return sHistoryMaxTotalViewers; }
 
 protected:
   virtual ~nsSHistory();
   friend class nsSHEnumerator;
   friend class nsSHistoryObserver;
 
    // Could become part of nsIWebNavigation
-   NS_IMETHOD GetEntryAtIndex(int32_t aIndex, bool aModifyIndex, nsISHEntry** aResult);
    NS_IMETHOD GetTransactionAtIndex(int32_t aIndex, nsISHTransaction ** aResult);
    nsresult CompareFrames(nsISHEntry * prevEntry, nsISHEntry * nextEntry, nsIDocShell * rootDocShell, long aLoadType, bool * aIsFrameFound);
    nsresult InitiateLoad(nsISHEntry * aFrameEntry, nsIDocShell * aFrameDS, long aLoadType);
 
    NS_IMETHOD LoadEntry(int32_t aIndex, long aLoadType, uint32_t histCmd);
 
 #ifdef DEBUG
    nsresult PrintHistory();
--- a/dom/base/nsHistory.cpp
+++ b/dom/base/nsHistory.cpp
@@ -8,17 +8,16 @@
 #include "mozilla/dom/HistoryBinding.h"
 #include "nsCOMPtr.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDocument.h"
 #include "nsIPresShell.h"
 #include "nsPresContext.h"
 #include "nsIDocShell.h"
 #include "nsIWebNavigation.h"
-#include "nsIHistoryEntry.h"
 #include "nsIURI.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsReadableUtils.h"
 #include "nsContentUtils.h"
 #include "nsISHistoryInternal.h"
 #include "mozilla/Preferences.h"
 
 using namespace mozilla;