Chromium Code Reviews| Index: Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp |
| diff --git a/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp b/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp |
| index 028da891a71cc88fca5f4afc602203540d938c71..6dc05d7d4c79cbac16e2429381c0757e04f1401c 100644 |
| --- a/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp |
| +++ b/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp |
| @@ -363,6 +363,45 @@ void V8InjectedScriptHost::setFunctionVariableValueMethodCustom(const v8::Functi |
| v8SetReturnValue(args, debugServer.setFunctionVariableValue(functionValue, scopeIndex, variableName, newValue)); |
| } |
| +static bool getFunctionLocation(const v8::FunctionCallbackInfo<v8::Value>& args, String* scriptId, int* lineNumber, int* columnNumber) |
| +{ |
| + if (args.Length() < 1) |
| + return false; |
| + v8::Handle<v8::Value> fn = args[0]; |
| + if (!fn->IsFunction()) |
| + return false; |
| + v8::HandleScope handleScope; |
| + v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(fn); |
| + *lineNumber = function->GetScriptLineNumber(); |
| + *columnNumber = function->GetScriptColumnNumber(); |
| + if (*lineNumber == v8::Function::kLineOffsetNotFound || *columnNumber == v8::Function::kLineOffsetNotFound) |
| + return false; |
| + *scriptId = toWebCoreStringWithUndefinedOrNullCheck(function->GetScriptId()->ToString()); |
|
yurys
2013/06/07 15:23:29
toWebCoreStringWithUndefinedOrNullCheck(function->
SeRya
2013/06/07 16:01:00
Done.
|
| + return true; |
| +} |
| + |
| +void V8InjectedScriptHost::setBreakpointMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& args) |
| +{ |
| + String scriptId; |
| + int lineNumber, columnNumber; |
|
yurys
2013/06/07 15:23:29
One declaration per line please.
SeRya
2013/06/07 16:01:00
Done.
|
| + if (!getFunctionLocation(args, &scriptId, &lineNumber, &columnNumber)) |
| + return; |
| + |
| + InjectedScriptHost* host = V8InjectedScriptHost::toNative(args.Holder()); |
| + host->setBreakpoint(scriptId, lineNumber, columnNumber); |
| +} |
| + |
| +void V8InjectedScriptHost::removeBreakpointMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& args) |
| +{ |
| + String scriptId; |
| + int lineNumber, columnNumber; |
| + if (!getFunctionLocation(args, &scriptId, &lineNumber, &columnNumber)) |
| + return; |
| + |
| + InjectedScriptHost* host = V8InjectedScriptHost::toNative(args.Holder()); |
| + host->removeBreakpoint(scriptId, lineNumber, columnNumber); |
| +} |
| + |
| } // namespace WebCore |