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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp

Issue 2733093003: DevTools: instrument user callbacks based on generic probes, remove NativeBreakpoint. (Closed)
Patch Set: test fixed Created 3 years, 9 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: third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
index e9db2de21a161abd87c3642c258ab6fe1ea3af15..0725821e992322d2c595fd5ac22ccbbd91fade28 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
@@ -40,6 +40,7 @@
#include "core/events/EventTarget.h"
#include "core/frame/LocalDOMWindow.h"
#include "core/inspector/InspectorDOMAgent.h"
+#include "core/inspector/InspectorInstrumentation.h"
#include "core/inspector/V8InspectorString.h"
namespace {
@@ -685,6 +686,34 @@ void InspectorDOMDebuggerAgent::scriptExecutionBlockedByCSP(
pauseOnNativeEventIfNeeded(std::move(eventData), true);
}
+void InspectorDOMDebuggerAgent::will(const probe::ExecuteScript& probe) {
+ allowNativeBreakpoint("scriptFirstStatement", nullptr, false);
+}
+
+void InspectorDOMDebuggerAgent::did(const probe::ExecuteScript& probe) {
+ cancelNativeBreakpoint();
+}
+
+void InspectorDOMDebuggerAgent::will(const probe::UserCallback& probe) {
+ String name = probe.name ? String(probe.name) : probe.atomicName;
+ if (probe.eventTarget) {
+ Node* node = probe.eventTarget->toNode();
+ String targetName =
+ node ? node->nodeName() : probe.eventTarget->interfaceName();
+ allowNativeBreakpoint(name, &targetName, false);
+ return;
+ }
+ allowNativeBreakpoint(name + ".callback", nullptr, false);
+}
+
+void InspectorDOMDebuggerAgent::did(const probe::UserCallback& probe) {
+ cancelNativeBreakpoint();
+}
+
+void InspectorDOMDebuggerAgent::breakableLocation(const char* name) {
+ allowNativeBreakpoint(name, nullptr, true);
+}
+
Response InspectorDOMDebuggerAgent::setXHRBreakpoint(const String& url) {
if (url.isEmpty())
m_state->setBoolean(DOMDebuggerAgentState::pauseOnAllXHRs, true);

Powered by Google App Engine
This is Rietveld 408576698