Bug 1488321 - Remove all traces of the "transaction" terminology in SHistory. r=nika.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 05 Sep 2018 09:03:22 +1000
changeset 483053 00d48361106aa71f5fe4cf307892b02e0ce66ae3
parent 483052 f451bd99a45ea7f264ed112b07698499e05f318c
child 483054 d1ded0e748012af9df9d358620dcb6c5c23f99d0
push id232
push userfmarier@mozilla.com
push dateWed, 05 Sep 2018 20:45:54 +0000
reviewersnika
bugs1488321
milestone64.0a1
Bug 1488321 - Remove all traces of the "transaction" terminology in SHistory. r=nika. This patch: - removes GetTransactionAtIndex(), because getTransactionAtIndex() can be used instead; - renames a lot of things; - updates some comments.
docshell/base/nsDocShell.cpp
docshell/base/nsDocShell.h
docshell/base/nsIDocShell.idl
docshell/shistory/nsISHEntry.idl
docshell/shistory/nsISHistory.idl
docshell/shistory/nsSHistory.cpp
docshell/shistory/nsSHistory.h
docshell/test/navigation/file_bug1326251.html
docshell/test/navigation/file_bug534178.html
docshell/test/navigation/test_sessionhistory.html
layout/base/nsDocumentViewer.cpp
toolkit/modules/sessionstore/SessionHistory.jsm
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -317,18 +317,18 @@ nsDocShell::nsDocShell()
   , mChromeEventHandler(nullptr)
   , mDefaultScrollbarPref(Scrollbar_Auto, Scrollbar_Auto)
   , mCharsetReloadState(eCharsetReloadInit)
   , mOrientationLock(hal::eScreenOrientation_None)
   , mParentCharsetSource(0)
   , mMarginWidth(-1)
   , mMarginHeight(-1)
   , mItemType(typeContent)
-  , mPreviousTransIndex(-1)
-  , mLoadedTransIndex(-1)
+  , mPreviousEntryIndex(-1)
+  , mLoadedEntryIndex(-1)
   , mChildOffset(0)
   , mSandboxFlags(0)
   , mBusyFlags(BUSY_FLAGS_NONE)
   , mAppType(nsIDocShell::APP_TYPE_UNKNOWN)
   , mLoadType(0)
   , mDefaultLoadFlags(nsIRequest::LOAD_NORMAL)
   , mReferrerPolicy(0)
   , mFailedLoadType(0)
