202
edits
BrettWilson (talk | contribs) (Added review) |
BrettWilson (talk | contribs) (Proposal details) |
||
| Line 116: | Line 116: | ||
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. | 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 "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. | |||
Global history would maintain queues of URLs for typed and bookmarked flags. When new URLs come through that have no referrer, it would check these queues to see if the URL had either of these flags set. This requires no changes to non-history system code, but it could be confused in some unusual cases (for examples, if the user types and and follows a bookmark in quick succession for the same URL). The side effect of getting it wrong is very minor. | |||
Review of changes in old code: | Review of changes in old code: | ||
| Line 127: | Line 126: | ||
* New nsIGlobalHistory3 interface defined in toolkit. | * New nsIGlobalHistory3 interface defined in toolkit. | ||
* New virtual function in docloader. | * New virtual function OnRedirectStateChange in docloader. | ||
* Move redirect code from OnStateChange to | * Move redirect code from OnStateChange to onRedirectStateChange. | ||
* Change docshell AddToGlobalHistory to use the new AddURIFrom if it is available. | * Change docshell AddToGlobalHistory to use the new AddURIFrom if it is available. | ||
* Implement nsIWritablePropertyBag | * Implement nsIWritablePropertyBag on the docshell. | ||
edits