Chromium Code Reviews| Index: Source/core/inspector/InjectedScriptHost.cpp |
| diff --git a/Source/core/inspector/InjectedScriptHost.cpp b/Source/core/inspector/InjectedScriptHost.cpp |
| index f6cc3a4d36d4db38d5ee4660a5e453f1f8633e2b..048bdbf9d52f25be591517013df8b629eb726840 100644 |
| --- a/Source/core/inspector/InjectedScriptHost.cpp |
| +++ b/Source/core/inspector/InjectedScriptHost.cpp |
| @@ -40,8 +40,9 @@ |
| #include "core/inspector/InspectorValues.h" |
| #include "core/platform/Pasteboard.h" |
| -#include <wtf/RefPtr.h> |
| -#include <wtf/StdLibExtras.h> |
| +#include "wtf/RefPtr.h" |
| +#include "wtf/StdLibExtras.h" |
| +#include "wtf/text/StringBuilder.h" |
| using namespace std; |
| @@ -143,15 +144,32 @@ String InjectedScriptHost::storageIdImpl(Storage* storage) |
| return String(); |
| } |
| -void InjectedScriptHost::setBreakpoint(const String& scriptId, int lineNumber, int columnNumber) |
| +void InjectedScriptHost::debugFunction(const String& scriptId, int lineNumber, int columnNumber) |
| { |
| m_debuggerAgent->setBreakpoint(scriptId, lineNumber, columnNumber, InspectorDebuggerAgent::DebugCommandBreakpointSource); |
| } |
| -void InjectedScriptHost::removeBreakpoint(const String& scriptId, int lineNumber, int columnNumber) |
| +void InjectedScriptHost::undebugFunction(const String& scriptId, int lineNumber, int columnNumber) |
| { |
| m_debuggerAgent->removeBreakpoint(scriptId, lineNumber, columnNumber, InspectorDebuggerAgent::DebugCommandBreakpointSource); |
| } |
| +void InjectedScriptHost::monitorFunction(const String& scriptId, int lineNumber, int columnNumber, const String& functionName) |
| +{ |
| + StringBuilder builder; |
| + builder.appendLiteral("console.log(\"function "); |
| + if (functionName.isEmpty()) |
| + builder.appendLiteral("(anonymous function)"); |
| + else |
| + builder.append(functionName); |
| + builder.appendLiteral(" called\" + (arguments.length > 0 ? \" with arguments: \" + Array.prototype.join.call(arguments, \", \") : \"\")) && false"); |
|
yurys
2013/06/17 12:06:14
This still calls Array.prototype.join that may be
Peter.Rybin
2013/06/17 14:38:14
It looks that breakpoint conditions are processed
SeRya
2013/06/17 15:08:57
It evaluates in v8/src/debug-debugger.js:
var mirr
|
| + m_debuggerAgent->setBreakpoint(scriptId, lineNumber, columnNumber, InspectorDebuggerAgent::MonitorCommandBreakpointSource, builder.toString()); |
| +} |
| + |
| +void InjectedScriptHost::unmonitorFunction(const String& scriptId, int lineNumber, int columnNumber) |
| +{ |
| + m_debuggerAgent->removeBreakpoint(scriptId, lineNumber, columnNumber, InspectorDebuggerAgent::MonitorCommandBreakpointSource); |
| +} |
| + |
| } // namespace WebCore |