Web Inspector: Remove shared PageScriptDebugServer, create per-Page
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Apr 2014 17:48:21 +0000 (17:48 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Apr 2014 17:48:21 +0000 (17:48 +0000)
commit9ab3d2413c14ef606528d6ae225f7add3373b738
treebfa675556dd68ffc97b112f99bc83ff79593a080
parent2605752c87bab60877e665f5b00ff100be3473c4
Web Inspector: Remove shared PageScriptDebugServer, create per-Page
https://bugs.webkit.org/show_bug.cgi?id=131523

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-04-11
Reviewed by Timothy Hatcher.

Having a shared PageScriptDebugServer was causing issues when we called
JSC::Debugger::clearBreakpoints() closing one inspector while another
is open for another WebCore::Page in the same process. Having the same
JSC::Debugger underlying multiple InspectorDebuggerAgent instances
means that when clearBreakpoints is called, the real JSC breakpoints
underlying other InspectorDebuggerAgent's get removed. When those
InspectorDebuggerAgents attempt to remove their breakpoints they
encounter unexpected issues.

This entirely rebuilds PageScriptDebugServer to be per-Page instead
of shared across all pages. So take this opportunity to move the
file from WebCore/bindings/js to WebCore/inspector.

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/PageScriptDebugServer.h: Removed.
* inspector/InspectorAllInOne.cpp:
Move PageScriptDebugServer.

* inspector/InspectorController.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
Set the ScriptDebugServer directly on some other agents that
were previously using the global debug server.

* inspector/InspectorProfilerAgent.h:
(WebCore::InspectorProfilerAgent::scriptDebugServer):
* inspector/InspectorProfilerAgent.cpp:
(WebCore::InspectorProfilerAgent::InspectorProfilerAgent):
(WebCore::InspectorProfilerAgent::setScriptDebugServer):
(WebCore::InspectorProfilerAgent::start):
(WebCore::InspectorProfilerAgent::willDestroyFrontendAndBackend): Deleted.
* inspector/InspectorTimelineAgent.h:
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::start):
(WebCore::InspectorTimelineAgent::stop):
(WebCore::InspectorTimelineAgent::setPageScriptDebugServer):
(WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
Refactor these two agents to take in a script debug server.
The server is expected to be set during initialization and
to always be valid (like debug server on RuntimeAgent).

* inspector/PageDebuggerAgent.h:
* inspector/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::PageDebuggerAgent):
(WebCore::PageDebuggerAgent::startListeningScriptDebugServer):
(WebCore::PageDebuggerAgent::stopListeningScriptDebugServer):
(WebCore::PageDebuggerAgent::scriptDebugServer):
Have PageDebuggerAgent hold the PageScriptDebugServer.
Update for the simplified interfaces.

* inspector/PageScriptDebugServer.h: Added.
* inspector/PageScriptDebugServer.cpp: Renamed from Source/WebCore/bindings/js/PageScriptDebugServer.cpp.
(WebCore::PageScriptDebugServer::PageScriptDebugServer):
(WebCore::PageScriptDebugServer::addListener):
(WebCore::PageScriptDebugServer::removeListener):
(WebCore::PageScriptDebugServer::recompileAllJSFunctions):
(WebCore::PageScriptDebugServer::didPause):
(WebCore::PageScriptDebugServer::didContinue):
(WebCore::PageScriptDebugServer::runEventLoopWhilePaused):
(WebCore::PageScriptDebugServer::runEventLoopWhilePausedInternal):
(WebCore::PageScriptDebugServer::isContentScript):
(WebCore::PageScriptDebugServer::reportException):
(WebCore::PageScriptDebugServer::setJavaScriptPaused):
Model after JSGlobalObjectScriptDebugServer, the PageScriptDebugServer
holds a reference to a Page.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167133 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
Source/WebCore/bindings/js/PageScriptDebugServer.h [deleted file]
Source/WebCore/inspector/InspectorAllInOne.cpp
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorController.h
Source/WebCore/inspector/InspectorProfilerAgent.cpp
Source/WebCore/inspector/InspectorProfilerAgent.h
Source/WebCore/inspector/InspectorTimelineAgent.cpp
Source/WebCore/inspector/InspectorTimelineAgent.h
Source/WebCore/inspector/PageDebuggerAgent.cpp
Source/WebCore/inspector/PageDebuggerAgent.h
Source/WebCore/inspector/PageScriptDebugServer.cpp [moved from Source/WebCore/bindings/js/PageScriptDebugServer.cpp with 51% similarity]
Source/WebCore/inspector/PageScriptDebugServer.h [new file with mode: 0644]