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

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

Issue 1857713004: DevTools: simplify the async instrumentation harness. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 015444f4f3a868caf27b3d8a9c7eb2e913fa6488..2c65b2c3704e6be32014445922d332fe78f93425 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
@@ -58,6 +58,25 @@ PersistentHeapHashSet<WeakMember<InstrumentingAgents>>& instrumentingAgentsSet()
}
namespace InspectorInstrumentation {
+
+AsyncTask::AsyncTask(ExecutionContext* context, void* task) : AsyncTask(context, task, true)
+{
+}
+
+AsyncTask::AsyncTask(ExecutionContext* context, void* task, bool enabled)
+ : m_instrumentingAgents(enabled ? instrumentingAgentsFor(context) : nullptr)
+ , m_task(task)
+{
+ if (m_instrumentingAgents && m_instrumentingAgents->inspectorDebuggerAgent())
+ m_instrumentingAgents->inspectorDebuggerAgent()->asyncTaskStarted(m_task);
+}
+
+AsyncTask::~AsyncTask()
+{
+ if (m_instrumentingAgents && m_instrumentingAgents->inspectorDebuggerAgent())
+ m_instrumentingAgents->inspectorDebuggerAgent()->asyncTaskFinished(m_task);
+}
+
int FrontendCounter::s_frontendCounter = 0;
// Keep in sync with kDevToolsRequestInitiator defined in devtools_network_controller.cc

Powered by Google App Engine
This is Rietveld 408576698