summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/v8/ScriptDebugServer.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-05 14:36:32 +0100
committerBen Murdoch <benm@google.com>2011-05-10 15:38:30 +0100
commitf05b935882198ccf7d81675736e3aeb089c5113a (patch)
tree4ea0ca838d9ef1b15cf17ddb3928efb427c7e5a1 /WebCore/bindings/v8/ScriptDebugServer.cpp
parent60fbdcc62bced8db2cb1fd233cc4d1e4ea17db1b (diff)
downloadexternal_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.zip
external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.gz
external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.bz2
Merge WebKit at r74534: Initial merge by git.
Change-Id: I6ccd1154fa1b19c2ec2a66878eb675738735f1eb
Diffstat (limited to 'WebCore/bindings/v8/ScriptDebugServer.cpp')
-rw-r--r--WebCore/bindings/v8/ScriptDebugServer.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/WebCore/bindings/v8/ScriptDebugServer.cpp b/WebCore/bindings/v8/ScriptDebugServer.cpp
index 9dfca55..4b4611a 100644
--- a/WebCore/bindings/v8/ScriptDebugServer.cpp
+++ b/WebCore/bindings/v8/ScriptDebugServer.cpp
@@ -143,7 +143,7 @@ void ScriptDebugServer::removeListener(ScriptDebugListener* listener, Page* page
// FIXME: Remove all breakpoints set by the agent.
}
-bool ScriptDebugServer::setBreakpoint(const String& sourceID, ScriptBreakpoint breakpoint, unsigned lineNumber, unsigned* actualLineNumber)
+String ScriptDebugServer::setBreakpoint(const String& sourceID, unsigned lineNumber, const String& condition, bool enabled, unsigned* actualLineNumber)
{
v8::HandleScope scope;
v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext();
@@ -152,27 +152,25 @@ bool ScriptDebugServer::setBreakpoint(const String& sourceID, ScriptBreakpoint b
v8::Local<v8::Object> args = v8::Object::New();
args->Set(v8::String::New("scriptId"), v8String(sourceID));
args->Set(v8::String::New("lineNumber"), v8::Integer::New(lineNumber));
- args->Set(v8::String::New("condition"), v8String(breakpoint.condition));
- args->Set(v8::String::New("enabled"), v8::Boolean::New(breakpoint.enabled));
+ args->Set(v8::String::New("condition"), v8String(condition));
+ args->Set(v8::String::New("enabled"), v8::Boolean::New(enabled));
v8::Handle<v8::Function> setBreakpointFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("setBreakpoint")));
- v8::Handle<v8::Value> result = v8::Debug::Call(setBreakpointFunction, args);
- if (!result->IsNumber())
- return false;
- ASSERT(result->Int32Value() >= 0);
- *actualLineNumber = result->Int32Value();
- return true;
+ v8::Handle<v8::Value> breakpointId = v8::Debug::Call(setBreakpointFunction, args);
+ if (!breakpointId->IsString())
+ return "";
+ *actualLineNumber = args->Get(v8::String::New("lineNumber"))->Int32Value();
+ return v8StringToWebCoreString(breakpointId->ToString());
}
-void ScriptDebugServer::removeBreakpoint(const String& sourceID, unsigned lineNumber)
+void ScriptDebugServer::removeBreakpoint(const String& breakpointId)
{
v8::HandleScope scope;
v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext();
v8::Context::Scope contextScope(debuggerContext);
v8::Local<v8::Object> args = v8::Object::New();
- args->Set(v8::String::New("scriptId"), v8String(sourceID));
- args->Set(v8::String::New("lineNumber"), v8::Integer::New(lineNumber));
+ args->Set(v8::String::New("breakpointId"), v8String(breakpointId));
v8::Handle<v8::Function> removeBreakpointFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("removeBreakpoint")));
v8::Debug::Call(removeBreakpointFunction, args);