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

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..6b66ac43399197e176ae3866fabfa5cad9c4b539 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::scheduleAsyncTask(m_context, "postTask", task.get());
postTaskInternal(location, task, false);
}
@@ -86,12 +86,11 @@ void MainThreadTaskRunner::perform(PassOwnPtr<ExecutionContextTask> task, bool i
return;
}
- const bool instrumenting = !isInspectorTask && !task->taskNameForInstrumentation().isEmpty();
- if (instrumenting)
- InspectorInstrumentation::willPerformExecutionContextTask(m_context, task.get());
+ if (!isInspectorTask)
+ InspectorInstrumentation::asyncTaskStarted(m_context, task.get());
task->performTask(m_context);
- if (instrumenting)
- InspectorInstrumentation::didPerformExecutionContextTask(m_context);
+ if (!isInspectorTask)
+ InspectorInstrumentation::asyncTaskFinished(m_context, task.get());
}
void MainThreadTaskRunner::suspend()
@@ -117,10 +116,10 @@ void MainThreadTaskRunner::pendingTasksTimerFired(Timer<MainThreadTaskRunner>*)
m_pendingTasks.remove(0);
const bool instrumenting = !task->taskNameForInstrumentation().isEmpty();
if (instrumenting)
- InspectorInstrumentation::willPerformExecutionContextTask(m_context, task.get());
+ InspectorInstrumentation::asyncTaskStarted(m_context, task.get());
task->performTask(m_context);
if (instrumenting)
- InspectorInstrumentation::didPerformExecutionContextTask(m_context);
+ InspectorInstrumentation::asyncTaskFinished(m_context, task.get());
}
}

Powered by Google App Engine
This is Rietveld 408576698