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

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: same with scriptpromiseresolver 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..14a5377fac370ac52719d22e4aeed9fec3203d8a 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
@@ -58,6 +58,26 @@ 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_context(context)
+ , m_task(task)
+ , m_enabled(enabled)
+{
+ if (enabled)
+ InspectorInstrumentation::asyncTaskStarted(context, task);
+}
+
+AsyncTask::~AsyncTask()
+{
+ if (m_enabled)
+ InspectorInstrumentation::asyncTaskFinished(m_context, 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