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

Issue 2782553002: Fix priority of TaskQueue::QueueType::COMPOSITOR on touch events

Created:
3 years, 8 months ago by blazern
Modified:
3 years, 8 months ago
Reviewers:
dtapuska, Sami
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, jam, darin-cc_chromium.org, dtapuska+chromiumwatch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix priority of TaskQueue::QueueType::COMPOSITOR on touch events RendererSchedulerImpl::UpdatePolicyLocked attempts to increase priority of TaskQueue::QueueType::COMPOSITOR on touch events. To do that, it asks UserModel if it expects a gesture. UserModel starts expecting a gesture when its method DidStartProcessingInputEvent is called. The method DidStartProcessingInputEvent was not called for blink::WebInputEvent::TouchStart, even though the method clearly expects the event (compares its input param with it), and the event signals of a gesture start. The method UserModel::DidStartProcessingInputEvent should propogate blink::WebInputEvent::TouchStart by next call stack: InputHandlerManager::DidHandleInputEventAndOverscroll => RendererSchedulerImpl::DidHandleInputEventOnCompositorThread => RendererSchedulerImpl::UpdateForInputEventOnCompositorThread => UserModel::DidStartProcessingInputEvent But the top method (DidHandleInputEventAndOverscroll) doesn't propogate event blink::WebInputEvent::TouchStart when it is received. The method doesn't propogate the event because a switch-case in it doesn't handle InputEventAckState::INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING (which is generated for blink::WebInputEvent::TouchStart). The switch-case in InputHandlerManager::DidHandleInputEventAndOverscroll was created by commit 7819e255a595, and the not-handled-state (InputEventAckState::INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING) didn't exist back then - the switch-case handled all meaningful elements of InputEventAckState back then (the elements that meant that the touch event was not ignored). When InputEventAckState::INPUT_EVENT_ACK_STATE_SET_NON_BLOCKING was created (0bd451acef1d), a case for it was not added to the switch-case, which causes blink::WebInputEvent::TouchStart to be ignored by InputHandlerManager::DidHandleInputEventAndOverscroll. BUG=705884

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+219 lines, -0 lines) Patch
M content/renderer/input/input_handler_manager.cc View 1 chunk +1 line, -0 lines 0 comments Download
A content/renderer/input/input_handler_manager_unittest.cc View 1 chunk +217 lines, -0 lines 0 comments Download
M content/test/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 10 (4 generated)
blazern
3 years, 8 months ago (2017-03-28 08:26:27 UTC) #5
dtapuska
On 2017/03/28 08:26:27, blazern wrote: Not lgtm; this is explicitly on purpose. This will cause ...
3 years, 8 months ago (2017-03-28 13:33:03 UTC) #6
Sami
That's right, we don't need to worry too much about the latency of non-blocking input ...
3 years, 8 months ago (2017-03-28 13:42:35 UTC) #7
dtapuska
On 2017/03/28 13:42:35, Sami wrote: > That's right, we don't need to worry too much ...
3 years, 8 months ago (2017-03-28 13:49:37 UTC) #8
Sami
On 2017/03/28 13:49:37, dtapuska wrote: > That being said I think we need to tell ...
3 years, 8 months ago (2017-03-28 13:51:27 UTC) #9
blazern
3 years, 8 months ago (2017-03-29 06:38:14 UTC) #10
On 2017/03/28 13:42:35, Sami wrote:
> That's right, we don't need to worry too much about the latency of
non-blocking
> input events on the main thread.
> 
> Do you have an example page where this caused a performance problem?

Yes, I do.
The example page is news-site http://www.rbc.ru/.

To reproduce the performance problem one should:
1. Build the browser in debug mode (so it would be slower and the problem would
more likely to appear).
2. Start the browser with flag "--process-per-site" (so that subpages of a page
would load in the same process).
3. Open http://www.rbc.ru/.
4. Scroll down news articles list.
5. Start opening the articles in separate tabs by longclicking them and
selecting "Open in new tab".
After one or two opened tabs the render process stops reacting to long clicks
for 5-10 seconds.
It's important to not scroll when performing the 5th step (openning multiple
articles), as it seems that scroll increases compositor's priority and as a
result long clicks are handled fast.

A screenrecord of reproducing: https://youtu.be/WvfJgs_xkRM
A screenrecord of reproducing attempt after applying the proposed patch:
https://youtu.be/RqyTRTSn29A

Powered by Google App Engine
This is Rietveld 408576698