[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.18-1-697-g2f78b87
timothy at apple.com
timothy at apple.com
Wed Jan 20 22:24:52 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit ba3b5d006c1ea00717c1c087ff585f5ba21f073c
Author: timothy at apple.com <timothy at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Jan 14 23:38:24 2010 +0000
Make the Web Inspector's JavaScript debugger work with isolated worlds.
Console evaluation is not performed in the correct world yet, tracked
by bug http://webkit.org/b/33692.
http://webkit.org/b/33690
Reviewed by Adam Roben.
* bindings/js/ScriptCachedFrameData.cpp:
(WebCore::ScriptCachedFrameData::restore): Attach the debugger to
any window shell, not just for the debugger world.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::clearWindowShell): Detach the debugger, and
reattach to all window shells, not just for the debugger world.
(WebCore::ScriptController::initScript): Attach the debugger to
any window shell, not just for the debugger world.
(WebCore::ScriptController::attachDebugger): Changed to loop through
all the window shells and call the new overloaded attachDebugger.
(WebCore::ScriptController::attachDebugger): Added. An overload that
takes a window shell to attach the debugger to. Has most of the
logic from the original attachDebugger.
* bindings/js/ScriptController.h: Added the new attachDebugger.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53295 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1788ad6..29b12eb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,28 @@
+2010-01-14 Timothy Hatcher <timothy at apple.com>
+
+ Make the Web Inspector's JavaScript debugger work with isolated worlds.
+ Console evaluation is not performed in the correct world yet, tracked
+ by bug http://webkit.org/b/33692.
+
+ http://webkit.org/b/33690
+
+ Reviewed by Adam Roben.
+
+ * bindings/js/ScriptCachedFrameData.cpp:
+ (WebCore::ScriptCachedFrameData::restore): Attach the debugger to
+ any window shell, not just for the debugger world.
+ * bindings/js/ScriptController.cpp:
+ (WebCore::ScriptController::clearWindowShell): Detach the debugger, and
+ reattach to all window shells, not just for the debugger world.
+ (WebCore::ScriptController::initScript): Attach the debugger to
+ any window shell, not just for the debugger world.
+ (WebCore::ScriptController::attachDebugger): Changed to loop through
+ all the window shells and call the new overloaded attachDebugger.
+ (WebCore::ScriptController::attachDebugger): Added. An overload that
+ takes a window shell to attach the debugger to. Has most of the
+ logic from the original attachDebugger.
+ * bindings/js/ScriptController.h: Added the new attachDebugger.
+
2010-01-14 Adam Roben <aroben at apple.com>
Make Cache::requestResource return 0 if the resource's load fails
diff --git a/WebCore/bindings/js/ScriptCachedFrameData.cpp b/WebCore/bindings/js/ScriptCachedFrameData.cpp
index f2b64de..16f18d3 100644
--- a/WebCore/bindings/js/ScriptCachedFrameData.cpp
+++ b/WebCore/bindings/js/ScriptCachedFrameData.cpp
@@ -73,8 +73,6 @@ ScriptCachedFrameData::~ScriptCachedFrameData()
void ScriptCachedFrameData::restore(Frame* frame)
{
- Page* page = frame->page();
-
JSLock lock(SilenceAssertionsOnly);
ScriptController* scriptController = frame->script();
@@ -89,8 +87,9 @@ void ScriptCachedFrameData::restore(Frame* frame)
windowShell->setWindow(window);
else {
windowShell->setWindow(frame->domWindow());
- if (world == debuggerWorld()) {
- scriptController->attachDebugger(page->debugger());
+
+ if (Page* page = frame->page()) {
+ scriptController->attachDebugger(windowShell, page->debugger());
windowShell->window()->setProfileGroup(page->group().identifier());
}
}
diff --git a/WebCore/bindings/js/ScriptController.cpp b/WebCore/bindings/js/ScriptController.cpp
index bfdcaaf..995d2d4 100644
--- a/WebCore/bindings/js/ScriptController.cpp
+++ b/WebCore/bindings/js/ScriptController.cpp
@@ -183,19 +183,17 @@ void ScriptController::clearWindowShell()
JSLock lock(SilenceAssertionsOnly);
- // Clear the debugger from the current window before setting the new window.
- DOMWrapperWorld* debugWorld = debuggerWorld();
- attachDebugger(0);
-
for (ShellMap::iterator iter = m_windowShells.begin(); iter != m_windowShells.end(); ++iter) {
- DOMWrapperWorld* world = iter->first.get();
JSDOMWindowShell* windowShell = iter->second;
+
+ // Clear the debugger from the current window before setting the new window.
+ attachDebugger(windowShell, 0);
+
windowShell->window()->willRemoveFromWindowShell();
windowShell->setWindow(m_frame->domWindow());
if (Page* page = m_frame->page()) {
- if (world == debugWorld)
- attachDebugger(page->debugger());
+ attachDebugger(windowShell, page->debugger());
windowShell->window()->setProfileGroup(page->group().identifier());
}
}
@@ -215,8 +213,7 @@ JSDOMWindowShell* ScriptController::initScript(DOMWrapperWorld* world)
windowShell->window()->updateDocument();
if (Page* page = m_frame->page()) {
- if (world == debuggerWorld())
- attachDebugger(page->debugger());
+ attachDebugger(windowShell, page->debugger());
windowShell->window()->setProfileGroup(page->group().identifier());
}
@@ -293,8 +290,12 @@ bool ScriptController::anyPageIsProcessingUserGesture() const
void ScriptController::attachDebugger(JSC::Debugger* debugger)
{
- // FIXME: Should be able to debug isolated worlds.
- JSDOMWindowShell* shell = existingWindowShell(debuggerWorld());
+ for (ShellMap::iterator iter = m_windowShells.begin(); iter != m_windowShells.end(); ++iter)
+ attachDebugger(iter->second, debugger);
+}
+
+void ScriptController::attachDebugger(JSDOMWindowShell* shell, JSC::Debugger* debugger)
+{
if (!shell)
return;
diff --git a/WebCore/bindings/js/ScriptController.h b/WebCore/bindings/js/ScriptController.h
index 35ec028..f3e5adf 100644
--- a/WebCore/bindings/js/ScriptController.h
+++ b/WebCore/bindings/js/ScriptController.h
@@ -112,7 +112,9 @@ public:
bool canExecuteScripts();
- void attachDebugger(JSC::Debugger*);
+ // Debugger can be 0 to detach any existing Debugger.
+ void attachDebugger(JSC::Debugger*); // Attaches/detaches in all worlds/window shells.
+ void attachDebugger(JSDOMWindowShell*, JSC::Debugger*);
void setPaused(bool b) { m_paused = b; }
bool isPaused() const { return m_paused; }
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list