Bug 1486356 - Remove nsISHistory.restoreToEntryAtIndex. r=nika
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 27 Aug 2018 14:27:34 +1000
changeset 488826 3cee994fc8c4af8d4e0c342927551ff6c40c8152
parent 488825 2b045052d4aad4e77f3b8fce35a40efeed4e19f1
child 488827 f0ac277e134ea8e3127c2ee576bb0ecb0fe9f4cc
push id9734
push usershindli@mozilla.com
push dateThu, 30 Aug 2018 12:18:07 +0000
treeherdermozilla-beta@71c71ab3afae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika
bugs1486356
milestone63.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 1486356 - Remove nsISHistory.restoreToEntryAtIndex. r=nika It's unused.
docshell/shistory/nsISHistory.idl
docshell/shistory/nsSHistory.cpp
--- a/docshell/shistory/nsISHistory.idl
+++ b/docshell/shistory/nsISHistory.idl
@@ -72,24 +72,16 @@ interface nsISHistory: nsISupports
    * @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.
    */
    nsISHEntry getEntryAtIndex(in long index, in boolean modifyIndex);
 
   /**
-   * Load the entry at given index to root docshell directly in order to
-   * restore to an entry in grouped session history navigation or session
-   * restore case. This function will not notify nsISHistoryListener, as it's
-   * not considered a normal history navigation.
-   */
-   void restoreToEntryAtIndex(in long index);
-
-  /**
    * 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...
    *
    * @param numEntries        The number of toplevel documents to be
    *                          purged from history. During purge operation,
--- a/docshell/shistory/nsSHistory.cpp
+++ b/docshell/shistory/nsSHistory.cpp
@@ -1177,32 +1177,16 @@ nsSHistory::ReloadCurrentEntry()
                               (mIndex, currentURI, &canNavigate));
   if (!canNavigate) {
     return NS_OK;
   }
 
   return LoadEntry(mIndex, LOAD_HISTORY, HIST_CMD_RELOAD);
 }
 
-NS_IMETHODIMP
-nsSHistory::RestoreToEntryAtIndex(int32_t aIndex)
-{
-  mRequestedIndex = aIndex;
-
-  nsCOMPtr<nsISHEntry> nextEntry;
-  GetEntryAtIndex(mRequestedIndex, false, getter_AddRefs(nextEntry));
-  if (!nextEntry) {
-    mRequestedIndex = -1;
-    return NS_ERROR_FAILURE;
-  }
-
-  // XXX We may want to ensure docshell is currently holding about:blank
-  return InitiateLoad(nextEntry, mRootDocShell, LOAD_HISTORY);
-}
-
 void
 nsSHistory::EvictOutOfRangeWindowContentViewers(int32_t aIndex)
 {
   // XXX rename method to EvictContentViewersExceptAroundIndex, or something.
 
   // We need to release all content viewers that are no longer in the range
   //
   //  aIndex - VIEWER_WINDOW to aIndex + VIEWER_WINDOW