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

Issue 881163002: Fix a crash which occurs due to a CHECK firing in the HWNDMessageHandler::OnKeyEvent code path on W… (Closed)

Created:
5 years, 11 months ago by ananta
Modified:
5 years, 10 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina, tdanderson+views_chromium.org, jdduke+watch_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.

Description

Fix a crash which occurs due to a CHECK firing in the HWNDMessageHandler::OnKeyEvent code path on Windows. This crash occurs when the LegacyRenderWidgetHostHWND instance sends WM_CHAR/WM_SYSCHAR messages via the WindowEventTarget::HandleKeyboardMessage function. The HWNDMessageHandler class handles these messages via the OnImeMessages handler in the normal case. The CHECK fires in the KeyEvent ctor where we validate that the KeyEvent instance has a valid event type. In this case the WM_CHAR/WM_SYSCHAR messages are processed via the OnKeyEvent handler which leads to the problem. Fix is to add a check for WM_CHAR/WM_SYSCHAR messages in the HWNDMessageHandler::HandleKeyboardMessage function and call the OnImeMessages handler there. The alternative would be to add a new method to the WindowEventTarget interface and change the LegacyRenderWidgetHostHWND class to handle these messages separately and call the new method. I think that change would be a touch big for this case. I also added WM_SYSDEADCHAR to the list of messages processed by the EventTypeFromNative function. We set the type as ET_KEY_RELEASED on the same lines as WM_DEADCHAR. BUG=451797 TEST=Covered by views_unittest WidgetTest.CharMessagesAsKeyboardMessagesDoesNotCrash Committed: https://crrev.com/005229b167c1a9e415fc814520bf1d650adebb22 Cr-Commit-Position: refs/heads/master@{#313591}

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -1 line) Patch
M ui/events/win/events_win.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/widget/widget_unittest.cc View 2 chunks +31 lines, -0 lines 0 comments Download
M ui/views/win/hwnd_message_handler.cc View 1 chunk +5 lines, -1 line 2 comments Download

Messages

Total messages: 9 (2 generated)
ananta
5 years, 11 months ago (2015-01-28 02:14:07 UTC) #2
sky
https://codereview.chromium.org/881163002/diff/1/ui/views/win/hwnd_message_handler.cc File ui/views/win/hwnd_message_handler.cc (right): https://codereview.chromium.org/881163002/diff/1/ui/views/win/hwnd_message_handler.cc#newcode1013 ui/views/win/hwnd_message_handler.cc:1013: if ((message == WM_CHAR) || (message == WM_SYSCHAR)) Isn't ...
5 years, 10 months ago (2015-01-28 20:08:23 UTC) #3
ananta
https://codereview.chromium.org/881163002/diff/1/ui/views/win/hwnd_message_handler.cc File ui/views/win/hwnd_message_handler.cc (right): https://codereview.chromium.org/881163002/diff/1/ui/views/win/hwnd_message_handler.cc#newcode1013 ui/views/win/hwnd_message_handler.cc:1013: if ((message == WM_CHAR) || (message == WM_SYSCHAR)) On ...
5 years, 10 months ago (2015-01-28 20:27:42 UTC) #4
sky
Ok, LGTM
5 years, 10 months ago (2015-01-28 21:29:00 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/881163002/1
5 years, 10 months ago (2015-01-28 21:34:04 UTC) #7
commit-bot: I haz the power
Committed patchset #1 (id:1)
5 years, 10 months ago (2015-01-28 21:38:33 UTC) #8
commit-bot: I haz the power
5 years, 10 months ago (2015-01-28 21:40:49 UTC) #9
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/005229b167c1a9e415fc814520bf1d650adebb22
Cr-Commit-Position: refs/heads/master@{#313591}

Powered by Google App Engine
This is Rietveld 408576698