Browser History:Redirects: Difference between revisions

Jump to navigation Jump to search
m
typo
m (typo)
Line 82: Line 82:
=== Redirecting from the DocShell/DocLoader level ===
=== 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.
nsDocLoader implements 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. No information is available about the new destination channel or URI. When these flags are set, it calls AddToGlobalHistory with a redirect flag of true.
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. No information is available about the new destination channel or URI. When these flags are set, it calls AddToGlobalHistory with a redirect flag of true.
202

edits

Navigation menu