53
edits
Line 9: | Line 9: | ||
== Restoration from history == | == Restoration from history == | ||
The restore process is mostly just a reversal of the saving process. < | The restore process is mostly just a reversal of the saving process. <code>nsDocShell::InternalLoad</code> checks whether the load is a history load and if so, whether it has a cached presentation. If it does, it calls <code>nsDocShell::RestorePresentation</code>. The major chunk of work here is simulating a load so that the progress notifications happen in a reasonable way, which is to say, as close to a normal load as possible. Because of this, chunks of code from <code>Embed()</code> and <code>CreateContentViewer()</code> are adapted into <code>RestoreFromHistory</code>. Once the new content viewer is set up, the document's channel is readded to the docshell's load group, which causes the required <code>STATE_START</code> notification. We then process subframes recursively, adding them to the loadgroup. To complete the notifications, the channels are then removed from the loadgroup, depth-first. We restart timeouts, refresh URIs, and plugins, and we're done. | ||
It's possible that the size of the docshell has changed since the presentation was stored. In this case, we need to resize the root view's widget to match the new size. This will cause the necessary reflows and repainting to occur. | It's possible that the size of the docshell has changed since the presentation was stored. In this case, we need to resize the root view's widget to match the new size. This will cause the necessary reflows and repainting to occur. | ||
== Eviction from history == | == Eviction from history == |
edits