@@ -2281,75 +2281,75 @@ nsDocShell::SetUseErrorPages(bool aUseEr
   if (mObserveErrorPages) {
     mObserveErrorPages = false;
   }
   mUseErrorPages = aUseErrorPages;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDocShell::GetPreviousTransIndex(int32_t* aPreviousTransIndex)
-{
-  *aPreviousTransIndex = mPreviousTransIndex;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsDocShell::GetLoadedTransIndex(int32_t* aLoadedTransIndex)
-{
-  *aLoadedTransIndex = mLoadedTransIndex;
+nsDocShell::GetPreviousEntryIndex(int32_t* aPreviousEntryIndex)
+{
+  *aPreviousEntryIndex = mPreviousEntryIndex;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+nsDocShell::GetLoadedEntryIndex(int32_t* aLoadedEntryIndex)
+{
+  *aLoadedEntryIndex = mLoadedEntryIndex;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::HistoryPurged(int32_t aNumEntries)
 {
   // These indices are used for fastback cache eviction, to determine
   // which session history entries are candidates for content viewer
   // eviction.  We need to adjust by the number of entries that we
   // just purged from history, so that we look at the right session history
   // entries during eviction.
-  mPreviousTransIndex = std::max(-1, mPreviousTransIndex - aNumEntries);
-  mLoadedTransIndex = std::max(0, mLoadedTransIndex - aNumEntries);
+  mPreviousEntryIndex = std::max(-1, mPreviousEntryIndex - aNumEntries);
+  mLoadedEntryIndex = std::max(0, mLoadedEntryIndex - aNumEntries);
 
   nsTObserverArray<nsDocLoader*>::ForwardIterator iter(mChildList);
   while (iter.HasMore()) {
     nsCOMPtr<nsIDocShell> shell = do_QueryObject(iter.GetNext());
     if (shell) {
       shell->HistoryPurged(aNumEntries);
     }
   }
 
   return NS_OK;
 }
 
 nsresult
-nsDocShell::HistoryTransactionRemoved(int32_t aIndex)
+nsDocShell::HistoryEntryRemoved(int32_t aIndex)
 {
   // These indices are used for fastback cache eviction, to determine
   // which session history entries are candidates for content viewer
   // eviction.  We need to adjust by the number of entries that we
   // just purged from history, so that we look at the right session history
   // entries during eviction.
-  if (aIndex == mPreviousTransIndex) {
-    mPreviousTransIndex = -1;
-  } else if (aIndex < mPreviousTransIndex) {
-    --mPreviousTransIndex;
-  }
-  if (mLoadedTransIndex == aIndex) {
-    mLoadedTransIndex = 0;
-  } else if (aIndex < mLoadedTransIndex) {
-    --mLoadedTransIndex;
+  if (aIndex == mPreviousEntryIndex) {
+    mPreviousEntryIndex = -1;
+  } else if (aIndex < mPreviousEntryIndex) {
+    --mPreviousEntryIndex;
+  }
+  if (mLoadedEntryIndex == aIndex) {
+    mLoadedEntryIndex = 0;
+  } else if (aIndex < mLoadedEntryIndex) {
+    --mLoadedEntryIndex;
   }
 
   nsTObserverArray<nsDocLoader*>::ForwardIterator iter(mChildList);
   while (iter.HasMore()) {
     nsCOMPtr<nsIDocShell> shell = do_QueryObject(iter.GetNext());
     if (shell) {
-      static_cast<nsDocShell*>(shell.get())->HistoryTransactionRemoved(aIndex);
+      static_cast<nsDocShell*>(shell.get())->HistoryEntryRemoved(aIndex);
     }
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::SetRecordProfileTimelineMarkers(bool aValue)
@@ -3861,31 +3861,31 @@ nsDocShell::AddChildSHEntryToParent(nsIS
    * mOSHE. This mOSHE will be used as the identification
    * for this subframe in the  CloneAndReplace function.
    */
 
   // In this case, we will end up calling AddEntry, which increases the
   // current index by 1
   RefPtr<ChildSHistory> rootSH = GetRootSessionHistory();
   if (rootSH) {
-    mPreviousTransIndex = rootSH->Index();
+    mPreviousEntryIndex = rootSH->Index();
   }
 
   nsresult rv;
   nsCOMPtr<nsIDocShell> parent = do_QueryInterface(GetAsSupports(mParent), &rv);
   if (parent) {
     rv = parent->AddChildSHEntry(mOSHE, aNewEntry, aChildOffset, mLoadType,
                                  aCloneChildren);
   }
 
   if (rootSH) {
-    mLoadedTransIndex = rootSH->Index();
+    mLoadedEntryIndex = rootSH->Index();
 #ifdef DEBUG_PAGE_CACHE
-    printf("Previous index: %d, Loaded index: %d\n\n", mPreviousTransIndex,
-           mLoadedTransIndex);
+    printf("Previous index: %d, Loaded index: %d\n\n", mPreviousEntryIndex,
+           mLoadedEntryIndex);
 #endif
   }
 
   return rv;
 }
 
 NS_IMETHODIMP
 nsDocShell::SetUseGlobalHistory(bool aUseGlobalHistory)
@@ -8115,22 +8115,22 @@ nsDocShell::RestoreFromHistory()
 
   // Set mFiredUnloadEvent = false so that the unload handler for the
   // *new* document will fire.
   mFiredUnloadEvent = false;
 
   mURIResultedInDocument = true;
   RefPtr<ChildSHistory> rootSH = GetRootSessionHistory();
   if (rootSH) {
-    mPreviousTransIndex = rootSH->Index();
+    mPreviousEntryIndex = rootSH->Index();
     rootSH->LegacySHistory()->UpdateIndex();
-    mLoadedTransIndex = rootSH->Index();
+    mLoadedEntryIndex = rootSH->Index();
 #ifdef DEBUG_PAGE_CACHE
-    printf("Previous index: %d, Loaded index: %d\n\n", mPreviousTransIndex,
-           mLoadedTransIndex);
+    printf("Previous index: %d, Loaded index: %d\n\n", mPreviousEntryIndex,
+           mLoadedEntryIndex);
 #endif
   }
 
   // Rather than call Embed(), we will retrieve the viewer from the session
   // history entry and swap it in.
   // XXX can we refactor this so that we can just call Embed()?
   PersistLayoutHistoryState();
   nsresult rv;
@@ -11602,22 +11602,22 @@ nsDocShell::OnNewURI(nsIURI* aURI, nsICh
   }
 
   // If this was a history load or a refresh, or it was a history load but
   // later changed to LOAD_NORMAL_REPLACE due to redirection, update the index
   // in session history.
   if (rootSH &&
        ((mLoadType & (LOAD_CMD_HISTORY | LOAD_CMD_RELOAD)) ||
          mLoadType == LOAD_NORMAL_REPLACE)) {
-    mPreviousTransIndex = rootSH->Index();
+    mPreviousEntryIndex = rootSH->Index();
     rootSH->LegacySHistory()->UpdateIndex();
-    mLoadedTransIndex = rootSH->Index();
+    mLoadedEntryIndex = rootSH->Index();
 #ifdef DEBUG_PAGE_CACHE
     printf("Previous index: %d, Loaded index: %d\n\n",
-           mPreviousTransIndex, mLoadedTransIndex);
+           mPreviousEntryIndex, mLoadedEntryIndex);
 #endif
   }
 
   // aCloneSHChildren exactly means "we are not loading a new document".
   uint32_t locationFlags =
     aCloneSHChildren ? uint32_t(LOCATION_CHANGE_SAME_DOCUMENT) : 0;
 
   bool onLocationChangeNeeded = SetCurrentURI(aURI, aChannel,
@@ -12249,24 +12249,24 @@ nsDocShell::AddToSessionHistory(nsIURI* 
       } else {
         // If we're trying to replace an inexistant shistory entry, append.
         addToSHistory = true;
       }
     }
 
     if (addToSHistory) {
       // Add to session history
-      mPreviousTransIndex = mSessionHistory->Index();
+      mPreviousEntryIndex = mSessionHistory->Index();
 
       bool shouldPersist = ShouldAddToSessionHistory(aURI, aChannel);
       rv = mSessionHistory->LegacySHistory()->AddEntry(entry, shouldPersist);
-      mLoadedTransIndex = mSessionHistory->Index();
+      mLoadedEntryIndex = mSessionHistory->Index();
 #ifdef DEBUG_PAGE_CACHE
       printf("Previous index: %d, Loaded index: %d\n\n",
-             mPreviousTransIndex, mLoadedTransIndex);
+             mPreviousEntryIndex, mLoadedEntryIndex);
 #endif
     }
   } else {
     // This is a subframe.
     if (!mOSHE || !LOAD_TYPE_HAS_FLAGS(mLoadType, LOAD_FLAGS_REPLACE_HISTORY)) {
       rv = AddChildSHEntryToParent(entry, mChildOffset, aCloneChildren);
     }
   }
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -249,17 +249,17 @@ public:
   // We need dummy OnLocationChange in some cases to update the UI without
   // updating security info.
   void FireDummyOnLocationChange()
   {
     FireOnLocationChange(this, nullptr, mCurrentURI,
                          LOCATION_CHANGE_SAME_DOCUMENT);
   }
 
-  nsresult HistoryTransactionRemoved(int32_t aIndex);
+  nsresult HistoryEntryRemoved(int32_t aIndex);
 
   // Notify Scroll observers when an async panning/zooming transform
   // has started being applied
   MOZ_CAN_RUN_SCRIPT_BOUNDARY
   void NotifyAsyncPanZoomStarted();
 
   // Notify Scroll observers when an async panning/zooming transform
   // is no longer applied
@@ -1026,21 +1026,21 @@ private: // data members
   int32_t mParentCharsetSource;
   int32_t mMarginWidth;
   int32_t mMarginHeight;
 
   // This can either be a content docshell or a chrome docshell. After
   // Create() is called, the type is not expected to change.
   int32_t mItemType;
 
-  // Index into the SHTransaction list, indicating the previous and current
-  // transaction at the time that this DocShell begins to load. Consequently
+  // Index into the nsISHEntry array, indicating the previous and current
+  // entry at the time that this DocShell begins to load. Consequently
   // root docshell's indices can differ from child docshells'.
-  int32_t mPreviousTransIndex;
-  int32_t mLoadedTransIndex;
+  int32_t mPreviousEntryIndex;
+  int32_t mLoadedEntryIndex;
 
   // Offset in the parent's child list.
   // -1 if the docshell is added dynamically to the parent shell.
   int32_t mChildOffset;
 
   uint32_t mSandboxFlags;
   uint32_t mBusyFlags;
   uint32_t mAppType;
--- a/docshell/base/nsIDocShell.idl
+++ b/docshell/base/nsIDocShell.idl
@@ -534,22 +534,22 @@ interface nsIDocShell : nsIDocShellTreeI
 
   /**
    * The channel that failed to load and resulted in an error page.
    * May be null. Relevant only to error pages.
    */
   readonly attribute nsIChannel failedChannel;
 
   /**
-   * Keeps track of the previous SHTransaction index and the current
-   * SHTransaction index at the time that the doc shell begins to load.
+   * Keeps track of the previous nsISHEntry index and the current
+   * nsISHEntry index at the time that the doc shell begins to load.
    * Used for ContentViewer eviction.
    */
-  readonly attribute long previousTransIndex;
-  readonly attribute long loadedTransIndex;
+  readonly attribute long previousEntryIndex;
+  readonly attribute long loadedEntryIndex;
 
   /**
    * Notification that entries have been removed from the beginning of a
    * nsSHistory which has this as its rootDocShell.
    *
    * @param numEntries - The number of entries removed
    */
   void historyPurged(in long numEntries);
--- a/docshell/shistory/nsISHEntry.idl
+++ b/docshell/shistory/nsISHEntry.idl
@@ -397,17 +397,17 @@ interface nsISHEntry : nsISupports
     /**
      * Replaces a child which is for the same docshell as aNewChild
      * with aNewChild.
      * @throw if nothing was replaced.
      */
     void ReplaceChild(in nsISHEntry aNewChild);
 
     /**
-     * When an entry is serving as a transaction within nsISHistory, this
+     * When an entry is serving is within nsISHistory's array of entries, this
      * property specifies if it should persist. If not it will be replaced by
      * new additions to the list.
      */
     [infallible] attribute boolean persist;
 };
 
 %{ C++
 // {BFD1A791-AD9F-11d3-BDC7-0050040A9B44}
--- a/docshell/shistory/nsISHistory.idl
+++ b/docshell/shistory/nsISHistory.idl
@@ -63,24 +63,21 @@ interface nsISHistory: nsISupports
   /**
    * A read/write property of the interface, used to Get/Set
    * the maximum number of toplevel documents, session history
    * can hold for each instance.
    */
   attribute long maxLength;
 
   /**
-   * Get the history entry at a given index.
+   * Get the history entry at a given index. Returns non-null on success.
    *
    * @param index             The index value whose entry is requested.
    *                          The oldest entry is located at index == 0.
-   * @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.
+   * @return                  The found entry; never null.
    */
   nsISHEntry getEntryAtIndex(in long aIndex);
 
   /**
    * 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
@@ -147,21 +144,16 @@ interface nsISHistory: nsISupports
    * @param aPersist          If true this specifies that the entry should
    *                          persist in the list. If false, this means that
    *                          when new entries are added this element will not
    *                          appear in the session history list.
    */
   void addEntry(in nsISHEntry aEntry, in boolean aPersist);
 
   /**
-   * Get the transaction at a particular index. Returns non-null on success.
-   */
-  nsISHEntry GetTransactionAtIndex(in int32_t aIndex);
-
-  /**
    * Sets the toplevel docshell object to which this SHistory object belongs to.
    */
   void setRootDocShell(in nsIDocShell rootDocShell);
 
   /**
    * Update the index maintained by sessionHistory
    */
   void updateIndex();
--- a/docshell/shistory/nsSHistory.cpp
+++ b/docshell/shistory/nsSHistory.cpp
@@ -179,33 +179,33 @@ nsSHistoryObserver::Observe(nsISupports*
   }
 
   return NS_OK;
 }
 
 namespace {
 
 already_AddRefed<nsIContentViewer>
-GetContentViewerForTransaction(nsISHEntry* aTrans)
+GetContentViewerForEntry(nsISHEntry* aEntry)
 {
   nsCOMPtr<nsISHEntry> ownerEntry;
   nsCOMPtr<nsIContentViewer> viewer;
-  aTrans->GetAnyContentViewer(getter_AddRefs(ownerEntry),
+  aEntry->GetAnyContentViewer(getter_AddRefs(ownerEntry),
                               getter_AddRefs(viewer));
   return viewer.forget();
 }
 
 } // namespace
 
 void
-nsSHistory::EvictContentViewerForTransaction(nsISHEntry* aTrans)
+nsSHistory::EvictContentViewerForEntry(nsISHEntry* aEntry)
 {
   nsCOMPtr<nsIContentViewer> viewer;
   nsCOMPtr<nsISHEntry> ownerEntry;
-  aTrans->GetAnyContentViewer(getter_AddRefs(ownerEntry),
+  aEntry->GetAnyContentViewer(getter_AddRefs(ownerEntry),
                               getter_AddRefs(viewer));
   if (viewer) {
     NS_ASSERTION(ownerEntry, "Content viewer exists but its SHEntry is null");
 
     LOG_SHENTRY_SPEC(("Evicting content viewer 0x%p for "
                       "owning SHEntry 0x%p at %s.",
                       viewer.get(), ownerEntry.get(), _spec),
                       ownerEntry);
@@ -214,19 +214,19 @@ nsSHistory::EvictContentViewerForTransac
     // document teardown is able to correctly persist the state.
     ownerEntry->SetContentViewer(nullptr);
     ownerEntry->SyncPresentationState();
     viewer->Destroy();
   }
 
   // When dropping bfcache, we have to remove associated dynamic entries as well.
   int32_t index = -1;
-  GetIndexOfEntry(aTrans, &index);
+  GetIndexOfEntry(aEntry, &index);
   if (index != -1) {
-    RemoveDynEntries(index, aTrans);
+    RemoveDynEntries(index, aEntry);
   }
 }
 
 nsSHistory::nsSHistory()
   : mIndex(-1)
   , mRequestedIndex(-1)
   , mRootDocShell(nullptr)
 {
@@ -604,46 +604,46 @@ nsSHistory::AddEntry(nsISHEntry* aSHEntr
     NS_WARNING("The entry has been associated to another nsISHistory instance. "
                "Try nsISHEntry.clone() and nsISHEntry.abandonBFCacheEntry() "
                "first if you're copying an entry from another nsISHistory.");
     return NS_ERROR_FAILURE;
   }
 
   nsCOMPtr<nsISHEntry> currentTxn;
   if (mIndex >= 0) {
-    nsresult rv = GetTransactionAtIndex(mIndex, getter_AddRefs(currentTxn));
+    nsresult rv = GetEntryAtIndex(mIndex, getter_AddRefs(currentTxn));
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   aSHEntry->SetSHistory(this);
 
   // If we have a root docshell, update the docshell id of the root shentry to
   // match the id of that docshell
   if (mRootDocShell) {
     nsID docshellID = mRootDocShell->HistoryID();
     aSHEntry->SetDocshellID(&docshellID);
   }
 
   if (currentTxn && !currentTxn->GetPersist()) {
     NOTIFY_LISTENERS(OnHistoryReplaceEntry, (mIndex));
     aSHEntry->SetPersist(aPersist);
-    mTransactions[mIndex] = aSHEntry;
+    mEntries[mIndex] = aSHEntry;
     return NS_OK;
   }
 
   nsCOMPtr<nsIURI> uri;
   aSHEntry->GetURI(getter_AddRefs(uri));
   NOTIFY_LISTENERS(OnHistoryNewEntry, (uri, mIndex));
 
-  // Remove all transactions after the current one, add the new one, and set
-  // the new one as the current one.
+  // Remove all entries after the current one, add the new one, and set the new
+  // one as the current one.
   MOZ_ASSERT(mIndex >= -1);
   aSHEntry->SetPersist(aPersist);
-  mTransactions.TruncateLength(mIndex + 1);
-  mTransactions.AppendElement(aSHEntry);
+  mEntries.TruncateLength(mIndex + 1);
+  mEntries.AppendElement(aSHEntry);
   mIndex++;
 
   NOTIFY_LISTENERS(OnLengthChanged, (Length()));
   NOTIFY_LISTENERS(OnIndexChanged, (mIndex));
 
   // Purge History list if it is too long
   if (gHistoryMaxSize >= 0 && Length() > gHistoryMaxSize) {
     PurgeHistory(Length() - gHistoryMaxSize);
@@ -689,73 +689,66 @@ nsSHistory::GetRequestedIndex(int32_t* a
   MOZ_ASSERT(aResult, "null out param?");
   *aResult = mRequestedIndex;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSHistory::GetEntryAtIndex(int32_t aIndex, nsISHEntry** aResult)
 {
-  return GetTransactionAtIndex(aIndex, aResult);
-}
-
-/* Get the transaction at a given index */
-NS_IMETHODIMP
-nsSHistory::GetTransactionAtIndex(int32_t aIndex, nsISHEntry** aResult)
-{
   NS_ENSURE_ARG_POINTER(aResult);
 
   if (aIndex < 0 || aIndex >= Length()) {
     return NS_ERROR_FAILURE;
   }
 
-  *aResult = mTransactions[aIndex];
+  *aResult = mEntries[aIndex];
   NS_ADDREF(*aResult);
   return NS_OK;
 }
 
 /* Get the index of a given entry */
 NS_IMETHODIMP
 nsSHistory::GetIndexOfEntry(nsISHEntry* aSHEntry, int32_t* aResult)
 {
   NS_ENSURE_ARG(aSHEntry);
   NS_ENSURE_ARG_POINTER(aResult);
   *aResult = -1;
 
   for (int32_t i = 0; i < Length(); i++) {
-    if (aSHEntry == mTransactions[i]) {
+    if (aSHEntry == mEntries[i]) {
       *aResult = i;
       return NS_OK;
     }
   }
 
   return NS_ERROR_FAILURE;
 }
 
 #ifdef DEBUG
 nsresult
 nsSHistory::PrintHistory()
 {
   for (int32_t i = 0; i < Length(); i++) {
-    nsCOMPtr<nsISHEntry> entry = mTransactions[i];
+    nsCOMPtr<nsISHEntry> entry = mEntries[i];
     nsCOMPtr<nsILayoutHistoryState> layoutHistoryState;
     nsCOMPtr<nsIURI> uri;
     nsString title;
 
     entry->GetLayoutHistoryState(getter_AddRefs(layoutHistoryState));
     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", i, entry.get());
+    printf("**** SH Entry #%d: %x\n", i, entry.get());
     printf("\t\t URL = %s\n", url.get());
 
     printf("\t\t Title = %s\n", NS_LossyConvertUTF16toASCII(title).get());
     printf("\t\t layout History Data = %x\n", layoutHistoryState.get());
 #endif
   }
 
   return NS_OK;
@@ -808,17 +801,17 @@ nsSHistory::PurgeHistory(int32_t aNumEnt
                               (aNumEntries, &purgeHistory));
 
   if (!purgeHistory) {
     // Listener asked us not to purge
     return NS_SUCCESS_LOSS_OF_INSIGNIFICANT_DATA;
   }
 
   // Remove the first `aNumEntries` entries.
-  mTransactions.RemoveElementsAt(0, aNumEntries);
+  mEntries.RemoveElementsAt(0, aNumEntries);
 
   // Adjust the indices, but don't let them go below -1.
   mIndex -= aNumEntries;
   mIndex = std::max(mIndex, -1);
   mRequestedIndex -= aNumEntries;
   mRequestedIndex = std::max(mRequestedIndex, -1);
 
   NOTIFY_LISTENERS(OnLengthChanged, (Length()));
@@ -879,17 +872,17 @@ nsSHistory::ReplaceEntry(int32_t aIndex,
     return NS_ERROR_FAILURE;
   }
 
   aReplaceEntry->SetSHistory(this);
 
   NOTIFY_LISTENERS(OnHistoryReplaceEntry, (aIndex));
 
   aReplaceEntry->SetPersist(true);
-  mTransactions[aIndex] = aReplaceEntry;
+  mEntries[aIndex] = aReplaceEntry;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSHistory::NotifyOnHistoryReload(nsIURI* aReloadURI, uint32_t aReloadFlags,
                                   bool* aCanReload)
 {
@@ -909,17 +902,17 @@ nsSHistory::EvictOutOfRangeContentViewer
 }
 
 NS_IMETHODIMP
 nsSHistory::EvictAllContentViewers()
 {
   // XXXbz we don't actually do a good job of evicting things as we should, so
   // we might have viewers quite far from mIndex.  So just evict everything.
   for (int32_t i = 0; i < Length(); i++) {
-    EvictContentViewerForTransaction(mTransactions[i]);
+    EvictContentViewerForEntry(mEntries[i]);
   }
 
   return NS_OK;
 }
 
 nsresult
 nsSHistory::Reload(uint32_t aReloadFlags)
 {
@@ -977,21 +970,21 @@ nsSHistory::EvictOutOfRangeWindowContent
   // 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
   //
   // to ensure that this SHistory object isn't responsible for more than
   // VIEWER_WINDOW content viewers.  But our job is complicated by the
-  // fact that two transactions which are related by either hash navigations or
+  // fact that two entries which are related by either hash navigations or
   // history.pushState will have the same content viewer.
   //
   // To illustrate the issue, suppose VIEWER_WINDOW = 3 and we have four
-  // linked transactions in our history.  Suppose we then add a new content
+  // linked entries in our history.  Suppose we then add a new content
   // viewer and call into this function.  So the history looks like:
   //
   //   A A A A B
   //     +     *
   //
   // where the letters are content viewers and + and * denote the beginning and
   // end of the range aIndex +/- VIEWER_WINDOW.
   //
@@ -1022,94 +1015,93 @@ nsSHistory::EvictOutOfRangeWindowContent
        "Length()=%d. Safe range [%d, %d]",
        aIndex, Length(), startSafeIndex, endSafeIndex));
 
   // The content viewers in range aIndex -/+ VIEWER_WINDOW will not be
   // evicted.  Collect a set of them so we don't accidentally evict one of them
   // if it appears outside this range.
   nsCOMArray<nsIContentViewer> safeViewers;
   for (int32_t i = startSafeIndex; i <= endSafeIndex; i++) {
-    nsCOMPtr<nsIContentViewer> viewer =
-      GetContentViewerForTransaction(mTransactions[i]);
+    nsCOMPtr<nsIContentViewer> viewer = GetContentViewerForEntry(mEntries[i]);
     safeViewers.AppendObject(viewer);
   }
 
   // Walk the SHistory list and evict any content viewers that aren't safe.
   // (It's important that the condition checks Length(), rather than a cached
   // copy of Length(), because the length might change between iterations.)
   for (int32_t i = 0; i < Length(); i++) {
-    nsCOMPtr<nsISHEntry> trans = mTransactions[i];
-    nsCOMPtr<nsIContentViewer> viewer = GetContentViewerForTransaction(trans);
+    nsCOMPtr<nsISHEntry> entry = mEntries[i];
+    nsCOMPtr<nsIContentViewer> viewer = GetContentViewerForEntry(entry);
     if (safeViewers.IndexOf(viewer) == -1) {
-      EvictContentViewerForTransaction(trans);
+      EvictContentViewerForEntry(entry);
     }
   }
 }
 
 namespace {
 
-class TransactionAndDistance
+class EntryAndDistance
 {
 public:
-  TransactionAndDistance(nsSHistory* aSHistory, nsISHEntry* aTrans, uint32_t aDist)
+  EntryAndDistance(nsSHistory* aSHistory, nsISHEntry* aEntry, uint32_t aDist)
     : mSHistory(aSHistory)
-    , mTransaction(aTrans)
+    , mEntry(aEntry)
     , mLastTouched(0)
     , mDistance(aDist)
   {
-    mViewer = GetContentViewerForTransaction(aTrans);
-    NS_ASSERTION(mViewer, "Transaction should have a content viewer");
+    mViewer = GetContentViewerForEntry(aEntry);
+    NS_ASSERTION(mViewer, "Entry should have a content viewer");
 
-    mTransaction->GetLastTouched(&mLastTouched);
+    mEntry->GetLastTouched(&mLastTouched);
   }
 
-  bool operator<(const TransactionAndDistance& aOther) const
+  bool operator<(const EntryAndDistance& aOther) const
   {
     // Compare distances first, and fall back to last-accessed times.
     if (aOther.mDistance != this->mDistance) {
       return this->mDistance < aOther.mDistance;
     }
 
     return this->mLastTouched < aOther.mLastTouched;
   }
 
-  bool operator==(const TransactionAndDistance& aOther) const
+  bool operator==(const EntryAndDistance& aOther) const
   {
     // This is a little silly; we need == so the default comaprator can be
     // instantiated, but this function is never actually called when we sort
-    // the list of TransactionAndDistance objects.
+    // the list of EntryAndDistance objects.
     return aOther.mDistance == this->mDistance &&
            aOther.mLastTouched == this->mLastTouched;
   }
 
   RefPtr<nsSHistory> mSHistory;
-  nsCOMPtr<nsISHEntry> mTransaction;
+  nsCOMPtr<nsISHEntry> mEntry;
   nsCOMPtr<nsIContentViewer> mViewer;
   uint32_t mLastTouched;
   int32_t mDistance;
 };
 
 } // namespace
 
 // static
 void
 nsSHistory::GloballyEvictContentViewers()
 {
-  // First, collect from each SHistory object the transactions which have a
-  // cached content viewer.  Associate with each transaction its distance from
-  // its SHistory's current index.
+  // First, collect from each SHistory object the entries which have a cached
+  // content viewer. Associate with each entry its distance from its SHistory's
+  // current index.
 
-  nsTArray<TransactionAndDistance> transactions;
+  nsTArray<EntryAndDistance> entries;
 
   for (auto shist : gSHistoryList) {
 
-    // Maintain a list of the transactions which have viewers and belong to
+    // Maintain a list of the entries which have viewers and belong to
     // this particular shist object.  We'll add this list to the global list,
-    // |transactions|, eventually.
-    nsTArray<TransactionAndDistance> shTransactions;
+    // |entries|, eventually.
+    nsTArray<EntryAndDistance> shEntries;
 
     // Content viewers are likely to exist only within shist->mIndex -/+
     // VIEWER_WINDOW, so only search within that range.
     //
     // A content viewer might exist outside that range due to either:
     //
     //   * history.pushState or hash navigations, in which case a copy of the
     //     content viewer should exist within the range, or
@@ -1117,129 +1109,128 @@ nsSHistory::GloballyEvictContentViewers(
     //   * bugs which cause us not to call nsSHistory::EvictContentViewers()
     //     often enough.  Once we do call EvictContentViewers() for the
     //     SHistory object in question, we'll do a full search of its history
     //     and evict the out-of-range content viewers, so we don't bother here.
     //
     int32_t startIndex, endIndex;
     shist->WindowIndices(shist->mIndex, &startIndex, &endIndex);
     for (int32_t i = startIndex; i <= endIndex; i++) {
-      nsCOMPtr<nsISHEntry> trans = shist->mTransactions[i];
+      nsCOMPtr<nsISHEntry> entry = shist->mEntries[i];
       nsCOMPtr<nsIContentViewer> contentViewer =
-        GetContentViewerForTransaction(trans);
+        GetContentViewerForEntry(entry);
 
       if (contentViewer) {
         // Because one content viewer might belong to multiple SHEntries, we
-        // have to search through shTransactions to see if we already know
+        // have to search through shEntries to see if we already know
         // about this content viewer.  If we find the viewer, update its
         // distance from the SHistory's index and continue.
         bool found = false;
-        for (uint32_t j = 0; j < shTransactions.Length(); j++) {
-          TransactionAndDistance& container = shTransactions[j];
+        for (uint32_t j = 0; j < shEntries.Length(); j++) {
+          EntryAndDistance& container = shEntries[j];
           if (container.mViewer == contentViewer) {
             container.mDistance = std::min(container.mDistance,
                                            DeprecatedAbs(i - shist->mIndex));
             found = true;
             break;
           }
         }
 
-        // If we didn't find a TransactionAndDistance for this content viewer,
-        // make a new one.
+        // If we didn't find a EntryAndDistance for this content viewer, make a
+        // new one.
         if (!found) {
-          TransactionAndDistance container(shist, trans,
-                                           DeprecatedAbs(i - shist->mIndex));
-          shTransactions.AppendElement(container);
+          EntryAndDistance container(shist, entry,
+                                     DeprecatedAbs(i - shist->mIndex));
+          shEntries.AppendElement(container);
         }
       }
     }
 
-    // We've found all the transactions belonging to shist which have viewers.
-    // Add those transactions to our global list and move on.
-    transactions.AppendElements(shTransactions);
+    // We've found all the entries belonging to shist which have viewers.
+    // Add those entries to our global list and move on.
+    entries.AppendElements(shEntries);
   }
 
   // We now have collected all cached content viewers.  First check that we
   // have enough that we actually need to evict some.
-  if ((int32_t)transactions.Length() <= sHistoryMaxTotalViewers) {
+  if ((int32_t)entries.Length() <= sHistoryMaxTotalViewers) {
     return;
   }
 
-  // If we need to evict, sort our list of transactions and evict the largest
+  // If we need to evict, sort our list of entries and evict the largest
   // ones.  (We could of course get better algorithmic complexity here by using
   // a heap or something more clever.  But sHistoryMaxTotalViewers isn't large,
   // so let's not worry about it.)
-  transactions.Sort();
+  entries.Sort();
 
-  for (int32_t i = transactions.Length() - 1; i >= sHistoryMaxTotalViewers;
+  for (int32_t i = entries.Length() - 1; i >= sHistoryMaxTotalViewers;
        --i) {
-    (transactions[i].mSHistory)->
-      EvictContentViewerForTransaction(transactions[i].mTransaction);
+    (entries[i].mSHistory)->EvictContentViewerForEntry(entries[i].mEntry);
   }
 }
 
 nsresult
-nsSHistory::FindTransactionForBFCache(nsIBFCacheEntry* aEntry,
-                                      nsISHEntry** aResult,
-                                      int32_t* aResultIndex)
+nsSHistory::FindEntryForBFCache(nsIBFCacheEntry* aBFEntry,
+                                nsISHEntry** aResult,
+                                int32_t* aResultIndex)
 {
   *aResult = nullptr;
   *aResultIndex = -1;
 
   int32_t startIndex, endIndex;
   WindowIndices(mIndex, &startIndex, &endIndex);
 
   for (int32_t i = startIndex; i <= endIndex; ++i) {
-    nsCOMPtr<nsISHEntry> trans = mTransactions[i];
+    nsCOMPtr<nsISHEntry> shEntry = mEntries[i];
 
-    // Does entry have the same BFCacheEntry as the argument to this method?
-    if (trans->HasBFCacheEntry(aEntry)) {
-      trans.forget(aResult);
+    // Does shEntry have the same BFCacheEntry as the argument to this method?
+    if (shEntry->HasBFCacheEntry(aBFEntry)) {
+      shEntry.forget(aResult);
       *aResultIndex = i;
       return NS_OK;
     }
   }
   return NS_ERROR_FAILURE;
 }
 
 nsresult
-nsSHistory::EvictExpiredContentViewerForEntry(nsIBFCacheEntry* aEntry)
+nsSHistory::EvictExpiredContentViewerForEntry(nsIBFCacheEntry* aBFEntry)
 {
   int32_t index;
-  nsCOMPtr<nsISHEntry> trans;
-  FindTransactionForBFCache(aEntry, getter_AddRefs(trans), &index);
+  nsCOMPtr<nsISHEntry> shEntry;
+  FindEntryForBFCache(aBFEntry, getter_AddRefs(shEntry), &index);
 
   if (index == mIndex) {
     NS_WARNING("How did the current SHEntry expire?");
     return NS_OK;
   }
 
-  if (trans) {
-    EvictContentViewerForTransaction(trans);
+  if (shEntry) {
+    EvictContentViewerForEntry(shEntry);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSHistory::AddToExpirationTracker(nsIBFCacheEntry* aEntry)
+nsSHistory::AddToExpirationTracker(nsIBFCacheEntry* aBFEntry)
 {
-  RefPtr<nsSHEntryShared> entry = static_cast<nsSHEntryShared*>(aEntry);
+  RefPtr<nsSHEntryShared> entry = static_cast<nsSHEntryShared*>(aBFEntry);
   if (!mHistoryTracker || !entry) {
     return NS_ERROR_FAILURE;
   }
 
   mHistoryTracker->AddObject(entry);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSHistory::RemoveFromExpirationTracker(nsIBFCacheEntry* aEntry)
+nsSHistory::RemoveFromExpirationTracker(nsIBFCacheEntry* aBFEntry)
 {
-  RefPtr<nsSHEntryShared> entry = static_cast<nsSHEntryShared*>(aEntry);
+  RefPtr<nsSHEntryShared> entry = static_cast<nsSHEntryShared*>(aBFEntry);
   MOZ_ASSERT(mHistoryTracker && !mHistoryTracker->IsEmpty());
   if (!mHistoryTracker || !entry) {
     return NS_ERROR_FAILURE;
   }
 
   mHistoryTracker->RemoveObject(entry);
   return NS_OK;
 }
@@ -1363,29 +1354,29 @@ nsSHistory::RemoveDuplicate(int32_t aInd
   nsresult rv;
   nsCOMPtr<nsISHEntry> root1, root2;
   rv = GetEntryAtIndex(aIndex, getter_AddRefs(root1));
   NS_ENSURE_SUCCESS(rv, false);
   rv = GetEntryAtIndex(compareIndex, getter_AddRefs(root2));
   NS_ENSURE_SUCCESS(rv, false);
 
   if (IsSameTree(root1, root2)) {
-    mTransactions.RemoveElementAt(aIndex);
+    mEntries.RemoveElementAt(aIndex);
 
     if (mRootDocShell) {
-      static_cast<nsDocShell*>(mRootDocShell)->HistoryTransactionRemoved(aIndex);
+      static_cast<nsDocShell*>(mRootDocShell)->HistoryEntryRemoved(aIndex);
     }
 
-    // Adjust our indices to reflect the removed transaction
+    // Adjust our indices to reflect the removed entry.
     if (mIndex > aIndex) {
       mIndex = mIndex - 1;
       NOTIFY_LISTENERS(OnIndexChanged, (mIndex));
     }
 
-    // NB: If the transaction we are removing is the transaction currently
+    // NB: If the entry we are removing is the entry currently
     // being navigated to (mRequestedIndex) then we adjust the index
     // only if we're not keeping the next entry (because if we are keeping
     // the next entry (because the current is a duplicate of the next), then
     // that entry slides into the spot that we're currently pointing to.
     // We don't do this adjustment for mIndex because mIndex cannot equal
     // aIndex.
 
     // NB: We don't need to guard on mRequestedIndex being nonzero here,
@@ -1439,23 +1430,23 @@ nsSHistory::RemoveDynEntries(int32_t aIn
     GetDynamicChildren(entry, toBeRemovedEntries, true);
     if (toBeRemovedEntries.Length()) {
       RemoveEntries(toBeRemovedEntries, aIndex);
     }
   }
 }
 
 void
-nsSHistory::RemoveDynEntriesForBFCacheEntry(nsIBFCacheEntry* aEntry)
+nsSHistory::RemoveDynEntriesForBFCacheEntry(nsIBFCacheEntry* aBFEntry)
 {
   int32_t index;
-  nsCOMPtr<nsISHEntry> trans;
-  FindTransactionForBFCache(aEntry, getter_AddRefs(trans), &index);
-  if (trans) {
-    RemoveDynEntries(index, trans);
+  nsCOMPtr<nsISHEntry> shEntry;
+  FindEntryForBFCache(aBFEntry, getter_AddRefs(shEntry), &index);
+  if (shEntry) {
+    RemoveDynEntries(index, shEntry);
   }
 }
 
 NS_IMETHODIMP
 nsSHistory::UpdateIndex()
 {
   // Update the actual index with the right value.
   if (mIndex != mRequestedIndex && mRequestedIndex != -1) {
--- a/docshell/shistory/nsSHistory.h
+++ b/docshell/shistory/nsSHistory.h
@@ -138,53 +138,53 @@ private:
                         long aLoadType);
 
   nsresult LoadEntry(int32_t aIndex, long aLoadType, uint32_t aHistCmd);
 
 #ifdef DEBUG
   nsresult PrintHistory();
 #endif
 
-  // Find the transaction for a given bfcache entry. It only looks up between
+  // Find the history entry for a given bfcache entry. It only looks up between
   // the range where alive viewers may exist (i.e nsISHistory::VIEWER_WINDOW).
-  nsresult FindTransactionForBFCache(nsIBFCacheEntry* aEntry,
-                                     nsISHEntry** aResult,
-                                     int32_t* aResultIndex);
+  nsresult FindEntryForBFCache(nsIBFCacheEntry* aBFEntry,
+                               nsISHEntry** aResult,
+                               int32_t* aResultIndex);
 
   // Evict content viewers in this window which don't lie in the "safe" range
   // around aIndex.
   void EvictOutOfRangeWindowContentViewers(int32_t aIndex);
-  void EvictContentViewerForTransaction(nsISHEntry* aTrans);
+  void EvictContentViewerForEntry(nsISHEntry* aEntry);
   static void GloballyEvictContentViewers();
   static void GloballyEvictAllContentViewers();
 
   // Calculates a max number of total
   // content viewers to cache, based on amount of total memory
   static uint32_t CalcMaxTotalViewers();
 
   nsresult LoadNextPossibleEntry(int32_t aNewIndex, long aLoadType,
                                  uint32_t aHistCmd);
 
-  // aIndex is the index of the transaction which may be removed.
+  // aIndex is the index of the entry which may be removed.
   // If aKeepNext is true, aIndex is compared to aIndex + 1,
   // otherwise comparison is done to aIndex - 1.
   bool RemoveDuplicate(int32_t aIndex, bool aKeepNext);
 
   // Track all bfcache entries and evict on expiration.
   mozilla::UniquePtr<HistoryTracker> mHistoryTracker;
 
-  nsTArray<nsCOMPtr<nsISHEntry>> mTransactions; // entries are never null
+  nsTArray<nsCOMPtr<nsISHEntry>> mEntries; // entries are never null
   int32_t mIndex;           // -1 means "no index"
   int32_t mRequestedIndex;  // -1 means "no requested index"
 
   void WindowIndices(int32_t aIndex, int32_t* aOutStartIndex,
                      int32_t* aOutEndIndex);
 
-  // Length of mTransactions.
-  int32_t Length() { return int32_t(mTransactions.Length()); }
+  // Length of mEntries.
+  int32_t Length() { return int32_t(mEntries.Length()); }
 
   // Session History listeners
   nsAutoTObserverArray<nsWeakPtr, 2> mListeners;
 
   // Weak reference. Do not refcount this.
   nsIDocShell* mRootDocShell;
 
   // Max viewers allowed total, across all SHistory objects
--- a/docshell/test/navigation/file_bug1326251.html
+++ b/docshell/test/navigation/file_bug1326251.html
@@ -44,18 +44,18 @@
         window.location = 'goback.html';
       },
       async function() {
         let windowWrap = SpecialPowers.wrap(window);
         let docShell = windowWrap.docShell;
         let shistory = docShell.QueryInterface(SpecialPowers.Ci.nsIWebNavigation)
                                .sessionHistory;
         // Now staticFrame has frame0 -> frame1 -> frame2.
-        opener.is(docShell.previousTransIndex, 3, 'docShell.previousTransIndex');
-        opener.is(docShell.loadedTransIndex, 2, 'docShell.loadedTransIndex');
+        opener.is(docShell.previousEntryIndex, 3, 'docShell.previousEntryIndex');
+        opener.is(docShell.loadedEntryIndex, 2, 'docShell.loadedEntryIndex');
         opener.is(shistory.index, 2, 'shistory.index');
         opener.is(history.length, 4, 'history.length');
         opener.is(document.getElementById('staticFrame').contentWindow.location.href, BASE_URL + 'frame2.html', 'staticFrame location');
         opener.ok(!document.getElementById('dynamicFrame'), 'dynamicFrame should not exist');
 
         // Test 4: Load a nested frame in the static frame, navigate the inner
         // static frame, add a inner dynamic frame and navigate the dynamic
         // frame. Then navigate the outer static frame and go back. The inner
@@ -104,18 +104,18 @@
       },
       async function() {
         let windowWrap = SpecialPowers.wrap(window);
         let docShell = windowWrap.docShell;
         let shistory = docShell.QueryInterface(SpecialPowers.Ci.nsIWebNavigation)
                                .sessionHistory;
         // staticFrame:       frame0 -> frame1 -> frame2 -> iframe_static
         // innerStaticFrame:                                frame0        -> frame1
-        opener.is(docShell.previousTransIndex, 5, 'docShell.previousTransIndex');
-        opener.is(docShell.loadedTransIndex, 4, 'docShell.loadedTransIndex');
+        opener.is(docShell.previousEntryIndex, 5, 'docShell.previousEntryIndex');
+        opener.is(docShell.loadedEntryIndex, 4, 'docShell.loadedEntryIndex');
         opener.is(shistory.index, 4, 'shistory.index');
         opener.is(history.length, 6, 'history.length');
         let staticFrame = document.getElementById('staticFrame');
         let innerStaticFrame = staticFrame.contentDocument.getElementById('staticFrame');
         opener.is(innerStaticFrame.contentDocument.location.href, BASE_URL + 'frame1.html', 'innerStaticFrame location');
         opener.ok(!staticFrame.contentDocument.getElementById('dynamicFrame'), 'innerDynamicFrame should not exist');
 
         // Test 6: Insert and navigate inner dynamic frame and then reload outer
--- a/docshell/test/navigation/file_bug534178.html
+++ b/docshell/test/navigation/file_bug534178.html
@@ -7,17 +7,17 @@
         var isOK = false;
         try {
           isOK = history.previous != location;
         } catch(ex) {
           // history.previous should throw if this is the first page in shistory.
           isOK = true;
         }
         document.body.textContent = isOK ? "PASSED" : "FAILED";
-        opener.ok(isOK, "Duplicate session history transactions should have been removed!");
+        opener.ok(isOK, "Duplicate session history entries should have been removed!");
         opener.nextTest();
         window.close();
       }
       function ifrload() {
         setTimeout(testDone, 0);
       }
       function test() {
         var ifr = document.getElementsByTagName("iframe")[0];
--- a/docshell/test/navigation/test_sessionhistory.html
+++ b/docshell/test/navigation/test_sessionhistory.html
@@ -21,17 +21,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 var testFiles =
   [ "file_bug462076_1.html",         // Dynamic frames before onload
     "file_bug462076_2.html",         // Dynamic frames when handling onload
     "file_bug462076_3.html",         // Dynamic frames after onload
     "file_bug508537_1.html",         // Dynamic frames and forward-back
     "file_document_write_1.html",    // Session history + document.write
     //"file_static_and_dynamic_1.html",// Static and dynamic frames and forward-back
-    "file_bug534178.html",           // Session history transaction clean-up.
+    "file_bug534178.html",           // Session history entry clean-up.
     "file_fragment_handling_during_load.html",
     "file_nested_frames.html",
     "file_shiftReload_and_pushState.html",
     "file_scrollRestoration.html",
     "file_bug1300461.html",
     "file_bug1326251.html",
     "file_bug1379762-1.html",
     "file_bug1379762-2.html",
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -2242,18 +2242,18 @@ nsDocumentViewer::Show(void)
       // SHistory and we need the SHistory to evict content viewers
       nsCOMPtr<nsIDocShellTreeItem> root;
       treeItem->GetSameTypeRootTreeItem(getter_AddRefs(root));
       nsCOMPtr<nsIWebNavigation> webNav = do_QueryInterface(root);
       RefPtr<ChildSHistory> history = webNav->GetSessionHistory();
       if (history) {
         int32_t prevIndex,loadedIndex;
         nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(treeItem);
-        docShell->GetPreviousTransIndex(&prevIndex);
-        docShell->GetLoadedTransIndex(&loadedIndex);
+        docShell->GetPreviousEntryIndex(&prevIndex);
+        docShell->GetLoadedEntryIndex(&loadedIndex);
 #ifdef DEBUG_PAGE_CACHE
         printf("About to evict content viewers: prev=%d, loaded=%d\n",
                prevIndex, loadedIndex);
 #endif
         history->LegacySHistory()->EvictOutOfRangeContentViewers(loadedIndex);
       }
     }
   }
--- a/toolkit/modules/sessionstore/SessionHistory.jsm
+++ b/toolkit/modules/sessionstore/SessionHistory.jsm
@@ -79,22 +79,22 @@ var SessionHistoryInternal = {
     // how many we skipped, so we can sanitiy-check the current history index
     // and also determine whether we need to get any fallback data or not.
     let skippedCount = 0, entryCount = 0;
 
     if (history && history.count > 0) {
       let shistory = history.legacySHistory.QueryInterface(Ci.nsISHistory);
       let count = shistory.count;
       for ( ; entryCount < count; entryCount++) {
-        let txn = shistory.GetTransactionAtIndex(entryCount);
+        let shEntry = shistory.getEntryAtIndex(entryCount);
         if (entryCount <= aFromIdx) {
           skippedCount++;
           continue;
         }
-        let entry = this.serializeEntry(txn);
+        let entry = this.serializeEntry(shEntry);
         data.entries.push(entry);
       }
 
       // Ensure the index isn't out of bounds if an exception was thrown above.
       data.index = Math.min(history.index + 1, entryCount);
     }
 
     // If either the session history isn't available yet or doesn't have any