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

Issue 2273263002: MacViewsBrowser: Fix omnibox crash due to failed DCHECK. (Closed)

Created:
4 years, 4 months ago by karandeepb
Modified:
4 years, 3 months ago
Reviewers:
msw, calamity
CC:
chromium-reviews, tfarina, James Su, shuchen+watch_chromium.org, yusukes+watch_chromium.org, nona+watch_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MacViewsBrowser: Fix omnibox crash due to failed DCHECK. Textfield::SetTextEditCommandForNextKeyEvent can be used to schedule a text editing command to be executed on the next key press. However, Textfield subclasses like OmniboxViewViews are currently oblivious to the scheduled text edit command accounting. When a key press event is handled in OmnboxViewViews::OnKeyPressed itself, the scheduled_text_edit_command_ property in Textfield is not cleared, leading to a failed DCHECK when Textfield::SetTextEditCommandForNextKeyEvent is invoked next. This CL resolves the crash by prohibiting Textfield subclasses from overriding OnKeyPressed/Released. This allows Textfield to handle the accounting related to the scheduled text edit command. This necessiates moving all the OmniboxViewViews::OnKeyPressed and OmniboxViewViews::OnKeyReleased logic to OmniboxViewViews::HandleKeyEvent. A test is also added which fails on the current master. BUG=613948 TEST=Build with mac_views_browser=1. In the browser, go to the omnibox and type a partial url such that there are atleast 2 autocomplete suggestions. Press arrow down key twice. Ensure the browser does not crash. Committed: https://crrev.com/f588a5a9734fec75adfd7815190d930f0ba13df4 Cr-Commit-Position: refs/heads/master@{#415156}

Patch Set 1 #

Total comments: 2

Patch Set 2 #

Patch Set 3 : tests #

Patch Set 4 #

Total comments: 4

Patch Set 5 : Address review. #

Patch Set 6 : Fix compile. #

Total comments: 2

Patch Set 7 : Address review. #

Total comments: 2

Patch Set 8 : Address review, make Textfield::OnKeyPressed/Released final. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+147 lines, -126 lines) Patch
M chrome/browser/ui/views/omnibox/omnibox_view_views.h View 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_view_views.cc View 1 2 3 3 chunks +91 lines, -97 lines 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc View 1 2 3 4 5 6 5 chunks +25 lines, -1 line 0 comments Download
M ui/app_list/views/search_box_view_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M ui/views/controls/textfield/textfield.h View 1 2 3 4 5 6 7 2 chunks +7 lines, -2 lines 0 comments Download
M ui/views/controls/textfield/textfield_test_api.h View 1 2 6 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/controls/textfield/textfield_unittest.cc View 1 2 3 4 5 6 7 2 chunks +19 lines, -23 lines 0 comments Download

Messages

Total messages: 63 (45 generated)
karandeepb
PTAL msw@. This changes the codepaths for key events as far as omnibox is concerned. ...
4 years, 3 months ago (2016-08-25 10:03:53 UTC) #16
msw
lgtm https://codereview.chromium.org/2273263002/diff/160001/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc File chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc (right): https://codereview.chromium.org/2273263002/diff/160001/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc#newcode155 chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc:155: // Textfield::OnKeyPressed is invoked. Test for http://crbug.com/613948. nit: ...
4 years, 3 months ago (2016-08-25 17:02:51 UTC) #19
karandeepb
https://codereview.chromium.org/2273263002/diff/160001/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc File chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc (right): https://codereview.chromium.org/2273263002/diff/160001/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc#newcode155 chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc:155: // Textfield::OnKeyPressed is invoked. Test for http://crbug.com/613948. On 2016/08/25 ...
4 years, 3 months ago (2016-08-26 01:41:57 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2273263002/180001
4 years, 3 months ago (2016-08-26 01:42:42 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/268109)
4 years, 3 months ago (2016-08-26 01:56:45 UTC) #27
karandeepb
PTAL Chris for ui/app_list. Thanks.
4 years, 3 months ago (2016-08-26 05:15:55 UTC) #38
calamity
app_list lgtm
4 years, 3 months ago (2016-08-26 05:57:51 UTC) #39
karandeepb
PTAL msw@. Let me know if you have any more comments, else I'll land.
4 years, 3 months ago (2016-08-26 06:23:03 UTC) #40
msw
https://codereview.chromium.org/2273263002/diff/220001/ui/views/controls/textfield/textfield_test_api.h File ui/views/controls/textfield/textfield_test_api.h (right): https://codereview.chromium.org/2273263002/diff/220001/ui/views/controls/textfield/textfield_test_api.h#newcode40 ui/views/controls/textfield/textfield_test_api.h:40: bool OnKeyPressed(const ui::KeyEvent& event) { Can tests instead call ...
4 years, 3 months ago (2016-08-26 07:09:43 UTC) #41
karandeepb
PTAL msw@. https://codereview.chromium.org/2273263002/diff/220001/ui/views/controls/textfield/textfield_test_api.h File ui/views/controls/textfield/textfield_test_api.h (right): https://codereview.chromium.org/2273263002/diff/220001/ui/views/controls/textfield/textfield_test_api.h#newcode40 ui/views/controls/textfield/textfield_test_api.h:40: bool OnKeyPressed(const ui::KeyEvent& event) { On 2016/08/26 ...
4 years, 3 months ago (2016-08-26 10:05:16 UTC) #46
msw
lgtm
4 years, 3 months ago (2016-08-26 15:14:37 UTC) #47
msw
https://codereview.chromium.org/2273263002/diff/240001/ui/views/controls/textfield/textfield_unittest.cc File ui/views/controls/textfield/textfield_unittest.cc (right): https://codereview.chromium.org/2273263002/diff/240001/ui/views/controls/textfield/textfield_unittest.cc#newcode332 ui/views/controls/textfield/textfield_unittest.cc:332: bool OnKeyPressed(const ui::KeyEvent& e) override { Oh, can these ...
4 years, 3 months ago (2016-08-26 15:19:10 UTC) #48
msw
4 years, 3 months ago (2016-08-26 15:19:15 UTC) #49
karandeepb
PTAL msw@ in case you have any more comments. https://codereview.chromium.org/2273263002/diff/240001/ui/views/controls/textfield/textfield_unittest.cc File ui/views/controls/textfield/textfield_unittest.cc (right): https://codereview.chromium.org/2273263002/diff/240001/ui/views/controls/textfield/textfield_unittest.cc#newcode332 ui/views/controls/textfield/textfield_unittest.cc:332: ...
4 years, 3 months ago (2016-08-29 09:59:34 UTC) #55
msw
lgtm
4 years, 3 months ago (2016-08-29 16:59:12 UTC) #56
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2273263002/280001
4 years, 3 months ago (2016-08-30 00:53:13 UTC) #59
commit-bot: I haz the power
Committed patchset #8 (id:280001)
4 years, 3 months ago (2016-08-30 05:28:38 UTC) #61
commit-bot: I haz the power
4 years, 3 months ago (2016-08-30 05:31:24 UTC) #63
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/f588a5a9734fec75adfd7815190d930f0ba13df4
Cr-Commit-Position: refs/heads/master@{#415156}

Powered by Google App Engine
This is Rietveld 408576698