Commit 187b7d3b authored by lanwei's avatar lanwei Committed by Commit bot

Revert of Fix a crash when views::HWNDMessageHandler::HandleTouchMessage...

Revert of Fix a crash when views::HWNDMessageHandler::HandleTouchMessage (patchset #3 id:80001 of https://codereview.chromium.org/1147583002/)

Reason for revert:
We reverted the CL which needs to be fixed by this one, so we need to revert it one as well. We will recommit it once we fully fix and test it.

Original issue's description:
> Fix a crash when views::HWNDMessageHandler::HandleTouchMessage.
>
> There is a crash when calling views::HWNDMessageHandler::HandleTouchMessage,
> because there are missing touch presses. Remove the CHECK for missing touch press,
> and ignore when this happens.
>
> BUG=316085, 488473
>
> Committed: https://crrev.com/41065dad044cd3bbd3c9bcc24e59eeae27a6c6a9
> Cr-Commit-Position: refs/heads/master@{#330751}

TBR=sadrul@chromium.org,ananta@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=316085, 488473

Review URL: https://codereview.chromium.org/1148143002

Cr-Commit-Position: refs/heads/master@{#330757}
parent b4a9e86d
...@@ -2354,11 +2354,6 @@ void HWNDMessageHandler::PrepareTouchEventList(TOUCHINPUT input[], ...@@ -2354,11 +2354,6 @@ void HWNDMessageHandler::PrepareTouchEventList(TOUCHINPUT input[],
ScreenToClient(hwnd(), &point); ScreenToClient(hwnd(), &point);
// We set a check to assert that we do not receive any touch events from
// user's palm.
bool touch_event_from_palm = (input[i].dwFlags & TOUCHEVENTF_PALM) != 0;
CHECK(!touch_event_from_palm) << "There are touch events from user's palm";
// TOUCHEVENTF_DOWN cannot be combined with TOUCHEVENTF_MOVE or // TOUCHEVENTF_DOWN cannot be combined with TOUCHEVENTF_MOVE or
// TOUCHEVENTF_UP, but TOUCHEVENTF_MOVE and TOUCHEVENTF_UP can be combined // TOUCHEVENTF_UP, but TOUCHEVENTF_MOVE and TOUCHEVENTF_UP can be combined
// in one input. // in one input.
...@@ -2394,13 +2389,6 @@ void HWNDMessageHandler::GenerateTouchEvent(DWORD input_dwID, ...@@ -2394,13 +2389,6 @@ void HWNDMessageHandler::GenerateTouchEvent(DWORD input_dwID,
} }
TouchPoint& touch_point = touch_id_list_[touch_id]; TouchPoint& touch_point = touch_id_list_[touch_id];
// We set a check to assert that we do not have missing touch presses in
// every message.
bool has_missing_touch_press = touch_event_type != ui::ET_TOUCH_PRESSED &&
touch_point.in_touch_list == InTouchList::NotPresent;
CHECK(!has_missing_touch_press) << "There are missing touch presses";
int flags = ui::GetModifiersFromKeyState(); int flags = ui::GetModifiersFromKeyState();
// The dwTime of every input in the WM_TOUCH message doesn't necessarily // The dwTime of every input in the WM_TOUCH message doesn't necessarily
...@@ -2408,6 +2396,12 @@ void HWNDMessageHandler::GenerateTouchEvent(DWORD input_dwID, ...@@ -2408,6 +2396,12 @@ void HWNDMessageHandler::GenerateTouchEvent(DWORD input_dwID,
// touchevent time. // touchevent time.
base::TimeDelta now = ui::EventTimeForNow(); base::TimeDelta now = ui::EventTimeForNow();
// We set a check to assert that we do not have missing touch presses in
// every message.
bool has_missing_touch_press = touch_event_type != ui::ET_TOUCH_PRESSED &&
touch_point.in_touch_list == InTouchList::NotPresent;
CHECK(!has_missing_touch_press) << "There are missing touch presses";
ui::TouchEvent event(touch_event_type, point_location, touch_id, now); ui::TouchEvent event(touch_event_type, point_location, touch_id, now);
event.set_flags(flags); event.set_flags(flags);
event.latency()->AddLatencyNumberWithTimestamp( event.latency()->AddLatencyNumberWithTimestamp(
......
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