|
|
Chromium Code Reviews
DescriptionMissing source pointer down events are handled.
The correct MotionEvent sequence for scrolling is ACTION_DOWN, optional
number of ACTION_POINTER_DOWN, and ACTION_MOVE.
When there are one or two pointers down while moving, and no scrolling
has happened since beginning of the current event sequence, we check to
see if any of the pointers has exeeded their slop region or not.
If yes then scrolling starts and no tap event will happen for the rest
of the current event sequence, otherwise no scroll will happen and if
pointers get released before tap/long tap or two finger tap timers are
expired then those events will happen.
In some cases the ACTION_POINTER_DOWN event is missing from the event
sequence and it results in crashes in GetSourcePointerDownEvent since
the source pointer down event is not found.
This patch skips slop region check for pointers which don't have soure
pointer down event.
BUG=704426
TEST=GestureProviderTest.SlopRegionCheckOnMissingSecondaryPointerDownEvent
Review-Url: https://codereview.chromium.org/2843543002
Cr-Commit-Position: refs/heads/master@{#471872}
Committed: https://chromium.googlesource.com/chromium/src/+/6db0fde5caaa551bbf6e61b69d798a08cffcf11d
Patch Set 1 #
Total comments: 6
Patch Set 2 : Links to the bug added to the comments. #
Total comments: 2
Patch Set 3 : use of reference for the mandatory parameter. #
Messages
Total messages: 42 (24 generated)
The CQ bit was checked by sahel@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 ========== Missing source pointer down events are handled. The correct MotionEvent sequence for scrolling is ACTION_DOWN, optional number of ACTION_POINTER_DOWN, and ACTION_MOVE. When there are one or two pointers down while moving, and no scrolling has happened since beginning of the current event sequence, we check to see if any of the pointers has exeeded their slop region or not. If yes then scrolling starts and no tap event will happen for the rest of the current event sequence, otherwise no scroll will happen and if pointers get released before tap/long tap or two finger tap timers are expired then those events will happen. In some cases the ACTION_POINTER_DOWN event is missing from the event sequence and it results in crashes in GetSourcePointerDownEvent since the source pointer down event is not found. This patch skips slop region check for pointers which don't have soure pointer down event. BUG=704426 TEST=GestureProviderTest.SlopRegionCheckOnMissingSecondaryPointerDownEvent ========== to ========== Missing source pointer down events are handled. The correct MotionEvent sequence for scrolling is ACTION_DOWN, optional number of ACTION_POINTER_DOWN, and ACTION_MOVE. When there are one or two pointers down while moving, and no scrolling has happened since beginning of the current event sequence, we check to see if any of the pointers has exeeded their slop region or not. If yes then scrolling starts and no tap event will happen for the rest of the current event sequence, otherwise no scroll will happen and if pointers get released before tap/long tap or two finger tap timers are expired then those events will happen. In some cases the ACTION_POINTER_DOWN event is missing from the event sequence and it results in crashes in GetSourcePointerDownEvent since the source pointer down event is not found. This patch skips slop region check for pointers which don't have soure pointer down event. BUG=704426 TEST=GestureProviderTest.SlopRegionCheckOnMissingSecondaryPointerDownEvent ==========
sahel@chromium.org changed reviewers: + tdresser@chromium.org
I couldn't reproduce the bug locally, since it doesn't happen in normal even sequences. I only added a unittest that skips the ACTION_POINTER_DOWN event to simulate the real edge case behavior.
This looks like it might be treating a symptom instead of the cause. Do we know why the ACTION_POINTER_DOWN is missing in some cases?
On 2017/04/27 20:21:04, tdresser wrote: > This looks like it might be treating a symptom instead of the cause. > > Do we know why the ACTION_POINTER_DOWN is missing in some cases? No I don't, I could not reproduce the bug locally. But it is similar to crbug.com/675772 In my current solution, if a source pointer down evnt for a given pointer is not found IsInSlop region returns false and since we cannot compute the delta, the pointer is skipped in delta calculation for scrolling.
On 2017/04/27 21:04:20, sahel wrote: > On 2017/04/27 20:21:04, tdresser wrote: > > This looks like it might be treating a symptom instead of the cause. > > > > Do we know why the ACTION_POINTER_DOWN is missing in some cases? > > No I don't, I could not reproduce the bug locally. But it is similar to > crbug.com/675772 > > In my current solution, if a source pointer down evnt for a given pointer is not > found IsInSlop region returns false and since we cannot compute the delta, the > pointer is skipped in delta calculation for scrolling. crbug.com/675772 makes sense, as Android WebView can muck with the gesture stream. Were you trying to repro in the Chrome OS OOBE? It sounds like it only reproduces there, which makes me think it might just be a bug in OOBE code.
On 2017/04/28 13:27:18, tdresser wrote: > On 2017/04/27 21:04:20, sahel wrote: > > On 2017/04/27 20:21:04, tdresser wrote: > > > This looks like it might be treating a symptom instead of the cause. > > > > > > Do we know why the ACTION_POINTER_DOWN is missing in some cases? > > > > No I don't, I could not reproduce the bug locally. But it is similar to > > crbug.com/675772 > > > > In my current solution, if a source pointer down evnt for a given pointer is > not > > found IsInSlop region returns false and since we cannot compute the delta, the > > pointer is skipped in delta calculation for scrolling. > > crbug.com/675772 makes sense, as Android WebView can muck with the gesture > stream. > > Were you trying to repro in the Chrome OS OOBE? It sounds like it only > reproduces there, which makes me think it might just be a bug in OOBE code. I used https://www.chromium.org/chromium-os/force-out-of-box-experience-oobe to force oobe and couldn't still reproduce it. I first deployed my built to my device and then I ran the commands on the link, is this the correct order or I have to reverse the order?
On 2017/05/01 20:39:12, sahel wrote: > On 2017/04/28 13:27:18, tdresser wrote: > > On 2017/04/27 21:04:20, sahel wrote: > > > On 2017/04/27 20:21:04, tdresser wrote: > > > > This looks like it might be treating a symptom instead of the cause. > > > > > > > > Do we know why the ACTION_POINTER_DOWN is missing in some cases? > > > > > > No I don't, I could not reproduce the bug locally. But it is similar to > > > crbug.com/675772 > > > > > > In my current solution, if a source pointer down evnt for a given pointer is > > not > > > found IsInSlop region returns false and since we cannot compute the delta, > the > > > pointer is skipped in delta calculation for scrolling. > > > > crbug.com/675772 makes sense, as Android WebView can muck with the gesture > > stream. > > > > Were you trying to repro in the Chrome OS OOBE? It sounds like it only > > reproduces there, which makes me think it might just be a bug in OOBE code. > > I used https://www.chromium.org/chromium-os/force-out-of-box-experience-oobe to > force oobe and couldn't still reproduce it. > I first deployed my built to my device and then I ran the commands on the link, > is this the correct order or I have to reverse the order? Interesting - just confirming that you were using a debug build? Assuming it did boot into the OOBE, the commands are correct :) I'll follow up on the bug.
On 2017/05/02 12:23:36, tdresser wrote: > On 2017/05/01 20:39:12, sahel wrote: > > On 2017/04/28 13:27:18, tdresser wrote: > > > On 2017/04/27 21:04:20, sahel wrote: > > > > On 2017/04/27 20:21:04, tdresser wrote: > > > > > This looks like it might be treating a symptom instead of the cause. > > > > > > > > > > Do we know why the ACTION_POINTER_DOWN is missing in some cases? > > > > > > > > No I don't, I could not reproduce the bug locally. But it is similar to > > > > crbug.com/675772 > > > > > > > > In my current solution, if a source pointer down evnt for a given pointer > is > > > not > > > > found IsInSlop region returns false and since we cannot compute the delta, > > the > > > > pointer is skipped in delta calculation for scrolling. > > > > > > crbug.com/675772 makes sense, as Android WebView can muck with the gesture > > > stream. > > > > > > Were you trying to repro in the Chrome OS OOBE? It sounds like it only > > > reproduces there, which makes me think it might just be a bug in OOBE code. > > > > I used https://www.chromium.org/chromium-os/force-out-of-box-experience-oobe > to > > force oobe and couldn't still reproduce it. > > I first deployed my built to my device and then I ran the commands on the > link, > > is this the correct order or I have to reverse the order? > > Interesting - just confirming that you were using a debug build? > > Assuming it did boot into the OOBE, the commands are correct :) > > I'll follow up on the bug. I used a release build with dcheck_always_on = true, and I think it rebooted into OOBE since it ran the initial device setup like language, etc. Is there a way to confirm it?
On 2017/05/02 14:29:44, sahel wrote: > On 2017/05/02 12:23:36, tdresser wrote: > > On 2017/05/01 20:39:12, sahel wrote: > > > On 2017/04/28 13:27:18, tdresser wrote: > > > > On 2017/04/27 21:04:20, sahel wrote: > > > > > On 2017/04/27 20:21:04, tdresser wrote: > > > > > > This looks like it might be treating a symptom instead of the cause. > > > > > > > > > > > > Do we know why the ACTION_POINTER_DOWN is missing in some cases? > > > > > > > > > > No I don't, I could not reproduce the bug locally. But it is similar to > > > > > crbug.com/675772 > > > > > > > > > > In my current solution, if a source pointer down evnt for a given > pointer > > is > > > > not > > > > > found IsInSlop region returns false and since we cannot compute the > delta, > > > the > > > > > pointer is skipped in delta calculation for scrolling. > > > > > > > > crbug.com/675772 makes sense, as Android WebView can muck with the gesture > > > > stream. > > > > > > > > Were you trying to repro in the Chrome OS OOBE? It sounds like it only > > > > reproduces there, which makes me think it might just be a bug in OOBE > code. > > > > > > I used https://www.chromium.org/chromium-os/force-out-of-box-experience-oobe > > to > > > force oobe and couldn't still reproduce it. > > > I first deployed my built to my device and then I ran the commands on the > > link, > > > is this the correct order or I have to reverse the order? > > > > Interesting - just confirming that you were using a debug build? > > > > Assuming it did boot into the OOBE, the commands are correct :) > > > > I'll follow up on the bug. > > I used a release build with dcheck_always_on = true, and I think it rebooted > into OOBE since it ran the initial device setup like language, etc. Is there a > way to confirm it? Yeah, that sounds correct. You're confident it was running your build? I seem to recall that depending on how your device is set up, rebooting may cause Chrome OS to stop using your Chrome binary.
On 2017/05/02 14:59:03, tdresser wrote: > On 2017/05/02 14:29:44, sahel wrote: > > On 2017/05/02 12:23:36, tdresser wrote: > > > On 2017/05/01 20:39:12, sahel wrote: > > > > On 2017/04/28 13:27:18, tdresser wrote: > > > > > On 2017/04/27 21:04:20, sahel wrote: > > > > > > On 2017/04/27 20:21:04, tdresser wrote: > > > > > > > This looks like it might be treating a symptom instead of the cause. > > > > > > > > > > > > > > Do we know why the ACTION_POINTER_DOWN is missing in some cases? > > > > > > > > > > > > No I don't, I could not reproduce the bug locally. But it is similar > to > > > > > > crbug.com/675772 > > > > > > > > > > > > In my current solution, if a source pointer down evnt for a given > > pointer > > > is > > > > > not > > > > > > found IsInSlop region returns false and since we cannot compute the > > delta, > > > > the > > > > > > pointer is skipped in delta calculation for scrolling. > > > > > > > > > > crbug.com/675772 makes sense, as Android WebView can muck with the > gesture > > > > > stream. > > > > > > > > > > Were you trying to repro in the Chrome OS OOBE? It sounds like it only > > > > > reproduces there, which makes me think it might just be a bug in OOBE > > code. > > > > > > > > I used > https://www.chromium.org/chromium-os/force-out-of-box-experience-oobe > > > to > > > > force oobe and couldn't still reproduce it. > > > > I first deployed my built to my device and then I ran the commands on the > > > link, > > > > is this the correct order or I have to reverse the order? > > > > > > Interesting - just confirming that you were using a debug build? > > > > > > Assuming it did boot into the OOBE, the commands are correct :) > > > > > > I'll follow up on the bug. > > > > I used a release build with dcheck_always_on = true, and I think it rebooted > > into OOBE since it ran the initial device setup like language, etc. Is there a > > way to confirm it? > > Yeah, that sounds correct. > > You're confident it was running your build? I seem to recall that depending on > how your device is set up, rebooting may cause Chrome OS to stop using your > Chrome binary. I confirm that I had dcheck_always_on = true in my gn args, the OS was using my build (I checked the log file), and I forced oobe and it did start the first start up wizard. I could not reproduce the DCHECK failing crash with mixing 1-10 finger pinch and scrolling, neither with palm and fist random movements on the screen. Should I try it on another device?
Nope, let's just go ahead with this approach. I was hoping we'd be able to find a repro, but if we really can't reproduce it, this approach is probably correct. https://codereview.chromium.org/2843543002/diff/1/ui/events/gesture_detection... File ui/events/gesture_detection/gesture_detector.cc (right): https://codereview.chromium.org/2843543002/diff/1/ui/events/gesture_detection... ui/events/gesture_detection/gesture_detector.cc:587: // not found. Add a link to the bug, and mention that this is sometimes missing, but we don't have a reliable repro. https://codereview.chromium.org/2843543002/diff/1/ui/events/gesture_detection... File ui/events/gesture_detection/gesture_detector.h (right): https://codereview.chromium.org/2843543002/diff/1/ui/events/gesture_detection... ui/events/gesture_detection/gesture_detector.h:106: const MotionEvent* current_down_event, We always have a current_down_event, don't we? https://codereview.chromium.org/2843543002/diff/1/ui/events/gesture_detection... File ui/events/gesture_detection/gesture_provider_unittest.cc (right): https://codereview.chromium.org/2843543002/diff/1/ui/events/gesture_detection... ui/events/gesture_detection/gesture_provider_unittest.cc:1036: TEST_F(GestureProviderTest, SlopRegionCheckOnMissingSecondaryPointerDownEvent) { Add a link to the bug here.
https://codereview.chromium.org/2843543002/diff/1/ui/events/gesture_detection... File ui/events/gesture_detection/gesture_detector.cc (right): https://codereview.chromium.org/2843543002/diff/1/ui/events/gesture_detection... ui/events/gesture_detection/gesture_detector.cc:587: // not found. On 2017/05/11 16:57:27, tdresser wrote: > Add a link to the bug, and mention that this is sometimes missing, but we don't > have a reliable repro. Done. https://codereview.chromium.org/2843543002/diff/1/ui/events/gesture_detection... File ui/events/gesture_detection/gesture_detector.h (right): https://codereview.chromium.org/2843543002/diff/1/ui/events/gesture_detection... ui/events/gesture_detection/gesture_detector.h:106: const MotionEvent* current_down_event, On 2017/05/11 16:57:27, tdresser wrote: > We always have a current_down_event, don't we? yes, we do. https://codereview.chromium.org/2843543002/diff/1/ui/events/gesture_detection... File ui/events/gesture_detection/gesture_provider_unittest.cc (right): https://codereview.chromium.org/2843543002/diff/1/ui/events/gesture_detection... ui/events/gesture_detection/gesture_provider_unittest.cc:1036: TEST_F(GestureProviderTest, SlopRegionCheckOnMissingSecondaryPointerDownEvent) { On 2017/05/11 16:57:27, tdresser wrote: > Add a link to the bug here. Done.
The CQ bit was checked by sahel@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.
LGTM with nit. https://codereview.chromium.org/2843543002/diff/20001/ui/events/gesture_detec... File ui/events/gesture_detection/gesture_detector.h (right): https://codereview.chromium.org/2843543002/diff/20001/ui/events/gesture_detec... ui/events/gesture_detection/gesture_detector.h:106: const MotionEvent* current_down_event, Since this is never null, pass a reference.
https://codereview.chromium.org/2843543002/diff/20001/ui/events/gesture_detec... File ui/events/gesture_detection/gesture_detector.h (right): https://codereview.chromium.org/2843543002/diff/20001/ui/events/gesture_detec... ui/events/gesture_detection/gesture_detector.h:106: const MotionEvent* current_down_event, On 2017/05/12 18:21:13, tdresser wrote: > Since this is never null, pass a reference. I didn't want to have two MotionEvent parameters one with reference the other on with pointer. I know that references are the preferred style, but I chose consistency and similarity of the parameters over the style. However, if you still prefer one reference and one pointer, I can definitely change it.
On 2017/05/12 18:27:55, sahel wrote: > https://codereview.chromium.org/2843543002/diff/20001/ui/events/gesture_detec... > File ui/events/gesture_detection/gesture_detector.h (right): > > https://codereview.chromium.org/2843543002/diff/20001/ui/events/gesture_detec... > ui/events/gesture_detection/gesture_detector.h:106: const MotionEvent* > current_down_event, > On 2017/05/12 18:21:13, tdresser wrote: > > Since this is never null, pass a reference. > > I didn't want to have two MotionEvent parameters one with reference the other on > with pointer. I know that references are the preferred style, but I chose > consistency and similarity of the parameters over the style. However, if you > still prefer one reference and one pointer, I can definitely change it. I see where you're coming from. I think it's worth making it clear that one parameter is mandatory and the other optional, though it is asymmetric.
The CQ bit was checked by sahel@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: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by sahel@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from tdresser@chromium.org Link to the patchset: https://codereview.chromium.org/2843543002/#ps40001 (title: "use of reference for the mandatory parameter.")
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
Try jobs failed on following builders: win_chromium_compile_dbg_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_comp...)
The CQ bit was checked by sahel@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.
The CQ bit was checked by sahel@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 40001, "attempt_start_ts": 1494877101803470,
"parent_rev": "d10a21ab68a5a50bac471581696896b97f5fcf76", "commit_rev":
"6db0fde5caaa551bbf6e61b69d798a08cffcf11d"}
Message was sent while issue was closed.
Description was changed from ========== Missing source pointer down events are handled. The correct MotionEvent sequence for scrolling is ACTION_DOWN, optional number of ACTION_POINTER_DOWN, and ACTION_MOVE. When there are one or two pointers down while moving, and no scrolling has happened since beginning of the current event sequence, we check to see if any of the pointers has exeeded their slop region or not. If yes then scrolling starts and no tap event will happen for the rest of the current event sequence, otherwise no scroll will happen and if pointers get released before tap/long tap or two finger tap timers are expired then those events will happen. In some cases the ACTION_POINTER_DOWN event is missing from the event sequence and it results in crashes in GetSourcePointerDownEvent since the source pointer down event is not found. This patch skips slop region check for pointers which don't have soure pointer down event. BUG=704426 TEST=GestureProviderTest.SlopRegionCheckOnMissingSecondaryPointerDownEvent ========== to ========== Missing source pointer down events are handled. The correct MotionEvent sequence for scrolling is ACTION_DOWN, optional number of ACTION_POINTER_DOWN, and ACTION_MOVE. When there are one or two pointers down while moving, and no scrolling has happened since beginning of the current event sequence, we check to see if any of the pointers has exeeded their slop region or not. If yes then scrolling starts and no tap event will happen for the rest of the current event sequence, otherwise no scroll will happen and if pointers get released before tap/long tap or two finger tap timers are expired then those events will happen. In some cases the ACTION_POINTER_DOWN event is missing from the event sequence and it results in crashes in GetSourcePointerDownEvent since the source pointer down event is not found. This patch skips slop region check for pointers which don't have soure pointer down event. BUG=704426 TEST=GestureProviderTest.SlopRegionCheckOnMissingSecondaryPointerDownEvent Review-Url: https://codereview.chromium.org/2843543002 Cr-Commit-Position: refs/heads/master@{#471872} Committed: https://chromium.googlesource.com/chromium/src/+/6db0fde5caaa551bbf6e61b69d79... ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/6db0fde5caaa551bbf6e61b69d79... |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
