Changes

Jump to: navigation, search

Browser History:Redirects

768 bytes added, 19:55, 14 December 2005
Bookmark Queries
An additional level of optimization would include the URL of the redirect source in the history column. If we ever need to add another redirect source and the redirect column is already full and does not match, we can specify some known string that indicates there is more than one source. This saves a little bit of time since in the next-most-common case where there is only one redirect source can use a simple query over history rather than a join over all visits. This optimization may or may not be worth it.
 
== How redirecting works ==
 
=== Redirecting from the DocShell/DocLoader level ===
 
nsDocLoader impleoments nsIChannelEventSink, which gets channel event messages. When it gets OnChannelRedirect, it has both the new and the old channels. It sets the STATE_IS_DOCUMENT flag if the channel has its LOAD_DOCUMENT_URI flag set, and fires a state change notification.
 
The state change firing notifies all WebProgressListeners that have been attached to the DocLoader. The DocShell, which is derived from the DocLoader, is registered as an event listener itself. Then we get the OnStateChange event with the SOURCE channel, which checks the STATE_IS_DOCUMENT and STATE_REDIRECTING flags. When these flags are set, it calls AddToGlobalHistory with a redirect flag of true.
202
edits

Navigation menu