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

Issue 131373004: Let the browser know the end of fling (Closed)

Created:
6 years, 11 months ago by Xianzhu
Modified:
6 years, 11 months ago
CC:
chromium-reviews, yusukes+watch_chromium.org, yukishiino+watch_chromium.org, jam, penghuang+watch_chromium.org, joi+watch-content_chromium.org, nona+watch_chromium.org, darin-cc_chromium.org, James Su, miu+watch_chromium.org, gone
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Let the browser know the end of fling On Android, resize event caused by showing/hiding top controls may be expensive and cause janky fling if it is sent before the end of fling. Let the browser know the end of fling so that the browser can delay the resize event. As we have not resolved the issue of raciness between the main thread and the compositor thread, and between the renderer process and the browser process, about the sequence of fling events and notifications, for now we don't use the notification to update the fling status in ContentViewGestureHandler and GestureEventFilter. The DidStopFlinging notification is sent along the following path: - Renderer side: - compositor-thread-flinging: InputHandlerProxy::CancelCurrentFling() -> InputHandlerWrapper::DidStopFlinging() -> InputHandlerManager::DidStopFlinging() -> InputEventFilter::DidStopFlinging() -> IPC::Sender::Send(ViewHostMsg_DidStopFlinging) - main-thread-flinging (existing except the steps same as compositor-thread-flinging): WebViewImpl::endActiveFlingAnimation() -> RenderWidgetCompositor::didStopFlinging() -> LayerTreeHost::didStopFlinging() -> ThreadProxy::MainThreadHasStoppedFlinging() -> LayerTreeHostImpl::MainThreadHasStoppedFlinging() -> InputHandlerProxy::MainThreadHasStoppedFlinging() then same as compositor-thread-flinging[1:] - Browser side: RenderWidgetHostImpl::OnMessageReceived(ViewHostMsg_DidStopFlinging) -> RenderWidgetHostImpl::OnFlingingStopped() // Android only. No-op on other platforms -> RenderWidgetHostViewAndroid::DidStopFlinging() -> ContentViewCoreImpl::DidStopFlinging() -> ContentViewCore.onNativeFlingStopped() // Java -> ContentViewClient.onFlingStopped() then downstream embedder code BUG=244736 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=245624

Patch Set 1 #

Total comments: 6

Patch Set 2 : Add DidStartFlinging(); Don't bother ContentViewGestureHandler and GestureEventFilter # #

Total comments: 5

Patch Set 3 : OnStartFlingEventAck #

Patch Set 4 : Pair onFlingStarted() and onFlingStopped() #

Total comments: 3

Patch Set 5 : Handle fling transition compositor->main thread #

Total comments: 5

Patch Set 6 : Finish in_process path #

Patch Set 7 : SetNeedsRedraw in AnimateTopControls #

Total comments: 2

Patch Set 8 : For landing #

Patch Set 9 : Fix compile break #

