Web Inspector: support JavaScript variable mutation in protocol and V8 bindings
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2013 15:00:13 +0000 (15:00 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2013 15:00:13 +0000 (15:00 +0000)
commite05e706c0a447e0a1f5f9d9c4844af0b319d4e43
treee1c123e81b985dfcb9b2c95699a23e8dec52bd60
parentb9d5deb6faf55996b43b6132ae5073cca289ee5e
Web Inspector: support JavaScript variable mutation in protocol and V8 bindings
https://bugs.webkit.org/show_bug.cgi?id=107829

Source/WebCore:

A new command is added to protocol description and the call is passed through
debugger agent through injected script and debugger script down to V8 mirror
API. JSC bindings got a thorw exception stub.

Only declarative JavaScript scopes are supported (local, closure, catch). Other
scopes (global, with) are not supported by V8 and not supported by protocol, because
manual approach (direct property assigment) is available for them in form of evaluate
commands and is more desirable because of a complex nature of operation (it can throw
exception in several cases such as exception in setter function).

Patch by Peter Rybin <prybin@chromium.org> on 2013-02-07
Reviewed by Pavel Feldman.

Test: inspector-protocol/debugger-setVariableValue.html

* bindings/js/JSInjectedScriptHostCustom.cpp:
(WebCore::JSInjectedScriptHost::setFunctionVariableValue):
(WebCore):
* bindings/js/JSJavaScriptCallFrameCustom.cpp:
(WebCore::JSJavaScriptCallFrame::setVariableValue):
(WebCore):
* bindings/v8/DebuggerScript.js:
(.):
* bindings/v8/JavaScriptCallFrame.cpp:
(WebCore::JavaScriptCallFrame::setVariableValue):
(WebCore):
* bindings/v8/JavaScriptCallFrame.h:
(JavaScriptCallFrame):
* bindings/v8/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::setFunctionVariableValue):
(WebCore):
* bindings/v8/ScriptDebugServer.h:
(ScriptDebugServer):
* bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
(WebCore::V8InjectedScriptHost::setFunctionVariableValueCallback):
(WebCore):
* bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp:
(WebCore::V8JavaScriptCallFrame::setVariableValueCallback):
(WebCore):
* inspector/InjectedScript.cpp:
(WebCore::InjectedScript::setVariableValue):
(WebCore):
* inspector/InjectedScript.h:
(InjectedScript):
* inspector/InjectedScriptHost.idl:
* inspector/InjectedScriptSource.js:
(.):
* inspector/Inspector.json:
* inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::getFunctionDetails):
(WebCore::InspectorDebuggerAgent::setVariableValue):
(WebCore):
* inspector/InspectorDebuggerAgent.h:
(InspectorDebuggerAgent):
* inspector/JavaScriptCallFrame.idl:

LayoutTests:

Patch by Peter Rybin <prybin@chromium.org> on 2013-02-07
Reviewed by Pavel Feldman.

* inspector-protocol/debugger-setVariableValue-expected.txt: Added.
* inspector-protocol/debugger-setVariableValue.html: Added.
* inspector/console/command-line-api-expected.txt:
* platform/chromium/inspector-protocol/debugger-setVariableValue-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142114 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector-protocol/debugger-setVariableValue-expected.txt [new file with mode: 0644]
LayoutTests/inspector-protocol/debugger-setVariableValue.html [new file with mode: 0644]
LayoutTests/inspector/console/command-line-api-expected.txt
LayoutTests/platform/chromium/inspector-protocol/debugger-setVariableValue-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
Source/WebCore/bindings/js/JSJavaScriptCallFrameCustom.cpp
Source/WebCore/bindings/v8/DebuggerScript.js
Source/WebCore/bindings/v8/JavaScriptCallFrame.cpp
Source/WebCore/bindings/v8/JavaScriptCallFrame.h
Source/WebCore/bindings/v8/ScriptDebugServer.cpp
Source/WebCore/bindings/v8/ScriptDebugServer.h
Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
Source/WebCore/bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp
Source/WebCore/inspector/InjectedScript.cpp
Source/WebCore/inspector/InjectedScript.h
Source/WebCore/inspector/InjectedScriptHost.idl
Source/WebCore/inspector/InjectedScriptSource.js
Source/WebCore/inspector/Inspector.json
Source/WebCore/inspector/InspectorDebuggerAgent.cpp
Source/WebCore/inspector/InspectorDebuggerAgent.h
Source/WebCore/inspector/JavaScriptCallFrame.idl