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

Issue 1864423002: ToolbarButton: Reset menu runner before deleting its menu's delegate (Closed)

Created:
4 years, 8 months ago by tapted
Modified:
4 years, 8 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina, 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

ToolbarButton: Reset menu runner before deleting its menu's delegate ToolbarButton::OnMenuClosed() deletes the MenuModelAdapter which is a delegate of a menu owned |menu_runner_|, but doesn't reset |menu_runner_|. Although the menu is closed, but the OS can still send events such as a11y queries, which would be forwarded to a deleted delegate. Note that the menu was made asynchronous recently in r381033, but crashes were collected prior to that since the MenuItemView* was still retained when the menu was synchronous as well. BUG=597531 Committed: https://crrev.com/83bac8d9d4508a9cdebe862558db6bdc59173d67 Cr-Commit-Position: refs/heads/master@{#388667}

Patch Set 1 #

Patch Set 2 : See if there is test coverage [edit: nope there isn't] #

Patch Set 3 : add test coverage #

Patch Set 4 : Tests working, but I do not like what the test suite makes me do #

Total comments: 3

Patch Set 5 : rebase to pick up r385928 #

Patch Set 6 : MenuRunnerImplInterface #

Patch Set 7 : rebase (fun unique_ptr conflicts) #

Patch Set 8 : Like patchset4, but interactive #

Patch Set 9 : UITestingProfileInitializer :/ #

Patch Set 10 : ViewEventTestBase #

Patch Set 11 : ViewEventTestBase fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+99 lines, -0 lines) Patch
M chrome/browser/ui/views/toolbar/toolbar_button.h View 1 2 3 4 5 6 7 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/toolbar/toolbar_button.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
A chrome/browser/ui/views/toolbar/toolbar_button_interactive_uitest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +85 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/base/view_event_test_base.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (11 generated)
tapted
Hi sky, please take a look. Turns out there was no test coverage, so I ...
4 years, 8 months ago (2016-04-07 11:32:58 UTC) #6
sky
https://codereview.chromium.org/1864423002/diff/90001/chrome/browser/ui/views/toolbar/toolbar_button_unittest.cc File chrome/browser/ui/views/toolbar/toolbar_button_unittest.cc (right): https://codereview.chromium.org/1864423002/diff/90001/chrome/browser/ui/views/toolbar/toolbar_button_unittest.cc#newcode82 chrome/browser/ui/views/toolbar/toolbar_button_unittest.cc:82: button_->ShowContextMenuForView(nullptr, gfx::Point(), ui::MENU_SOURCE_MOUSE); AFAICT this will attempt setcapture and ...
4 years, 8 months ago (2016-04-07 19:27:02 UTC) #7
tapted
https://codereview.chromium.org/1864423002/diff/90001/chrome/browser/ui/views/toolbar/toolbar_button_unittest.cc File chrome/browser/ui/views/toolbar/toolbar_button_unittest.cc (right): https://codereview.chromium.org/1864423002/diff/90001/chrome/browser/ui/views/toolbar/toolbar_button_unittest.cc#newcode82 chrome/browser/ui/views/toolbar/toolbar_button_unittest.cc:82: button_->ShowContextMenuForView(nullptr, gfx::Point(), ui::MENU_SOURCE_MOUSE); On 2016/04/07 19:27:01, sky wrote: > ...
4 years, 8 months ago (2016-04-08 05:32:22 UTC) #9
sky
I like moving to interactive_ui_tests. On Thu, Apr 7, 2016 at 10:32 PM, <tapted@chromium.org> wrote: ...
4 years, 8 months ago (2016-04-08 16:15:52 UTC) #10
tapted
Hi sky, PTAL And sorry for the delay - lots of platform context-switches. Also "one ...
4 years, 8 months ago (2016-04-20 01:43:30 UTC) #13
sky
LGTM
4 years, 8 months ago (2016-04-20 14:37:51 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1864423002/290001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1864423002/290001
4 years, 8 months ago (2016-04-21 01:49:07 UTC) #16
commit-bot: I haz the power
Committed patchset #11 (id:290001)
4 years, 8 months ago (2016-04-21 03:02:47 UTC) #18
commit-bot: I haz the power
4 years, 8 months ago (2016-04-22 19:30:36 UTC) #20
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/83bac8d9d4508a9cdebe862558db6bdc59173d67
Cr-Commit-Position: refs/heads/master@{#388667}

Powered by Google App Engine
This is Rietveld 408576698