Bug 1490524 - Streamline nsISHistory a little more. r=nika

- Move VIEWER_WINDOW from nsISHistory to nsSHistory.

- Mark some C++-only nsISHistory methods as [noscript, notxpcom].

- Add gotoIndex() to nsISHistory so that LegacySHistoryImpl() can be removed.
This commit is contained in:
Nicholas Nethercote
2018-09-11 16:08:39 +10:00
parent ab66aa04ba
commit e7b4ef7cd5
6 changed files with 37 additions and 47 deletions

View File

@@ -4146,7 +4146,7 @@ nsDocShell::GotoIndex(int32_t aIndex)
}
RefPtr<ChildSHistory> rootSH = GetRootSessionHistory();
NS_ENSURE_TRUE(rootSH, NS_ERROR_FAILURE);
return rootSH->LegacySHistoryImpl()->GotoIndex(aIndex);
return rootSH->LegacySHistory()->GotoIndex(aIndex);
}
NS_IMETHODIMP
@@ -11924,9 +11924,8 @@ nsDocShell::AddState(JS::Handle<JS::Value> aData, const nsAString& aTitle,
} else {
nsCOMPtr<nsISHEntry> rootSHEntry = nsSHistory::GetRootSHEntry(newSHEntry);
int32_t index = -1;
rv = rootSH->LegacySHistory()->GetIndexOfEntry(rootSHEntry, &index);
if (NS_SUCCEEDED(rv) && index > -1) {
int32_t index = rootSH->LegacySHistory()->GetIndexOfEntry(rootSHEntry);
if (index > -1) {
rootSH->LegacySHistory()->ReplaceEntry(index, rootSHEntry);
}
}