Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1035)

Unified Diff: Source/core/inspector/InjectedScriptHost.cpp

Issue 16143005: monitor console command implemented. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Moved command implementation to C++. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698