202
edits
Changes
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.
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.