Web Inspector: Move InspectorDebuggerAgent into JavaScriptCore
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 26 Jan 2014 08:39:12 +0000 (08:39 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 26 Jan 2014 08:39:12 +0000 (08:39 +0000)
commit00ce6c43ae1772071deeb3bbddc64fbad4d10b9d
tree36997f1fbe0d10ad939cd47eaf102510b9963381
parent58b8c9075edeb321bd2fa7833a538c9d61047cf2
Web Inspector: Move InspectorDebuggerAgent into JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=127629

Rubber-stamped by Sam Weinig.

Source/JavaScriptCore:

* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
- Add new files to the build.
- Also, since non REMOTE_INSPECTOR ports cannot yet connect to a
  JSGlobalObject for inspection remove those files as they don't
  need to be built.

* inspector/EventLoop.cpp: Added.
(Inspector::EventLoop::cycle):
* inspector/EventLoop.h: Added.
(Inspector::EventLoop::EventLoop):
(Inspector::EventLoop::ended):
Add a JavaScriptCore version of EventLoop. This is currently only
used by the Mac port for JSGlobalObject remote inspection. Keep
the WebCore/platform version alive because for the Mac port it does
slightly different things involving AppKit.

* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
Create DebuggerAgent and hook up ScriptDebugServer where needed.

* inspector/JSGlobalObjectScriptDebugServer.cpp: Added.
(Inspector::JSGlobalObjectScriptDebugServer::JSGlobalObjectScriptDebugServer):
(Inspector::JSGlobalObjectScriptDebugServer::addListener):
(Inspector::JSGlobalObjectScriptDebugServer::removeListener):
(Inspector::JSGlobalObjectScriptDebugServer::recompileAllJSFunctions):
(Inspector::JSGlobalObjectScriptDebugServer::runEventLoopWhilePaused):
* inspector/JSGlobalObjectScriptDebugServer.h: Added.
Simple implementation of ScriptDebugServer with a JSGlobalObject.

* inspector/agents/InspectorDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDebuggerAgent.cpp.
* inspector/agents/InspectorDebuggerAgent.h: Renamed from Source/WebCore/inspector/InspectorDebuggerAgent.h.
Copied from WebCore. A few methods need to be made virtual so that Web implementations
can override and extend the funcitonality. E.g. sourceMapURLForScript and enable/disable.

* inspector/agents/JSGlobalObjectDebuggerAgent.cpp: Added.
* inspector/agents/JSGlobalObjectDebuggerAgent.h: Added.
(Inspector::JSGlobalObjectDebuggerAgent::JSGlobalObjectDebuggerAgent):
(Inspector::JSGlobalObjectDebuggerAgent::startListeningScriptDebugServer):
(Inspector::JSGlobalObjectDebuggerAgent::stopListeningScriptDebugServer):
(Inspector::JSGlobalObjectDebuggerAgent::injectedScriptForEval):
Simple implementation of DebuggerAGent with a JSGlobalObject.

Source/WebCore:

Test: inspector-protocol/debugger/pause-on-assert.html

* CMakeLists.txt:
* ForwardingHeaders/inspector/agents/InspectorDebuggerAgent.h: Added.
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAllInOne.cpp:
- Remove InspectorDebuggerAgent.
- Add WebDebuggerAgent (shared between Page and Worker).

* inspector/WebDebuggerAgent.h: Added.
(WebCore::WebDebuggerAgent::~WebDebuggerAgent):
* inspector/WebDebuggerAgent.cpp: Added.
(WebCore::WebDebuggerAgent::WebDebuggerAgent):
(WebCore::WebDebuggerAgent::enable):
(WebCore::WebDebuggerAgent::disable):
Shared code for Page and Worker debugger agents.
Instrumenting agents is a concept in WebCore only,
and the Debugger agent is only in the instrumenting
agents list when it is enabled and removed when disabled.

* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::inspectorDebuggerAgent):
(WebCore::InstrumentingAgents::setInspectorDebuggerAgent):
* inspector/InspectorDOMDebuggerAgent.cpp:
* inspector/InspectorDOMDebuggerAgent.h:
Update namespace for debugger agent.

* inspector/InspectorInstrumentation.cpp:
(WebCore::isConsoleAssertMessage):
(WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
DebuggerAgent in JavaScriptCore does not yet know about console
types. So temporarily handle it here. We need to give JavaScriptCore
some concept of Console messages and types.

* inspector/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::PageDebuggerAgent):
(WebCore::PageDebuggerAgent::enable):
(WebCore::PageDebuggerAgent::disable):
(WebCore::PageDebuggerAgent::sourceMapURLForScript):
(WebCore::PageDebuggerAgent::injectedScriptForEval):
* inspector/PageDebuggerAgent.h:
* inspector/WorkerDebuggerAgent.cpp:
(WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
(WebCore::WorkerDebuggerAgent::injectedScriptForEval):
* inspector/WorkerDebuggerAgent.h:
Modernize the Page and Worker debugger agents.

* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/InspectorController.h:
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
New constructors for the debugger agents.

LayoutTests:

Add a test that we pause in the debugger for console.assert failures
when the DebuggerAgent is enabled.

* inspector-protocol/debugger/pause-on-assert-expected.txt: Added.
* inspector-protocol/debugger/pause-on-assert.html: Added.
* inspector-protocol/debugger/resources/assert.js: Added.
(assertTrue):
(assertFalse):
(assertCondition):
(assertConditionWithMessage):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162799 268f45cc-cd09-0410-ab3c-d52691b4dbfc
40 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector-protocol/debugger/pause-on-assert-expected.txt [new file with mode: 0644]
LayoutTests/inspector-protocol/debugger/pause-on-assert.html [new file with mode: 0644]
LayoutTests/inspector-protocol/debugger/resources/assert.js [new file with mode: 0644]
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/GNUmakefile.list.am
Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/inspector/EventLoop.cpp [new file with mode: 0644]
Source/JavaScriptCore/inspector/EventLoop.h [new file with mode: 0644]
Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp
Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.cpp [new file with mode: 0644]
Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.h [new file with mode: 0644]
Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp [moved from Source/WebCore/inspector/InspectorDebuggerAgent.cpp with 80% similarity]
Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h [moved from Source/WebCore/inspector/InspectorDebuggerAgent.h with 67% similarity]
Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.cpp [new file with mode: 0644]
Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.h [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/ForwardingHeaders/inspector/agents/InspectorDebuggerAgent.h [new file with mode: 0644]
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/inspector/InspectorAllInOne.cpp
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorController.h
Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp
Source/WebCore/inspector/InspectorDOMDebuggerAgent.h
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InstrumentingAgents.h
Source/WebCore/inspector/PageDebuggerAgent.cpp
Source/WebCore/inspector/PageDebuggerAgent.h
Source/WebCore/inspector/WebDebuggerAgent.cpp [new file with mode: 0644]
Source/WebCore/inspector/WebDebuggerAgent.h [new file with mode: 0644]
Source/WebCore/inspector/WorkerDebuggerAgent.cpp
Source/WebCore/inspector/WorkerDebuggerAgent.h
Source/WebCore/inspector/WorkerInspectorController.cpp