Commit 62fbb293 authored by timothy@apple.com's avatar timothy@apple.com

Fix a bug in the Web Inspector where it would show scripts

        from previous pages when toggling the debugger off and back on.

        https://bugs.webkit.org/show_bug.cgi?id=25095
        rdar://problem/6769970

        Reviewed by John Sullivan.

        * bindings/js/ScriptCachedFrameData.cpp:
        (WebCore::ScriptCachedFrameData::ScriptCachedFrameData): Null out the
        debugger for the scriptController. This balances the attachDebugger
        that was already in ScriptCachedFrameData::restore.
        (WebCore::ScriptCachedFrameData::restore): Clean up an if statement.
        * bindings/js/ScriptController.cpp:
        (WebCore::ScriptController::clearWindowShell): Clear the debugger from
        the current window before setting the new window.
        * inspector/JavaScriptDebugServer.cpp:
        (WebCore::JavaScriptDebugServer::recompileAllJSFunctions): Only accumulate
        source providers for code associated this as the debugger.

git-svn-id: svn://svn.chromium.org/blink/trunk@42400 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 23f135d3
2009-04-10 Timothy Hatcher <timothy@apple.com>
Fix a bug in the Web Inspector where it would show scripts
from previous pages when toggling the debugger off and back on.
https://bugs.webkit.org/show_bug.cgi?id=25095
rdar://problem/6769970
Reviewed by John Sullivan.
* bindings/js/ScriptCachedFrameData.cpp:
(WebCore::ScriptCachedFrameData::ScriptCachedFrameData): Null out the
debugger for the scriptController. This balances the attachDebugger
that was already in ScriptCachedFrameData::restore.
(WebCore::ScriptCachedFrameData::restore): Clean up an if statement.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::clearWindowShell): Clear the debugger from
the current window before setting the new window.
* inspector/JavaScriptDebugServer.cpp:
(WebCore::JavaScriptDebugServer::recompileAllJSFunctions): Only accumulate
source providers for code associated this as the debugger.
2009-04-10 Pierre d'Herbemont <pdherbemont@apple.com> 2009-04-10 Pierre d'Herbemont <pdherbemont@apple.com>
Reviewed by Adele Peterson. Reviewed by Adele Peterson.
...@@ -50,6 +50,7 @@ ScriptCachedFrameData::ScriptCachedFrameData(Frame* frame) ...@@ -50,6 +50,7 @@ ScriptCachedFrameData::ScriptCachedFrameData(Frame* frame)
ScriptController* scriptController = frame->script(); ScriptController* scriptController = frame->script();
if (scriptController->haveWindowShell()) { if (scriptController->haveWindowShell()) {
m_window = scriptController->windowShell()->window(); m_window = scriptController->windowShell()->window();
scriptController->attachDebugger(0);
} }
} }
...@@ -69,8 +70,7 @@ void ScriptCachedFrameData::restore(Frame* frame) ...@@ -69,8 +70,7 @@ void ScriptCachedFrameData::restore(Frame* frame)
JSLock lock(false); JSLock lock(false);
ScriptController* scriptController = frame->script(); ScriptController* scriptController = frame->script();
if (scriptController->haveWindowShell()) { if (JSDOMWindowShell* windowShell = scriptController->windowShell()) {
JSDOMWindowShell* windowShell = scriptController->windowShell();
if (m_window) { if (m_window) {
windowShell->setWindow(m_window.get()); windowShell->setWindow(m_window.get());
} else { } else {
......
...@@ -122,8 +122,13 @@ void ScriptController::clearWindowShell() ...@@ -122,8 +122,13 @@ void ScriptController::clearWindowShell()
return; return;
JSLock lock(false); JSLock lock(false);
// Clear the debugger from the current window before setting the new window.
attachDebugger(0);
m_windowShell->window()->clear(); m_windowShell->window()->clear();
m_windowShell->setWindow(m_frame->domWindow()); m_windowShell->setWindow(m_frame->domWindow());
if (Page* page = m_frame->page()) { if (Page* page = m_frame->page()) {
attachDebugger(page->debugger()); attachDebugger(page->debugger());
m_windowShell->window()->setProfileGroup(page->group().identifier()); m_windowShell->window()->setProfileGroup(page->group().identifier());
......
...@@ -580,7 +580,7 @@ void JavaScriptDebugServer::recompileAllJSFunctions(Timer<JavaScriptDebugServer> ...@@ -580,7 +580,7 @@ void JavaScriptDebugServer::recompileAllJSFunctions(Timer<JavaScriptDebugServer>
result.first->second = newBody; result.first->second = newBody;
function->setBody(newBody.release()); function->setBody(newBody.release());
if (hasListeners()) if (hasListeners() && function->scope().globalObject()->debugger() == this)
sourceProviders.add(sourceCode.provider(), exec); sourceProviders.add(sourceCode.provider(), exec);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment