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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorInstrumentation.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/InspectorInstrumentation.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp b/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
index a646c324e9127c9edb351b30b1d6c859b4b2cf35..4c483b2cd8ac19a803216a6a77d777d7c32a3e8f 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
@@ -74,18 +74,7 @@ AsyncTask::AsyncTask(ExecutionContext* context, void* task)
AsyncTask::AsyncTask(ExecutionContext* context, void* task, bool enabled)
: m_debugger(enabled ? ThreadDebugger::from(toIsolate(context)) : nullptr),
- m_task(task),
- m_breakpoint(nullptr, nullptr) {
- if (m_debugger)
- m_debugger->asyncTaskStarted(m_task);
-}
-
-AsyncTask::AsyncTask(ExecutionContext* context,
- void* task,
- const char* breakpointName)
- : m_debugger(ThreadDebugger::from(toIsolate(context))),
- m_task(task),
- m_breakpoint(context, breakpointName) {
+ m_task(task) {
if (m_debugger)
m_debugger->asyncTaskStarted(m_task);
}
@@ -108,7 +97,7 @@ void asyncTaskScheduledBreakable(ExecutionContext* context,
void* task,
bool recurring) {
asyncTaskScheduled(context, name, task, recurring);
- breakIfNeeded(context, name);
+ breakableLocation(context, name);
}
void asyncTaskCanceled(ExecutionContext* context, void* task) {
@@ -120,7 +109,7 @@ void asyncTaskCanceledBreakable(ExecutionContext* context,
const char* name,
void* task) {
asyncTaskCanceled(context, task);
- breakIfNeeded(context, name);
+ breakableLocation(context, name);
}
void allAsyncTasksCanceled(ExecutionContext* context) {
@@ -128,50 +117,6 @@ void allAsyncTasksCanceled(ExecutionContext* context) {
debugger->allAsyncTasksCanceled();
}
-void breakIfNeeded(ExecutionContext* context, const char* name) {
- InstrumentingAgents* instrumentingAgents = instrumentingAgentsFor(context);
- if (!instrumentingAgents ||
- !instrumentingAgents->hasInspectorDOMDebuggerAgents())
- return;
- for (InspectorDOMDebuggerAgent* domDebuggerAgent :
- instrumentingAgents->inspectorDOMDebuggerAgents()) {
- domDebuggerAgent->allowNativeBreakpoint(name, nullptr, true);
- }
-}
-
-NativeBreakpoint::NativeBreakpoint(ExecutionContext* context, const char* name)
- : m_instrumentingAgents(instrumentingAgentsFor(context)) {
- if (!m_instrumentingAgents ||
- !m_instrumentingAgents->hasInspectorDOMDebuggerAgents())
- return;
- for (InspectorDOMDebuggerAgent* domDebuggerAgent :
- m_instrumentingAgents->inspectorDOMDebuggerAgents())
- domDebuggerAgent->allowNativeBreakpoint(name, nullptr, false);
-}
-
-NativeBreakpoint::NativeBreakpoint(ExecutionContext* context,
- EventTarget* eventTarget,
- Event* event)
- : m_instrumentingAgents(instrumentingAgentsFor(context)) {
- if (!m_instrumentingAgents ||
- !m_instrumentingAgents->hasInspectorDOMDebuggerAgents())
- return;
- Node* node = eventTarget->toNode();
- String targetName = node ? node->nodeName() : eventTarget->interfaceName();
- for (InspectorDOMDebuggerAgent* domDebuggerAgent :
- m_instrumentingAgents->inspectorDOMDebuggerAgents())
- domDebuggerAgent->allowNativeBreakpoint(event->type(), &targetName, false);
-}
-
-NativeBreakpoint::~NativeBreakpoint() {
- if (!m_instrumentingAgents ||
- !m_instrumentingAgents->hasInspectorDOMDebuggerAgents())
- return;
- for (InspectorDOMDebuggerAgent* domDebuggerAgent :
- m_instrumentingAgents->inspectorDOMDebuggerAgents())
- domDebuggerAgent->cancelNativeBreakpoint();
-}
-
void didReceiveResourceResponseButCanceled(LocalFrame* frame,
DocumentLoader* loader,
unsigned long identifier,

Powered by Google App Engine
This is Rietveld 408576698