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

Unified Diff: third_party/WebKit/Source/core/dom/MainThreadTaskRunner.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/dom/MainThreadTaskRunner.cpp
diff --git a/third_party/WebKit/Source/core/dom/MainThreadTaskRunner.cpp b/third_party/WebKit/Source/core/dom/MainThreadTaskRunner.cpp
index eeb2e78169f82595fd5c9a96b1a81571f1304627..9866e72a66d7892b236bddebfc689fcf66863911 100644
--- a/third_party/WebKit/Source/core/dom/MainThreadTaskRunner.cpp
+++ b/third_party/WebKit/Source/core/dom/MainThreadTaskRunner.cpp
@@ -70,7 +70,7 @@ void MainThreadTaskRunner::postTaskInternal(const WebTraceLocation& location, Pa
void MainThreadTaskRunner::postTask(const WebTraceLocation& location, PassOwnPtr<ExecutionContextTask> task)
{
if (!task->taskNameForInstrumentation().isEmpty())
- InspectorInstrumentation::didPostExecutionContextTask(m_context, task.get());
+ InspectorInstrumentation::asyncTaskScheduled(m_context, task->taskNameForInstrumentation(), task.get());
postTaskInternal(location, task, false);
}
@@ -86,12 +86,8 @@ void MainThreadTaskRunner::perform(PassOwnPtr<ExecutionContextTask> task, bool i
return;
}
- const bool instrumenting = !isInspectorTask && !task->taskNameForInstrumentation().isEmpty();
- if (instrumenting)
- InspectorInstrumentation::willPerformExecutionContextTask(m_context, task.get());
+ InspectorInstrumentation::AsyncTask asyncTask(m_context, task.get(), !isInspectorTask);
task->performTask(m_context);
- if (instrumenting)
- InspectorInstrumentation::didPerformExecutionContextTask(m_context);
}
void MainThreadTaskRunner::suspend()
@@ -116,11 +112,8 @@ void MainThreadTaskRunner::pendingTasksTimerFired(Timer<MainThreadTaskRunner>*)
OwnPtr<ExecutionContextTask> task = m_pendingTasks[0].release();
m_pendingTasks.remove(0);
const bool instrumenting = !task->taskNameForInstrumentation().isEmpty();
- if (instrumenting)
- InspectorInstrumentation::willPerformExecutionContextTask(m_context, task.get());
+ InspectorInstrumentation::AsyncTask asyncTask(m_context, task.get(), instrumenting);
task->performTask(m_context);
- if (instrumenting)
- InspectorInstrumentation::didPerformExecutionContextTask(m_context);
}
}

Powered by Google App Engine
This is Rietveld 408576698