Fixes a regression where the Page's debugger would not be reattached
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Apr 2008 17:05:43 +0000 (17:05 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Apr 2008 17:05:43 +0000 (17:05 +0000)
when a new JSDOMWindow is created.

Reviewed by Sam Weinig.

* bindings/js/kjs_proxy.cpp:
(WebCore::KJSProxy::clear): Call attachDebugger after creating the JSDOMWindow.
* history/CachedPage.cpp:
(WebCore::CachedPage::restore): For the case where the CachedPage doesn't
contain a window, reattach the debugger to the new JSDOMWindow by calling
proxy->attachDebugger. Also restore the setPageGroupIdentifier.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@32690 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/bindings/js/kjs_proxy.cpp
WebCore/history/CachedPage.cpp

index 19f04a8..f3233d2 100644 (file)
@@ -1,3 +1,17 @@
+2008-04-29  Timothy Hatcher  <timothy@apple.com>
+
+        Fixes a regression where the Page's debugger would not be reattached
+        when a new JSDOMWindow is created.
+
+        Reviewed by Sam Weinig.
+
+        * bindings/js/kjs_proxy.cpp:
+        (WebCore::KJSProxy::clear): Call attachDebugger after creating the JSDOMWindow.
+        * history/CachedPage.cpp:
+        (WebCore::CachedPage::restore): For the case where the CachedPage doesn't
+        contain a window, reattach the debugger to the new JSDOMWindow by calling
+        proxy->attachDebugger. Also restore the setPageGroupIdentifier.
+
 2008-04-29  Anatoli Papirovski  <apapirovski@mac.com>
 
         Reviewed by Darin Adler.
index 831facd..5bd1167 100644 (file)
@@ -112,8 +112,10 @@ void KJSProxy::clear()
     JSLock lock;
     m_windowWrapper->window()->clear();
     m_windowWrapper->setWindow(new JSDOMWindow(m_frame->domWindow(), m_windowWrapper));
-    if (Page* page = m_frame->page())
+    if (Page* page = m_frame->page()) {
+        attachDebugger(page->debugger());
         m_windowWrapper->window()->setPageGroupIdentifier(page->group().identifier());
+    }
 
     // There is likely to be a lot of garbage now.
     gcController().garbageCollectSoon();
index 38dc149..0b82976 100644 (file)
@@ -41,6 +41,7 @@
 #include "JSDOMWindowWrapper.h"
 #include "Logging.h"
 #include "Page.h"
+#include "PageGroup.h"
 #include "PausedTimeouts.h"
 #include "SystemTime.h"
 #include "kjs_proxy.h"
@@ -121,12 +122,15 @@ void CachedPage::restore(Page* page)
 
     KJSProxy* proxy = mainFrame->scriptProxy();
     if (proxy->haveWindowWrapper()) {
-        JSDOMWindowWrapper* windowWrapper = mainFrame->scriptProxy()->windowWrapper();
+        JSDOMWindowWrapper* windowWrapper = proxy->windowWrapper();
         if (m_window) {
             windowWrapper->setWindow(m_window.get());
             windowWrapper->window()->resumeTimeouts(m_pausedTimeouts.get());
-        } else
+        } else {
             windowWrapper->setWindow(new JSDOMWindow(mainFrame->domWindow(), windowWrapper));
+            proxy->attachDebugger(page->debugger());
+            windowWrapper->window()->setPageGroupIdentifier(page->group().identifier());
+        }
     }
 
 #if ENABLE(SVG)