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

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

Issue 16143005: monitor console command implemented. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« no previous file with comments | « Source/core/inspector/InjectedScriptHost.h ('k') | Source/core/inspector/InjectedScriptHost.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InjectedScriptHost.cpp
diff --git a/Source/core/inspector/InjectedScriptHost.cpp b/Source/core/inspector/InjectedScriptHost.cpp
index c58d3d4ae0f4c52afd6480c15bb20d8253aa573b..bafd14c46c98d817146cadc29999bbb9eeaeede6 100644
--- a/Source/core/inspector/InjectedScriptHost.cpp
+++ b/Source/core/inspector/InjectedScriptHost.cpp
@@ -41,8 +41,9 @@
#include "core/inspector/InstrumentingAgents.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;
@@ -135,17 +136,36 @@ 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)
{
if (InspectorDebuggerAgent* debuggerAgent = m_instrumentingAgents ? m_instrumentingAgents->inspectorDebuggerAgent() : 0)
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)
{
if (InspectorDebuggerAgent* debuggerAgent = m_instrumentingAgents ? m_instrumentingAgents->inspectorDebuggerAgent() : 0)
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");
+ if (InspectorDebuggerAgent* debuggerAgent = m_instrumentingAgents ? m_instrumentingAgents->inspectorDebuggerAgent() : 0)
+ debuggerAgent->setBreakpoint(scriptId, lineNumber, columnNumber, InspectorDebuggerAgent::MonitorCommandBreakpointSource, builder.toString());
+}
+
+void InjectedScriptHost::unmonitorFunction(const String& scriptId, int lineNumber, int columnNumber)
+{
+ if (InspectorDebuggerAgent* debuggerAgent = m_instrumentingAgents ? m_instrumentingAgents->inspectorDebuggerAgent() : 0)
+ debuggerAgent->removeBreakpoint(scriptId, lineNumber, columnNumber, InspectorDebuggerAgent::MonitorCommandBreakpointSource);
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/inspector/InjectedScriptHost.h ('k') | Source/core/inspector/InjectedScriptHost.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698