Electrolysis/places that need session history

From MozillaWiki
Jump to: navigation, search

Conceptual breakdown of session history usage

  • History navigation: back/forward/reload/go to index. Some or all of these could probably use nsIWebNavigation instead, though there are some interesting behavior differences (e.g. location.reload() uses the nsIWebNavigation API while the browser's reload button uses the nsISHistory API and they behave differently in terms of flags passed in for the underlying load!). How to make goToIndex work sanely?
  • History data reading (history menu, back/forward buttons). These are done both on-demand (filling the history menu) and via history notifications (back/forward enabled state).
  • Identification of data for fetching from cache (using nsIWebPageDescriptor). This is what view-source does, e.g.
  • Session restore: serializes/deserializes the entire history. Needs to be able to hook it up to the docshells when done.
  • Save as: gets POST data from the session history.
  • Content uses of session history: limited to nsIDOMHistory and nsIDOMLocation, I think. Effectively the former lets one do length/back/forward/go. The other interface members are UniversalBrowserRead-only bunk, and we should remove them. The latter only needs reload() and replace(); the rest is basic navigation.
  • Issue: all embeddors needing to implement session history separately seems undesirable.

Places that need session history

This planning document is preparatory work for task "Session history for remote tabs" in [1]. It lists all the places that need (read / write) session history.

All the following objects make use of session history (or session history listener) in a certain way. For each of them, nsISHistory usage is detailled and links to code are provided.

NOTE: This list DOES NOT contain places that are part of /test subdirectories.

Places using Session History

WebNavigation interface || attribute sessionHistory ||

CCUncollectableMarker component || nsComPtr history ||

FrameLoader || nsComPtr ourHistory ||

DocShell component || nsComPtr shistory & rootSH ||

SHEntry Component || QI for nsISHistoryInternal ||

EmbedPrivate Component || public member mSessionHistory ||

WebBrowser Component || adds/removes SHistory listeners ||

DocumentViewer Component || QI for nsISHistoryInternal ||

browser.js || .sessionHistory & .history ||

web-panels.js || .sessionHistory & .history ||

viewSource.js || .sessionhistory ||

nsSessionStore.js || .history ||

help.js || .sessionHistory ||

nsLoginManagerPrompter.js || .sessionHistory ||

contentAreaUtils.js || .sessionHistory ||

Places using Session History Listener

SHistoryInternal interface || attribute listener ||

DocShell || nsComPtr listener||

WebBrowser || QI for nsISHistoryListener ||

WebBrowserChrome || derives from nsISHistoryListener ||