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

Unified Diff: third_party/WebKit/Source/platform/scheduler/base/queueing_time_estimator.cc

Issue 2788013003: Expected Queueing Time Metric ignores tasks with nested message loops. (Closed)
Patch Set: Address nits 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/platform/scheduler/base/queueing_time_estimator.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/base/queueing_time_estimator.cc b/third_party/WebKit/Source/platform/scheduler/base/queueing_time_estimator.cc
index 620ed1eab17c9b60eb1f3851cc2271de70382e4f..2e183c9da042897404be9ac7ddc1582e37fd2c70 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/queueing_time_estimator.cc
+++ b/third_party/WebKit/Source/platform/scheduler/base/queueing_time_estimator.cc
@@ -72,6 +72,10 @@ void QueueingTimeEstimator::OnTopLevelTaskCompleted(
state_.OnTopLevelTaskCompleted(client_, task_end_time);
}
+void QueueingTimeEstimator::OnBeginNestedMessageLoop() {
+ state_.OnBeginNestedMessageLoop();
+}
+
void QueueingTimeEstimator::State::OnTopLevelTaskStarted(
base::TimeTicks task_start_time) {
current_task_start_time = task_start_time;
@@ -80,6 +84,12 @@ void QueueingTimeEstimator::State::OnTopLevelTaskStarted(
void QueueingTimeEstimator::State::OnTopLevelTaskCompleted(
QueueingTimeEstimator::Client* client,
base::TimeTicks task_end_time) {
+ if (in_nested_message_loop_) {
+ in_nested_message_loop_ = false;
+ current_task_start_time = base::TimeTicks();
+ return;
+ }
+
if (window_start_time.is_null())
window_start_time = current_task_start_time;
@@ -102,6 +112,10 @@ void QueueingTimeEstimator::State::OnTopLevelTaskCompleted(
current_task_start_time = base::TimeTicks();
}
+void QueueingTimeEstimator::State::OnBeginNestedMessageLoop() {
+ in_nested_message_loop_ = true;
+}
+
bool QueueingTimeEstimator::State::TimePastWindowEnd(base::TimeTicks time) {
return time > window_start_time + window_duration;
}

Powered by Google App Engine
This is Rietveld 408576698