Commit 4a2ebc8d authored by chaopeng's avatar chaopeng Committed by Commit Bot

Set TouchStartExpectedSoon only after we seen a blocking event

This issue is causing by:

1. MainThreadScheduler set TouchStartExpectedSoon based on the gesture event
   sequence when page has touchstart event handler
2. Scroll latching makes mouse wheels to gesture events.

We change it the check from page has touchstart event handler to we actually
cc blocking event. In the issue case, page has touchstart event handler but no
wheel event handler, user scroll with wheel will not cause a cc blocking event
so it would not block the network request.

We also change TouchStartExpectedSoon to BlockingInputExpectedSoon.

Bug: 828235
Change-Id: Iefff163ca091f2761542a527e2c4432bc1078f4c
Reviewed-on: https://chromium-review.googlesource.com/1075719
Commit-Queue: Jianpeng Chao <chaopeng@chromium.org>
Reviewed-by: default avatarSami Kyöstilä <skyostil@chromium.org>
Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568614}
parent 4091aa04
...@@ -343,6 +343,8 @@ class PLATFORM_EXPORT MainThreadSchedulerImpl ...@@ -343,6 +343,8 @@ class PLATFORM_EXPORT MainThreadSchedulerImpl
main_thread_only().current_use_case = use_case; main_thread_only().current_use_case = use_case;
} }
void SetHaveSeenABlockingGestureForTesting(bool status);
private: private:
friend class WebRenderWidgetSchedulingState; friend class WebRenderWidgetSchedulingState;
friend class MainThreadMetricsHelper; friend class MainThreadMetricsHelper;
...@@ -602,7 +604,7 @@ class PLATFORM_EXPORT MainThreadSchedulerImpl ...@@ -602,7 +604,7 @@ class PLATFORM_EXPORT MainThreadSchedulerImpl
std::unique_ptr<base::SingleSampleMetric> CreateMaxQueueingTimeMetric(); std::unique_ptr<base::SingleSampleMetric> CreateMaxQueueingTimeMetric();
// An input event of some sort happened, the policy may need updating. // An input event of some sort happened, the policy may need updating.
void UpdateForInputEventOnCompositorThread(WebInputEvent::Type type, void UpdateForInputEventOnCompositorThread(const WebInputEvent& event,
InputEventState input_event_state); InputEventState input_event_state);
// The task cost estimators and the UserModel need to be reset upon page // The task cost estimators and the UserModel need to be reset upon page
...@@ -763,7 +765,8 @@ class PLATFORM_EXPORT MainThreadSchedulerImpl ...@@ -763,7 +765,8 @@ class PLATFORM_EXPORT MainThreadSchedulerImpl
timer_task_estimated_cost; timer_task_estimated_cost;
TraceableState<bool, kTracingCategoryNameInfo> loading_tasks_seem_expensive; TraceableState<bool, kTracingCategoryNameInfo> loading_tasks_seem_expensive;
TraceableState<bool, kTracingCategoryNameInfo> timer_tasks_seem_expensive; TraceableState<bool, kTracingCategoryNameInfo> timer_tasks_seem_expensive;
TraceableState<bool, kTracingCategoryNameDefault> touchstart_expected_soon; TraceableState<bool, kTracingCategoryNameDefault>
blocking_input_expected_soon;
TraceableState<bool, kTracingCategoryNameDebug> TraceableState<bool, kTracingCategoryNameDebug>
have_seen_a_begin_main_frame; have_seen_a_begin_main_frame;
TraceableState<bool, kTracingCategoryNameDebug> TraceableState<bool, kTracingCategoryNameDebug>
...@@ -837,8 +840,7 @@ class PLATFORM_EXPORT MainThreadSchedulerImpl ...@@ -837,8 +840,7 @@ class PLATFORM_EXPORT MainThreadSchedulerImpl
TraceableState<bool, kTracingCategoryNameInfo> TraceableState<bool, kTracingCategoryNameInfo>
last_gesture_was_compositor_driven; last_gesture_was_compositor_driven;
TraceableState<bool, kTracingCategoryNameInfo> default_gesture_prevented; TraceableState<bool, kTracingCategoryNameInfo> default_gesture_prevented;
TraceableState<bool, kTracingCategoryNameInfo> TraceableState<bool, kTracingCategoryNameInfo> have_seen_a_blocking_gesture;
have_seen_a_potentially_blocking_gesture;
TraceableState<bool, kTracingCategoryNameInfo> waiting_for_meaningful_paint; TraceableState<bool, kTracingCategoryNameInfo> waiting_for_meaningful_paint;
TraceableState<bool, kTracingCategoryNameInfo> TraceableState<bool, kTracingCategoryNameInfo>
have_seen_input_since_navigation; have_seen_input_since_navigation;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment