|
|
Created:
4 years, 4 months ago by chongz Modified:
4 years, 3 months ago CC:
anandc+watch-blimp_chromium.org, chromium-reviews, darin-cc_chromium.org, dtapuska+chromiumwatch_chromium.org, dtrainor+watch-blimp_chromium.org, gcasto+watch-blimp_chromium.org, jam, jessicag+watch-blimp_chromium.org, khushalsagar+watch-blimp_chromium.org, kmarshall+watch-blimp_chromium.org, lethalantidote+watch-blimp_chromium.org, maniscalco+watch-blimp_chromium.org, marcinjb+watch-blimp_chromium.org, mlamouri+watch-content_chromium.org, nyquist+watch-blimp_chromium.org, shaktisahu+watch-blimp_chromium.org, sriramsr+watch-blimp_chromium.org, tdresser+watch_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionRefactor compositor event handling path to be callback-based
(A pre-work for compositor VSync aligned input.)
This CL adds |DidHandleInputEventAndOverscroll| method, and will
be passed to |HandleInputEvent| as callback.
(It's hard to use interface-based implementation as
|CompositorMusConnection| already has callback-based method
baked in.)
New event path:
1. |InputEventFilter| |DidForwardToHandlerAndOverscroll|
V ^
|InputHandlerManager| |DidHandleInputEventAndOverscroll|
V ^
|InputHandlerProxy| -> (handle event)
2. |CompositorMusConnection| |DidHandle...AndOverscroll|
V ^
|InputHandlerManager| |DidHandleInputEventAndOverscroll|
V ^
|InputHandlerProxy| -> (handle event)
3. (other sources) ..Wrapper->..Manager->..Filter::DidOverscroll
V ^
|InputHandlerProxy| -> (did overscroll)
Note about overscroll:
Only one of |DidOverscroll| or |DidHandleInputEventAndOverscroll|
will be fired, and it's decided by whether it's caused by an InputEvent.
Note about event queue:
Events are still handled synchronously in |InputHandlerProxy|, following
up CLs will support event queue.
Design Doc: (@chromium.org)
https://docs.google.com/a/chromium.org/document/d/1SUPPJkqxEYMRso3Jw1wZnqD3g1dmif0ic-x5aQkpHBo/edit?usp=sharing
BUG=637393
Committed: https://crrev.com/78f276e96eac5a447149fafac0b4953eb5936979
Cr-Commit-Position: refs/heads/master@{#417788}
Patch Set 1 #
Total comments: 7
Patch Set 2 : dtapuska's review, rename to DidHandleInputEventAndOverScroll #
Total comments: 5
Patch Set 3 : dtapuska's review 2, use WeakPtr, tweak comments #
Total comments: 13
Patch Set 4 : tdresser's review #
Total comments: 2
Patch Set 5 : creis's review, rebase #Messages
Total messages: 63 (43 generated)
The CQ bit was checked by chongz@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== Changed event path to callback-based BUG=637393 ========== to ========== Refactor compositor event handling path to be callback-based This CL is the pre-work for compositor VSync aligned input, where the events will be queued and handled async. Currently the events are still handled synchronously even through we are using callback. Following up CLs will actually queue events in |InputHandlerProxy| and dispatch async. Note: This CL also affects MUS and |DidOverscrollParams| since they are related to the event path. BUG=637393 ==========
Description was changed from ========== Refactor compositor event handling path to be callback-based This CL is the pre-work for compositor VSync aligned input, where the events will be queued and handled async. Currently the events are still handled synchronously even through we are using callback. Following up CLs will actually queue events in |InputHandlerProxy| and dispatch async. Note: This CL also affects MUS and |DidOverscrollParams| since they are related to the event path. BUG=637393 ========== to ========== Refactor compositor event handling path to be callback-based This CL is the pre-work for compositor VSync aligned input, where eventually events will be queued and handled async. Currently the events are still handled synchronously even through we are using callback. Following up CLs will actually queue events in |InputHandlerProxy| and dispatch async. Note: This CL also affects MUS and |DidOverscrollParams| since they are related to the event path. BUG=637393 ==========
chongz@chromium.org changed reviewers: + dtapuska@chromium.org
dtapuska@ PTAL, thanks! https://codereview.chromium.org/2265393002/diff/1/content/renderer/input/inpu... File content/renderer/input/input_event_filter.h (left): https://codereview.chromium.org/2265393002/diff/1/content/renderer/input/inpu... content/renderer/input/input_event_filter.h:127: std::unique_ptr<ui::DidOverscrollParams>* current_overscroll_params_; |DidOverscrollParams| handling moved to |InputHandlerProxy|. https://codereview.chromium.org/2265393002/diff/1/content/renderer/mus/compos... File content/renderer/mus/compositor_mus_connection.cc (right): https://codereview.chromium.org/2265393002/diff/1/content/renderer/mus/compos... content/renderer/mus/compositor_mus_connection.cc:131: std::move(*ack_callback); Original implementation only takes ownership if we need to send ack, but with the callback-based implementation we don't have enough information in advance. https://codereview.chromium.org/2265393002/diff/1/content/renderer/mus/compos... File content/renderer/mus/compositor_mus_connection_unittest.cc (right): https://codereview.chromium.org/2265393002/diff/1/content/renderer/mus/compos... content/renderer/mus/compositor_mus_connection_unittest.cc:443: EXPECT_EQ(EventResult::UNHANDLED, test_callback->result()); Changed behavior since |CompositorMusConnection::OnWindowInputEvent| has to always take ownership, but it can pass back |EventResult::UNHANDLED| in these case. https://codereview.chromium.org/2265393002/diff/1/ui/events/blink/input_handl... File ui/events/blink/input_handler_proxy.cc (right): https://codereview.chromium.org/2265393002/diff/1/ui/events/blink/input_handl... ui/events/blink/input_handler_proxy.cc:287: std::move(current_overscroll_params_)); Handles event immediately. https://codereview.chromium.org/2265393002/diff/1/ui/events/blink/input_handl... ui/events/blink/input_handler_proxy.cc:1165: bundle_ack_with_triggering_event); Have to pass raw data instead of |DidOverscrollParams| for |InputHandlerProxyTest|.
dtapuska@chromium.org changed reviewers: + tdresser@chromium.org
https://codereview.chromium.org/2265393002/diff/1/content/renderer/input/inpu... File content/renderer/input/input_handler_manager.h (right): https://codereview.chromium.org/2265393002/diff/1/content/renderer/input/inpu... content/renderer/input/input_handler_manager.h:91: void DidOverscroll(int routing_id, I find this DidOverscroll vs DidHandleInputEvent confusing. I wonder if the callback should be something like a progress callback. If there is an event associated with the callback then an InputEventAck will be sent. If there is no associated event; then send the InputHostMsg_DidOverscroll. I know you researched whether we could just do a direct class callback and that the problem was that mus wanted to be an alternate handler for input messages. Can MUS and Chrome IPC be used at the same time? If not I wonder if this could just be setting the client interface to a new handle. tdresser@ thoughts; callbacks seem to generate spaghetti code callgraphs to me.
Description was changed from ========== Refactor compositor event handling path to be callback-based This CL is the pre-work for compositor VSync aligned input, where eventually events will be queued and handled async. Currently the events are still handled synchronously even through we are using callback. Following up CLs will actually queue events in |InputHandlerProxy| and dispatch async. Note: This CL also affects MUS and |DidOverscrollParams| since they are related to the event path. BUG=637393 ========== to ========== Refactor compositor event handling path to be callback-based This CL is the pre-work for compositor VSync aligned input, where eventually events will be queued and handled async. Currently the events are still handled synchronously even through we are using callback. Following up CLs will actually queue events in |InputHandlerProxy| and dispatch async. Note: This CL also affects MUS and |DidOverscrollParams| since they are related to the event path. Design Doc: (@chromium.org) https://docs.google.com/a/chromium.org/document/d/1SUPPJkqxEYMRso3Jw1wZnqD3g1... BUG=637393 ==========
https://codereview.chromium.org/2265393002/diff/1/content/renderer/input/inpu... File content/renderer/input/input_handler_manager.h (right): https://codereview.chromium.org/2265393002/diff/1/content/renderer/input/inpu... content/renderer/input/input_handler_manager.h:91: void DidOverscroll(int routing_id, On 2016/08/23 19:34:10, dtapuska wrote: > I find this DidOverscroll vs DidHandleInputEvent confusing. I wonder if the > callback should be something like a progress callback. > > If there is an event associated with the callback then an InputEventAck will be > sent. If there is no associated event; then send the InputHostMsg_DidOverscroll. > > I know you researched whether we could just do a direct class callback and that > the problem was that mus wanted to be an alternate handler for input messages. > Can MUS and Chrome IPC be used at the same time? If not I wonder if this could > just be setting the client interface to a new handle. > > tdresser@ thoughts; callbacks seem to generate spaghetti code callgraphs to me. I've also updated the design doc (@chromium) which discussed some tradeoffs for the approach. PTAL, thanks! https://docs.google.com/a/chromium.org/document/d/1SUPPJkqxEYMRso3Jw1wZnqD3g1...
The CQ bit was checked by chongz@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm6...) android_clang_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clan...) android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_comp...) linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...) linux_chromium_chromeos_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_clobber_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) win_chromium_compile_dbg_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_comp...) win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...) win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...) win_clang on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_clang/builds/...)
The CQ bit was checked by chongz@chromium.org to run a CQ dry run
Patchset #2 (id:20001) has been deleted
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...)
The CQ bit was checked by chongz@chromium.org to run a CQ dry run
Patchset #2 (id:40001) has been deleted
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== Refactor compositor event handling path to be callback-based This CL is the pre-work for compositor VSync aligned input, where eventually events will be queued and handled async. Currently the events are still handled synchronously even through we are using callback. Following up CLs will actually queue events in |InputHandlerProxy| and dispatch async. Note: This CL also affects MUS and |DidOverscrollParams| since they are related to the event path. Design Doc: (@chromium.org) https://docs.google.com/a/chromium.org/document/d/1SUPPJkqxEYMRso3Jw1wZnqD3g1... BUG=637393 ========== to ========== Refactor compositor event handling path to be callback-based (A pre-work for compositor VSync aligned input.) This CL adds |DidHandleInputEventAndOverscroll| method, and will be passed to |HandleInputEvent| as callback. (It's hard to use interface-based implementation as |CompositorMusConnection| already has callback-based method baked in.) New event path: 1. |InputEventFilter| |DidForwardToHandlerAndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 2. |CompositorMusConnection| |DidHandle...AndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 3. (other sources) Wrapper->Manager->Filter::DidOverscroll V ^ |InputHandlerProxy| -> (did overscroll) Note about overscroll: Only one of |DidOverscroll| or |DidHandleInputEventAndOverscroll| will be fired, and it's decided by whether it's caused by an InputEvent. Note about event queue: Events are still handled synchronously in |InputHandlerProxy|, following up CLs will support event queue. Design Doc: (@chromium.org) https://docs.google.com/a/chromium.org/document/d/1SUPPJkqxEYMRso3Jw1wZnqD3g1... BUG=637393 ==========
Description was changed from ========== Refactor compositor event handling path to be callback-based (A pre-work for compositor VSync aligned input.) This CL adds |DidHandleInputEventAndOverscroll| method, and will be passed to |HandleInputEvent| as callback. (It's hard to use interface-based implementation as |CompositorMusConnection| already has callback-based method baked in.) New event path: 1. |InputEventFilter| |DidForwardToHandlerAndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 2. |CompositorMusConnection| |DidHandle...AndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 3. (other sources) Wrapper->Manager->Filter::DidOverscroll V ^ |InputHandlerProxy| -> (did overscroll) Note about overscroll: Only one of |DidOverscroll| or |DidHandleInputEventAndOverscroll| will be fired, and it's decided by whether it's caused by an InputEvent. Note about event queue: Events are still handled synchronously in |InputHandlerProxy|, following up CLs will support event queue. Design Doc: (@chromium.org) https://docs.google.com/a/chromium.org/document/d/1SUPPJkqxEYMRso3Jw1wZnqD3g1... BUG=637393 ========== to ========== Refactor compositor event handling path to be callback-based (A pre-work for compositor VSync aligned input.) This CL adds |DidHandleInputEventAndOverscroll| method, and will be passed to |HandleInputEvent| as callback. (It's hard to use interface-based implementation as |CompositorMusConnection| already has callback-based method baked in.) New event path: 1. |InputEventFilter| |DidForwardToHandlerAndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 2. |CompositorMusConnection| |DidHandle...AndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 3. (other sources) Wrapper->Manager->Filter::DidOverscroll V ^ |InputHandlerProxy| -> (did overscroll) Note about overscroll: Only one of |DidOverscroll| or |DidHandleInputEventAndOverscroll| will be fired, and it's decided by whether it's caused by an InputEvent. Note about event queue: Events are still handled synchronously in |InputHandlerProxy|, following up CLs will support event queue. Design Doc: (@chromium.org) ==========
Description was changed from ========== Refactor compositor event handling path to be callback-based (A pre-work for compositor VSync aligned input.) This CL adds |DidHandleInputEventAndOverscroll| method, and will be passed to |HandleInputEvent| as callback. (It's hard to use interface-based implementation as |CompositorMusConnection| already has callback-based method baked in.) New event path: 1. |InputEventFilter| |DidForwardToHandlerAndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 2. |CompositorMusConnection| |DidHandle...AndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 3. (other sources) Wrapper->Manager->Filter::DidOverscroll V ^ |InputHandlerProxy| -> (did overscroll) Note about overscroll: Only one of |DidOverscroll| or |DidHandleInputEventAndOverscroll| will be fired, and it's decided by whether it's caused by an InputEvent. Note about event queue: Events are still handled synchronously in |InputHandlerProxy|, following up CLs will support event queue. Design Doc: (@chromium.org) ========== to ========== Refactor compositor event handling path to be callback-based (A pre-work for compositor VSync aligned input.) This CL adds |DidHandleInputEventAndOverscroll| method, and will be passed to |HandleInputEvent| as callback. (It's hard to use interface-based implementation as |CompositorMusConnection| already has callback-based method baked in.) New event path: 1. |InputEventFilter| |DidForwardToHandlerAndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 2. |CompositorMusConnection| |DidHandle...AndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 3. (other sources) ..Wrapper->..Manager->..Filter::DidOverscroll V ^ |InputHandlerProxy| -> (did overscroll) Note about overscroll: Only one of |DidOverscroll| or |DidHandleInputEventAndOverscroll| will be fired, and it's decided by whether it's caused by an InputEvent. Note about event queue: Events are still handled synchronously in |InputHandlerProxy|, following up CLs will support event queue. Design Doc: (@chromium.org) ==========
Description was changed from ========== Refactor compositor event handling path to be callback-based (A pre-work for compositor VSync aligned input.) This CL adds |DidHandleInputEventAndOverscroll| method, and will be passed to |HandleInputEvent| as callback. (It's hard to use interface-based implementation as |CompositorMusConnection| already has callback-based method baked in.) New event path: 1. |InputEventFilter| |DidForwardToHandlerAndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 2. |CompositorMusConnection| |DidHandle...AndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 3. (other sources) ..Wrapper->..Manager->..Filter::DidOverscroll V ^ |InputHandlerProxy| -> (did overscroll) Note about overscroll: Only one of |DidOverscroll| or |DidHandleInputEventAndOverscroll| will be fired, and it's decided by whether it's caused by an InputEvent. Note about event queue: Events are still handled synchronously in |InputHandlerProxy|, following up CLs will support event queue. Design Doc: (@chromium.org) ========== to ========== Refactor compositor event handling path to be callback-based (A pre-work for compositor VSync aligned input.) This CL adds |DidHandleInputEventAndOverscroll| method, and will be passed to |HandleInputEvent| as callback. (It's hard to use interface-based implementation as |CompositorMusConnection| already has callback-based method baked in.) New event path: 1. |InputEventFilter| |DidForwardToHandlerAndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 2. |CompositorMusConnection| |DidHandle...AndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 3. (other sources) ..Wrapper->..Manager->..Filter::DidOverscroll V ^ |InputHandlerProxy| -> (did overscroll) Note about overscroll: Only one of |DidOverscroll| or |DidHandleInputEventAndOverscroll| will be fired, and it's decided by whether it's caused by an InputEvent. Note about event queue: Events are still handled synchronously in |InputHandlerProxy|, following up CLs will support event queue. Design Doc: (@chromium.org) ==========
Description was changed from ========== Refactor compositor event handling path to be callback-based (A pre-work for compositor VSync aligned input.) This CL adds |DidHandleInputEventAndOverscroll| method, and will be passed to |HandleInputEvent| as callback. (It's hard to use interface-based implementation as |CompositorMusConnection| already has callback-based method baked in.) New event path: 1. |InputEventFilter| |DidForwardToHandlerAndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 2. |CompositorMusConnection| |DidHandle...AndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 3. (other sources) ..Wrapper->..Manager->..Filter::DidOverscroll V ^ |InputHandlerProxy| -> (did overscroll) Note about overscroll: Only one of |DidOverscroll| or |DidHandleInputEventAndOverscroll| will be fired, and it's decided by whether it's caused by an InputEvent. Note about event queue: Events are still handled synchronously in |InputHandlerProxy|, following up CLs will support event queue. Design Doc: (@chromium.org) ========== to ========== Refactor compositor event handling path to be callback-based (A pre-work for compositor VSync aligned input.) This CL adds |DidHandleInputEventAndOverscroll| method, and will be passed to |HandleInputEvent| as callback. (It's hard to use interface-based implementation as |CompositorMusConnection| already has callback-based method baked in.) New event path: 1. |InputEventFilter| |DidForwardToHandlerAndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 2. |CompositorMusConnection| |DidHandle...AndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 3. (other sources) ..Wrapper->..Manager->..Filter::DidOverscroll V ^ |InputHandlerProxy| -> (did overscroll) Note about overscroll: Only one of |DidOverscroll| or |DidHandleInputEventAndOverscroll| will be fired, and it's decided by whether it's caused by an InputEvent. Note about event queue: Events are still handled synchronously in |InputHandlerProxy|, following up CLs will support event queue. Design Doc: (@chromium.org) https://docs.google.com/a/chromium.org/document/d/1SUPPJkqxEYMRso3Jw1wZnqD3g1... ==========
Description was changed from ========== Refactor compositor event handling path to be callback-based (A pre-work for compositor VSync aligned input.) This CL adds |DidHandleInputEventAndOverscroll| method, and will be passed to |HandleInputEvent| as callback. (It's hard to use interface-based implementation as |CompositorMusConnection| already has callback-based method baked in.) New event path: 1. |InputEventFilter| |DidForwardToHandlerAndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 2. |CompositorMusConnection| |DidHandle...AndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 3. (other sources) ..Wrapper->..Manager->..Filter::DidOverscroll V ^ |InputHandlerProxy| -> (did overscroll) Note about overscroll: Only one of |DidOverscroll| or |DidHandleInputEventAndOverscroll| will be fired, and it's decided by whether it's caused by an InputEvent. Note about event queue: Events are still handled synchronously in |InputHandlerProxy|, following up CLs will support event queue. Design Doc: (@chromium.org) https://docs.google.com/a/chromium.org/document/d/1SUPPJkqxEYMRso3Jw1wZnqD3g1... ========== to ========== Refactor compositor event handling path to be callback-based (A pre-work for compositor VSync aligned input.) This CL adds |DidHandleInputEventAndOverscroll| method, and will be passed to |HandleInputEvent| as callback. (It's hard to use interface-based implementation as |CompositorMusConnection| already has callback-based method baked in.) New event path: 1. |InputEventFilter| |DidForwardToHandlerAndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 2. |CompositorMusConnection| |DidHandle...AndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 3. (other sources) ..Wrapper->..Manager->..Filter::DidOverscroll V ^ |InputHandlerProxy| -> (did overscroll) Note about overscroll: Only one of |DidOverscroll| or |DidHandleInputEventAndOverscroll| will be fired, and it's decided by whether it's caused by an InputEvent. Note about event queue: Events are still handled synchronously in |InputHandlerProxy|, following up CLs will support event queue. Design Doc: (@chromium.org) https://docs.google.com/a/chromium.org/document/d/1SUPPJkqxEYMRso3Jw1wZnqD3g1... BUG=637393 ==========
dtapuska@ I've made a compromise solution to our last discussion and updated CL description, PTAL, thanks! https://codereview.chromium.org/2265393002/diff/60001/content/renderer/input/... File content/renderer/input/input_handler_manager.h (right): https://codereview.chromium.org/2265393002/diff/60001/content/renderer/input/... content/renderer/input/input_handler_manager.h:95: void DidOverscroll(int routing_id, const ui::DidOverscrollParams& params); I cannot fully merge |DidOverscroll| and |DidHandleInputEvent| into a single callback as other overscroll sources require the client interface. A compromise solution is to rename |DidHandleInputEvent| => |DidHandleInputEventAndOverscroll|, such that: 1. All InputEvent triggered overscroll will go into |DidHandleInputEventAndOverscroll| 2. Other sources of overscroll with go into |DidOverscroll| Please see CL description for more detailed event path.
seems reasonable to me. https://codereview.chromium.org/2265393002/diff/60001/content/renderer/input/... File content/renderer/input/input_handler_manager.cc (right): https://codereview.chromium.org/2265393002/diff/60001/content/renderer/input/... content/renderer/input/input_handler_manager.cc:224: base::Unretained(this), callback)); What is the life cycle here? https://codereview.chromium.org/2265393002/diff/60001/content/renderer/input/... File content/renderer/input/input_handler_manager_client.h (right): https://codereview.chromium.org/2265393002/diff/60001/content/renderer/input/... content/renderer/input/input_handler_manager_client.h:44: // InputEvent associated overscroll will be returned along with the callback. Likely should reference what callback you are indicating here that it it is part of the HandleInputEvent method args.
The CQ bit was checked by chongz@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
dtapuska@ I've updated as per your comments, PTAL again, thanks! https://codereview.chromium.org/2265393002/diff/60001/content/renderer/input/... File content/renderer/input/input_handler_manager.cc (right): https://codereview.chromium.org/2265393002/diff/60001/content/renderer/input/... content/renderer/input/input_handler_manager.cc:224: base::Unretained(this), callback)); On 2016/08/30 18:33:50, dtapuska wrote: > What is the life cycle here? According to my knowledge |InputHandlerManager| was created and destroyed along with |RenderThreadImpl|, and |InputHandlerManager| is managing |InputHandlerWrapper|s. But just for safety I've changed it to WeakPtr. https://codereview.chromium.org/2265393002/diff/60001/content/renderer/input/... File content/renderer/input/input_handler_manager_client.h (right): https://codereview.chromium.org/2265393002/diff/60001/content/renderer/input/... content/renderer/input/input_handler_manager_client.h:44: // InputEvent associated overscroll will be returned along with the callback. On 2016/08/30 18:33:50, dtapuska wrote: > Likely should reference what callback you are indicating here that it it is part > of the HandleInputEvent method args. Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
tdresser@ PTAL, thanks!
This LGTM to me at a high level, but wait for Dave's more thorough review. https://codereview.chromium.org/2265393002/diff/80001/content/renderer/input/... File content/renderer/input/input_handler_manager.h (right): https://codereview.chromium.org/2265393002/diff/80001/content/renderer/input/... content/renderer/input/input_handler_manager.h:129: using EventDisposition = ui::InputHandlerProxy::EventDisposition; I'm not sure it's worth this "using" for two uses. https://codereview.chromium.org/2265393002/diff/80001/content/renderer/mus/co... File content/renderer/mus/compositor_mus_connection.cc (right): https://codereview.chromium.org/2265393002/diff/80001/content/renderer/mus/co... content/renderer/mus/compositor_mus_connection.cc:132: ui::ScopedWebInputEvent web_event = ui::WebInputEventTraits::Clone( Why do we need to clone the event now? https://codereview.chromium.org/2265393002/diff/80001/content/renderer/mus/co... content/renderer/mus/compositor_mus_connection.cc:180: base::Passed(&web_event), ack)); It isn't clear to me why this changed from std::move. https://codereview.chromium.org/2265393002/diff/80001/ui/events/blink/input_h... File ui/events/blink/input_handler_proxy.cc (right): https://codereview.chromium.org/2265393002/diff/80001/ui/events/blink/input_h... ui/events/blink/input_handler_proxy.cc:64: const bool kBundleAckWithTriggeringEvent = true; The point of this bool is just to make this easy to revert, right? It seems like it's adding some complexity, and I'm not sure it's worth it. https://codereview.chromium.org/2265393002/diff/80001/ui/events/blink/input_h... ui/events/blink/input_handler_proxy.cc:1114: bool bundle_ack_with_triggering_event) { Can we tweak this naming? bundle_overscroll_params_with_ack perhaps? https://codereview.chromium.org/2265393002/diff/80001/ui/events/blink/input_h... File ui/events/blink/input_handler_proxy_client.h (right): https://codereview.chromium.org/2265393002/diff/80001/ui/events/blink/input_h... ui/events/blink/input_handler_proxy_client.h:35: // Overscroll triggered by |HandleInputEvent/WithLatencyInfo| will response to This sentence doesn't quite make sense. "|HandleInputEvent/WithLatencyInfo| will respond to overscroll by calling the passed in callback." perhaps?
The CQ bit was checked by chongz@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
dtapuska@ PTAL, thanks! https://codereview.chromium.org/2265393002/diff/80001/content/renderer/input/... File content/renderer/input/input_handler_manager.h (right): https://codereview.chromium.org/2265393002/diff/80001/content/renderer/input/... content/renderer/input/input_handler_manager.h:129: using EventDisposition = ui::InputHandlerProxy::EventDisposition; On 2016/09/01 16:58:45, tdresser wrote: > I'm not sure it's worth this "using" for two uses. Removed. https://codereview.chromium.org/2265393002/diff/80001/content/renderer/mus/co... File content/renderer/mus/compositor_mus_connection.cc (right): https://codereview.chromium.org/2265393002/diff/80001/content/renderer/mus/co... content/renderer/mus/compositor_mus_connection.cc:132: ui::ScopedWebInputEvent web_event = ui::WebInputEventTraits::Clone( On 2016/09/01 16:58:45, tdresser wrote: > Why do we need to clone the event now? Sorry I misused Clone. Fixed. https://codereview.chromium.org/2265393002/diff/80001/content/renderer/mus/co... content/renderer/mus/compositor_mus_connection.cc:180: base::Passed(&web_event), ack)); On 2016/09/01 16:58:45, tdresser wrote: > It isn't clear to me why this changed from std::move. Changed back to |std::move|. There is no actual difference. I'm just applying the syntactic sugar introduced in "bind_helpers.h:433" and to keep consistence with my new code: 141 this, base::Passed(&callback))); See "bind_helpers.h:433": https://cs.chromium.org/chromium/src/base/bind_helpers.h?q=base::passed&sq=pa... https://codereview.chromium.org/2265393002/diff/80001/ui/events/blink/input_h... File ui/events/blink/input_handler_proxy.cc (right): https://codereview.chromium.org/2265393002/diff/80001/ui/events/blink/input_h... ui/events/blink/input_handler_proxy.cc:64: const bool kBundleAckWithTriggeringEvent = true; On 2016/09/01 16:58:45, tdresser wrote: > The point of this bool is just to make this easy to revert, right? It seems like > it's adding some complexity, and I'm not sure it's worth it. Removed. I was just trying to avoid passing raw 'true'/'false'. I thought I read it from code style but I might be wrong. https://codereview.chromium.org/2265393002/diff/80001/ui/events/blink/input_h... ui/events/blink/input_handler_proxy.cc:1114: bool bundle_ack_with_triggering_event) { On 2016/09/01 16:58:45, tdresser wrote: > Can we tweak this naming? bundle_overscroll_params_with_ack perhaps? Done. https://codereview.chromium.org/2265393002/diff/80001/ui/events/blink/input_h... File ui/events/blink/input_handler_proxy_client.h (right): https://codereview.chromium.org/2265393002/diff/80001/ui/events/blink/input_h... ui/events/blink/input_handler_proxy_client.h:35: // Overscroll triggered by |HandleInputEvent/WithLatencyInfo| will response to On 2016/09/01 16:58:45, tdresser wrote: > This sentence doesn't quite make sense. > > "|HandleInputEvent/WithLatencyInfo| will respond to overscroll by calling the > passed in callback." perhaps? Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2265393002/diff/80001/ui/events/blink/input_h... File ui/events/blink/input_handler_proxy.cc (right): https://codereview.chromium.org/2265393002/diff/80001/ui/events/blink/input_h... ui/events/blink/input_handler_proxy.cc:64: const bool kBundleAckWithTriggeringEvent = true; On 2016/09/01 20:13:13, chongz wrote: > On 2016/09/01 16:58:45, tdresser wrote: > > The point of this bool is just to make this easy to revert, right? It seems > like > > it's adding some complexity, and I'm not sure it's worth it. > > Removed. > > I was just trying to avoid passing raw 'true'/'false'. I thought I read it from > code style but I might be wrong. Yup, that is general good practice. I'd tend to do it by making the parameter a two valued enum type though.
lgtm
chongz@chromium.org changed reviewers: + ben@chromium.org
ben@ PTAL, thanks!
ben@ can you take a look at this CL please? Thanks!
chongz@chromium.org changed reviewers: + creis@chromium.org
creis@ PTAL, thanks! (Seems Ben is not available)
RS LGTM. https://codereview.chromium.org/2265393002/diff/100001/content/renderer/mus/c... File content/renderer/mus/compositor_mus_connection.h (right): https://codereview.chromium.org/2265393002/diff/100001/content/renderer/mus/c... content/renderer/mus/compositor_mus_connection.h:95: std::unique_ptr<ui::DidOverscrollParams>); nit: Please name parameters.
Sorry I didn't see this until now (sometimes I aggressively archive too much + vacation). Please feel free to ping me via IM if I don't get back to you within 24hrs.
https://codereview.chromium.org/2265393002/diff/100001/content/renderer/mus/c... File content/renderer/mus/compositor_mus_connection.h (right): https://codereview.chromium.org/2265393002/diff/100001/content/renderer/mus/c... content/renderer/mus/compositor_mus_connection.h:95: std::unique_ptr<ui::DidOverscrollParams>); On 2016/09/09 20:57:57, Charlie Reis (slow) wrote: > nit: Please name parameters. Done.
The CQ bit was checked by chongz@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from tdresser@chromium.org, creis@chromium.org, dtapuska@chromium.org Link to the patchset: https://codereview.chromium.org/2265393002/#ps120001 (title: "creis's review, rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Refactor compositor event handling path to be callback-based (A pre-work for compositor VSync aligned input.) This CL adds |DidHandleInputEventAndOverscroll| method, and will be passed to |HandleInputEvent| as callback. (It's hard to use interface-based implementation as |CompositorMusConnection| already has callback-based method baked in.) New event path: 1. |InputEventFilter| |DidForwardToHandlerAndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 2. |CompositorMusConnection| |DidHandle...AndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 3. (other sources) ..Wrapper->..Manager->..Filter::DidOverscroll V ^ |InputHandlerProxy| -> (did overscroll) Note about overscroll: Only one of |DidOverscroll| or |DidHandleInputEventAndOverscroll| will be fired, and it's decided by whether it's caused by an InputEvent. Note about event queue: Events are still handled synchronously in |InputHandlerProxy|, following up CLs will support event queue. Design Doc: (@chromium.org) https://docs.google.com/a/chromium.org/document/d/1SUPPJkqxEYMRso3Jw1wZnqD3g1... BUG=637393 ========== to ========== Refactor compositor event handling path to be callback-based (A pre-work for compositor VSync aligned input.) This CL adds |DidHandleInputEventAndOverscroll| method, and will be passed to |HandleInputEvent| as callback. (It's hard to use interface-based implementation as |CompositorMusConnection| already has callback-based method baked in.) New event path: 1. |InputEventFilter| |DidForwardToHandlerAndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 2. |CompositorMusConnection| |DidHandle...AndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 3. (other sources) ..Wrapper->..Manager->..Filter::DidOverscroll V ^ |InputHandlerProxy| -> (did overscroll) Note about overscroll: Only one of |DidOverscroll| or |DidHandleInputEventAndOverscroll| will be fired, and it's decided by whether it's caused by an InputEvent. Note about event queue: Events are still handled synchronously in |InputHandlerProxy|, following up CLs will support event queue. Design Doc: (@chromium.org) https://docs.google.com/a/chromium.org/document/d/1SUPPJkqxEYMRso3Jw1wZnqD3g1... BUG=637393 ==========
Message was sent while issue was closed.
Committed patchset #5 (id:120001)
Message was sent while issue was closed.
Description was changed from ========== Refactor compositor event handling path to be callback-based (A pre-work for compositor VSync aligned input.) This CL adds |DidHandleInputEventAndOverscroll| method, and will be passed to |HandleInputEvent| as callback. (It's hard to use interface-based implementation as |CompositorMusConnection| already has callback-based method baked in.) New event path: 1. |InputEventFilter| |DidForwardToHandlerAndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 2. |CompositorMusConnection| |DidHandle...AndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 3. (other sources) ..Wrapper->..Manager->..Filter::DidOverscroll V ^ |InputHandlerProxy| -> (did overscroll) Note about overscroll: Only one of |DidOverscroll| or |DidHandleInputEventAndOverscroll| will be fired, and it's decided by whether it's caused by an InputEvent. Note about event queue: Events are still handled synchronously in |InputHandlerProxy|, following up CLs will support event queue. Design Doc: (@chromium.org) https://docs.google.com/a/chromium.org/document/d/1SUPPJkqxEYMRso3Jw1wZnqD3g1... BUG=637393 ========== to ========== Refactor compositor event handling path to be callback-based (A pre-work for compositor VSync aligned input.) This CL adds |DidHandleInputEventAndOverscroll| method, and will be passed to |HandleInputEvent| as callback. (It's hard to use interface-based implementation as |CompositorMusConnection| already has callback-based method baked in.) New event path: 1. |InputEventFilter| |DidForwardToHandlerAndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 2. |CompositorMusConnection| |DidHandle...AndOverscroll| V ^ |InputHandlerManager| |DidHandleInputEventAndOverscroll| V ^ |InputHandlerProxy| -> (handle event) 3. (other sources) ..Wrapper->..Manager->..Filter::DidOverscroll V ^ |InputHandlerProxy| -> (did overscroll) Note about overscroll: Only one of |DidOverscroll| or |DidHandleInputEventAndOverscroll| will be fired, and it's decided by whether it's caused by an InputEvent. Note about event queue: Events are still handled synchronously in |InputHandlerProxy|, following up CLs will support event queue. Design Doc: (@chromium.org) https://docs.google.com/a/chromium.org/document/d/1SUPPJkqxEYMRso3Jw1wZnqD3g1... BUG=637393 Committed: https://crrev.com/78f276e96eac5a447149fafac0b4953eb5936979 Cr-Commit-Position: refs/heads/master@{#417788} ==========
Message was sent while issue was closed.
Patchset 5 (id:??) landed as https://crrev.com/78f276e96eac5a447149fafac0b4953eb5936979 Cr-Commit-Position: refs/heads/master@{#417788} |