Bug 633413, don't bfcache so often, part 1, r=smaug

--HG--
extra : rebase_source : d30d8346c5f2526518386c895146ca6107b924fd
This commit is contained in:
bzbarsky@mit.edu 2011-02-12 01:12:20 -05:00
Родитель c0d0afb9d7
Коммит 529c2d2e6b
1 изменённых файлов: 12 добавлений и 6 удалений

Просмотреть файл

@ -1597,15 +1597,21 @@ DocumentViewerImpl::Destroy()
// Reverse ownership. Do this *after* calling sanitize so that sanitize
// doesn't cause mutations that make the SHEntry drop the presentation
if (savePresentation) {
mSHEntry->SetContentViewer(this);
}
else {
mSHEntry->SyncPresentationState();
}
// Grab a reference to mSHEntry before calling into things like
// SyncPresentationState that might mess with our members.
nsCOMPtr<nsISHEntry> shEntry = mSHEntry; // we'll need this below
mSHEntry = nsnull;
if (savePresentation) {
shEntry->SetContentViewer(this);
}
// Always sync the presentation state. That way even if someone screws up
// and shEntry has no window state at this point we'll be ok; we just won't
// cache ourselves.
shEntry->SyncPresentationState();
// Break the link from the document/presentation to the docshell, so that
// link traversals cannot affect the currently-loaded document.
// When the presentation is restored, Open() and InitInternal() will reset