Changes

Jump to: navigation, search

Browser History:Redirects

298 bytes added, 21:49, 14 December 2005
Proposal details
This redirect function would attempt to QueryInterface the global history to a new interface we define (let's call it nsIGlobalHistory3 for now). If unsuccessful, it would revert to calling the old nsIGlobalHistory2.AddURI. Otherwise, it would call nsIGlobalHistory3.AddURIFrom and give it information about the redirect and a pointer to the docshell.
The "regular" calls to AddURI would also be changed to use the new AddURIFrom function.
The docshell will be extended to support nsIWritablePropertyBag. When the history system gets visit notifications, it can store necessary state on the docshell (probably just a 64-bit visit ID number). This way, it can associate a given page visit as coming from a specific docshell, and know which specific page visit it came from, even if the same document is open in more than one docshell.
The Global history system would treat these docshell pointers as opaque identifiers in a hashtable maintain queues of URLs for associating some state with. This state would include the typed and bookmarked information as discussed aboveflags. When new URLs come through that have no referrer, as well as it would check these queues to see if the visit ID URL had either of the previous page from the docshellthese flags set. This wayrequires no changes to non-history system code, we can tell when we get new notificaions exactly which visit was the source. In Docshell::Destroybut it could be confused in some unusual cases (for examples, if the global observer notification NS_WEBNAVIGATION_DESTROY is sent with user types and and follows a pointer to bookmark in quick succession for the docshellsame URL). The history service can observer these events and know to delete the corresponding stateside effect of getting it wrong is very minor.
Review of changes in old code:
* New nsIGlobalHistory3 interface defined in toolkit.
* New virtual function OnRedirectStateChange in docloader.
* Move redirect code from OnStateChange to new function in docshellonRedirectStateChange.
* Change docshell AddToGlobalHistory to use the new AddURIFrom if it is available.
* Implement nsIWritablePropertyBag in on the docshell.
202
edits

Navigation menu