Unified diffs Side-by-side diffs Delta from patch set Stats (+130 lines, -29 lines) Patch
M cc/trees/layer_tree_host_impl.cc View 1 2 3 4 5 6 1 chunk +8 lines, -2 lines 0 comments Download
M content/browser/android/content_view_core_impl.h View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download
M content/browser/android/content_view_core_impl.cc View 1 2 3 2 chunks +11 lines, -2 lines 0 comments Download
M content/browser/android/in_process/synchronous_compositor_impl.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/android/in_process/synchronous_compositor_impl.cc View 1 2 3 4 5 1 chunk +7 lines, -0 lines 0 comments Download
M content/browser/android/in_process/synchronous_input_event_filter.h View 2 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/android/in_process/synchronous_input_event_filter.cc View 1 2 3 4 5 1 chunk +9 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.h View 2 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.cc View 1 2 3 4 5 2 chunks +6 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_android.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_android.cc View 1 2 3 4 5 2 chunks +7 lines, -3 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_base.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M content/common/view_messages.h View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M content/port/browser/render_widget_host_view_port.h View 2 1 chunk +2 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/ContentViewClient.java View 1 2 3 1 chunk +14 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java View 1 2 3 4 5 3 chunks +14 lines, -2 lines 0 comments Download
M content/renderer/input/input_event_filter.h View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M content/renderer/input/input_event_filter.cc View 1 2 2 chunks +13 lines, -11 lines 0 comments Download
M content/renderer/input/input_handler_manager.h View 2 1 chunk +3 lines, -0 lines 0 comments Download
M content/renderer/input/input_handler_manager.cc View 2 1 chunk +3 lines, -1 line 0 comments Download
M content/renderer/input/input_handler_manager_client.h View 2 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/input/input_handler_proxy.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/input/input_handler_proxy.cc View 1 2 3 4 6 chunks +9 lines, -5 lines 0 comments Download
M content/renderer/input/input_handler_proxy_client.h View 2 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/input/input_handler_proxy_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/input/input_handler_wrapper.h View 2 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/input/input_handler_wrapper.cc View 2 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 47 (0 generated)
Xianzhu
jdduke: Java code, content/renderer/input, content/browser/android, content/browser/renderer_host/input aelias: above + content/browser/renderer_host/render_widget_host_view_android.* jochen: other content files dcheng: ...
6 years, 11 months ago (2014-01-09 19:48:10 UTC) #1
Xianzhu
About the naming: - DidStopFlinging (most places): following existing LayerTreeHost::DidStopFlinging - RenderWidgetHostImpl::OnFlingingStopped: following RenderWidgetHostImpl::OnOverscrolled - ...
6 years, 11 months ago (2014-01-09 19:51:00 UTC) #2
jdduke (slow)
My chief concern here is raciness between flings active on main and impl threads. In ...
6 years, 11 months ago (2014-01-09 20:07:13 UTC) #3
Xianzhu
On 2014/01/09 20:07:13, jdduke wrote: > My chief concern here is raciness between flings active ...
6 years, 11 months ago (2014-01-09 22:28:51 UTC) #4
jdduke (slow)
On 2014/01/09 22:28:51, Xianzhu wrote: > On 2014/01/09 20:07:13, jdduke wrote: > > My chief ...
6 years, 11 months ago (2014-01-09 22:36:56 UTC) #5
Xianzhu
On 2014/01/09 22:36:56, jdduke wrote: > Yeah, I was just about to mention the case ...
6 years, 11 months ago (2014-01-10 01:06:20 UTC) #6
jdduke (slow)
This should work, but I'd like to hear what aelias@ thinks. There could still be ...
6 years, 11 months ago (2014-01-10 17:45:59 UTC) #7
Xianzhu
On 2014/01/10 17:45:59, jdduke wrote: ... Your comments remind me a way to ensure the ...
6 years, 11 months ago (2014-01-10 20:16:02 UTC) #8
jdduke (slow)
This looks pretty good. I think the counter would work, you'd just have to increment ...
6 years, 11 months ago (2014-01-10 21:23:11 UTC) #9
Xianzhu
On 2014/01/10 21:23:11, jdduke wrote: > This looks pretty good. I think the counter would ...
6 years, 11 months ago (2014-01-10 22:47:05 UTC) #10
jdduke (slow)
https://codereview.chromium.org/131373004/diff/510001/content/renderer/input/input_handler_proxy.cc File content/renderer/input/input_handler_proxy.cc (right): https://codereview.chromium.org/131373004/diff/510001/content/renderer/input/input_handler_proxy.cc#newcode428 content/renderer/input/input_handler_proxy.cc:428: fling_may_be_active_on_main_thread_ = true; Hmm, I think we need to ...
6 years, 11 months ago (2014-01-10 23:00:03 UTC) #11
jdduke (slow)
https://codereview.chromium.org/131373004/diff/510001/content/renderer/input/input_handler_proxy.cc File content/renderer/input/input_handler_proxy.cc (right): https://codereview.chromium.org/131373004/diff/510001/content/renderer/input/input_handler_proxy.cc#newcode428 content/renderer/input/input_handler_proxy.cc:428: fling_may_be_active_on_main_thread_ = true; On 2014/01/10 23:00:03, jdduke wrote: > ...
6 years, 11 months ago (2014-01-10 23:03:57 UTC) #12
Xianzhu
https://codereview.chromium.org/131373004/diff/510001/content/renderer/input/input_handler_proxy.cc File content/renderer/input/input_handler_proxy.cc (right): https://codereview.chromium.org/131373004/diff/510001/content/renderer/input/input_handler_proxy.cc#newcode428 content/renderer/input/input_handler_proxy.cc:428: fling_may_be_active_on_main_thread_ = true; On 2014/01/10 23:03:58, jdduke wrote: > ...
6 years, 11 months ago (2014-01-10 23:30:44 UTC) #13
jdduke (slow)
On 2014/01/10 23:30:44, Xianzhu wrote: > https://codereview.chromium.org/131373004/diff/510001/content/renderer/input/input_handler_proxy.cc > File content/renderer/input/input_handler_proxy.cc (right): > > https://codereview.chromium.org/131373004/diff/510001/content/renderer/input/input_handler_proxy.cc#newcode428 > ...
6 years, 11 months ago (2014-01-10 23:55:12 UTC) #14
Xianzhu
On 2014/01/10 23:55:12, jdduke wrote: > On 2014/01/10 23:30:44, Xianzhu wrote: > > > https://codereview.chromium.org/131373004/diff/510001/content/renderer/input/input_handler_proxy.cc ...
6 years, 11 months ago (2014-01-11 00:11:12 UTC) #15
Xianzhu
Patch Set 5 handles fling transition case. Can't use |fling_curve_.reset()| because it will break touchscreen's ...
6 years, 11 months ago (2014-01-11 00:18:51 UTC) #16
aelias_OOO_until_Jul13
This is a step along the path of suppressing the main-thread to protect the fast ...
6 years, 11 months ago (2014-01-11 00:45:52 UTC) #17
aelias_OOO_until_Jul13
https://codereview.chromium.org/131373004/diff/580001/content/renderer/input/input_handler_proxy.cc File content/renderer/input/input_handler_proxy.cc (right): https://codereview.chromium.org/131373004/diff/580001/content/renderer/input/input_handler_proxy.cc#newcode349 content/renderer/input/input_handler_proxy.cc:349: CancelCurrentFling(true); Also, a concrete bug here is that this ...
6 years, 11 months ago (2014-01-11 03:07:02 UTC) #18
aelias_OOO_until_Jul13
Another problem is that the notification is racing with tap events. Let's say the user ...
6 years, 11 months ago (2014-01-11 03:13:25 UTC) #19
Xianzhu
On 2014/01/11 03:13:25, aelias wrote: > Another problem is that the notification is racing with ...
6 years, 11 months ago (2014-01-13 17:56:00 UTC) #20
Xianzhu
Based on Alex's hint, I found that cc:TopControlsManager seems a better source of the notification, ...
6 years, 11 months ago (2014-01-15 18:56:45 UTC) #21
jdduke (slow)
mkosiba@: Would WebView have any interest in this kind of notification? For root layer flings, ...
6 years, 11 months ago (2014-01-15 21:50:04 UTC) #22
aelias_OOO_until_Jul13
WebView has a muych easier time with fling because everything happens on the same thread, ...
6 years, 11 months ago (2014-01-15 22:57:08 UTC) #23
jdduke (slow)
Having the message does give us a tighter window, in the event that we use ...
6 years, 11 months ago (2014-01-15 23:23:31 UTC) #24
aelias_OOO_until_Jul13
OK. lgtm to land this as is. I think it's the best we can do ...
6 years, 11 months ago (2014-01-16 00:49:56 UTC) #25
Xianzhu
Thanks for review. FYI, also experimented other 2 ways (for top control resize only, not ...
6 years, 11 months ago (2014-01-16 01:42:52 UTC) #26
aelias_OOO_until_Jul13
For "I think we should also delay the resize after the end of animation if ...
6 years, 11 months ago (2014-01-16 04:17:55 UTC) #27
mkosiba (inactive)
On 2014/01/15 21:50:04, jdduke wrote: > mkosiba@: Would WebView have any interest in this kind ...
6 years, 11 months ago (2014-01-16 13:58:45 UTC) #28
Xianzhu
On 2014/01/16 13:58:45, mkosiba wrote: > On 2014/01/15 21:50:04, jdduke wrote: > > mkosiba@: Would ...
6 years, 11 months ago (2014-01-16 18:00:08 UTC) #29
Xianzhu
On 2014/01/16 04:17:55, aelias wrote: > For "I think we should also delay the resize ...
6 years, 11 months ago (2014-01-16 18:00:45 UTC) #30
Xianzhu
Files still need review: view_messages.h: dcheng@ render_widget_host_view_port.h: jochen@ content/browser/android and content/public/android: jdduke@
6 years, 11 months ago (2014-01-16 18:04:01 UTC) #31
jdduke (slow)
https://codereview.chromium.org/131373004/diff/580001/content/browser/android/in_process/synchronous_input_event_filter.cc File content/browser/android/in_process/synchronous_input_event_filter.cc (right): https://codereview.chromium.org/131373004/diff/580001/content/browser/android/in_process/synchronous_input_event_filter.cc#newcode79 content/browser/android/in_process/synchronous_input_event_filter.cc:79: void SynchronousInputEventFilter::DidStopFlinging(int routing_id) { I'm not totally comfortable leaving ...
6 years, 11 months ago (2014-01-16 18:44:06 UTC) #32
Xianzhu
On 2014/01/16 18:00:08, Xianzhu wrote: > On 2014/01/16 13:58:45, mkosiba wrote: > > Yes, we ...
6 years, 11 months ago (2014-01-16 19:02:24 UTC) #33
jdduke (slow)
On 2014/01/16 19:02:24, Xianzhu wrote: > On 2014/01/16 18:00:08, Xianzhu wrote: > > On 2014/01/16 ...
6 years, 11 months ago (2014-01-16 19:19:20 UTC) #34
jdduke (slow)
On 2014/01/16 19:19:20, jdduke wrote: > On 2014/01/16 19:02:24, Xianzhu wrote: > > On 2014/01/16 ...
6 years, 11 months ago (2014-01-16 19:19:51 UTC) #35
Xianzhu
Just found a bug of the previous patch: the top control animation may hang on ...
6 years, 11 months ago (2014-01-16 20:27:16 UTC) #36
aelias_OOO_until_Jul13
Sounds good, still lgtm.
6 years, 11 months ago (2014-01-16 20:29:18 UTC) #37
Xianzhu
+jln for view_messages.h
6 years, 11 months ago (2014-01-16 22:00:02 UTC) #38
jln (very slow on Chromium)
On 2014/01/16 22:00:02, Xianzhu wrote: > +jln for view_messages.h content/common/view_messages.h lgtm.
6 years, 11 months ago (2014-01-16 22:11:56 UTC) #39
Xianzhu
+joi for content/port/browser/render_widget_host_view_port.h.
6 years, 11 months ago (2014-01-17 01:05:18 UTC) #40
Jói
//content/port LGTM.
6 years, 11 months ago (2014-01-17 08:46:28 UTC) #41
jochen (gone - plz use gerrit)
lgtm https://codereview.chromium.org/131373004/diff/820028/content/browser/renderer_host/render_widget_host_view_base.h File content/browser/renderer_host/render_widget_host_view_base.h (right): https://codereview.chromium.org/131373004/diff/820028/content/browser/renderer_host/render_widget_host_view_base.h#newcode88 content/browser/renderer_host/render_widget_host_view_base.h:88: virtual void DidStopFlinging() OVERRIDE; nit. put the empty ...
6 years, 11 months ago (2014-01-17 12:28:21 UTC) #42
Xianzhu
https://codereview.chromium.org/131373004/diff/820028/content/browser/renderer_host/render_widget_host_view_base.h File content/browser/renderer_host/render_widget_host_view_base.h (right): https://codereview.chromium.org/131373004/diff/820028/content/browser/renderer_host/render_widget_host_view_base.h#newcode88 content/browser/renderer_host/render_widget_host_view_base.h:88: virtual void DidStopFlinging() OVERRIDE; On 2014/01/17 12:28:22, jochen wrote: ...
6 years, 11 months ago (2014-01-17 17:31:07 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wangxianzhu@chromium.org/131373004/1130001
6 years, 11 months ago (2014-01-17 17:31:47 UTC) #44
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) base_unittests, browser_tests, interactive_ui_tests, net_unittests, unit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_rel&number=215518
6 years, 11 months ago (2014-01-17 17:52:58 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wangxianzhu@chromium.org/131373004/1350001
6 years, 11 months ago (2014-01-17 19:01:44 UTC) #46
commit-bot: I haz the power
6 years, 11 months ago (2014-01-17 21:31:46 UTC) #47
Message was sent while issue was closed.
Change committed as 245624

Powered by Google App Engine
This is Rietveld 408576698