From 0e0bc1c5ee7d40016eb3b5ffd9094f3262cf412b Mon Sep 17 00:00:00 2001 From: "bryner%brianryner.com" Date: Thu, 25 Aug 2005 07:06:59 +0000 Subject: [PATCH] Move resuming of timeouts to after we've restored the docshell hierarchy, so that they're restored correctly for subframes. Bug 305156, r=cbiesinger, sr=jst. git-svn-id: svn://10.0.0.236/trunk@178919 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShell.cpp | 4 ++++ mozilla/dom/public/base/nsPIDOMWindow.h | 7 +++++-- mozilla/dom/src/base/nsGlobalWindow.cpp | 2 +- mozilla/dom/src/base/nsGlobalWindow.h | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index e27b5c162d7..dac6db5c417 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -5389,6 +5389,10 @@ nsDocShell::RestoreFromHistory() } } + // Now that all of the child docshells have been put into place, we can + // restart the timers for the window and all of the child frames. + privWin->ResumeTimeouts(); + // Restore the refresh URI list. The refresh timers will be restarted // when EndPageLoad() is called. mLSHE->GetRefreshURIList(getter_AddRefs(mRefreshURIList)); diff --git a/mozilla/dom/public/base/nsPIDOMWindow.h b/mozilla/dom/public/base/nsPIDOMWindow.h index f55b2e65c9c..22a45350776 100644 --- a/mozilla/dom/public/base/nsPIDOMWindow.h +++ b/mozilla/dom/public/base/nsPIDOMWindow.h @@ -77,8 +77,8 @@ class nsIDocument; struct nsTimeout; #define NS_PIDOMWINDOW_IID \ -{ 0x1f9346e6, 0x3814, 0x4c3b, \ - { 0x9d, 0x04, 0x0b, 0x93, 0x86, 0x53, 0x2b, 0xbf } } +{ 0x55f987bc, 0xca30, 0x494c, \ + { 0xa9, 0x85, 0xf1, 0xf3, 0x4b, 0x9d, 0x47, 0xd8 } } class nsPIDOMWindow : public nsIDOMWindowInternal { @@ -267,6 +267,9 @@ public: // Restore the window state from aState. virtual nsresult RestoreWindowState(nsISupports *aState) = 0; + // Resume suspended timeouts in this window and in child windows. + virtual nsresult ResumeTimeouts() = 0; + nsPIDOMWindow *GetOuterWindow() { return mIsInnerWindow ? mOuterWindow : this; diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index 18c8539f9fa..499529bc559 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/dom/src/base/nsGlobalWindow.cpp @@ -6741,7 +6741,7 @@ nsGlobalWindow::RestoreWindowState(nsISupports *aState) holder->DidRestoreWindow(); - return inner->ResumeTimeouts(); + return NS_OK; } void diff --git a/mozilla/dom/src/base/nsGlobalWindow.h b/mozilla/dom/src/base/nsGlobalWindow.h index 14bb99ed74d..52f40270791 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.h +++ b/mozilla/dom/src/base/nsGlobalWindow.h @@ -394,7 +394,7 @@ protected: already_AddRefed GetMainWidget(); void SuspendTimeouts(); - nsresult ResumeTimeouts(); + virtual nsresult ResumeTimeouts(); void Freeze() {