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

Issue 2680863002: Prevent nested Menu Cancelling (Closed)

Created:
3 years, 10 months ago by jonross
Modified:
3 years, 10 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Prevent nested Menu Cancelling When being cancelled MenuController will release ViewsDelegate. This is normally used to prevent shutdown while menus are alive. The release can lead to views teardowns attempting to cancel the MenuController and to delete the MenuRunner. This nested cancelling and deletion of the MenuRunner leads to a use-after-free once the original cancelling resumes. This change updates MenuController::Cancel to mark the menu as not showing earlier in the process. So that nested calls to Cancel are rejected. TEST=MenuRunnerDestructionTest.MenuRunnerDestroyedDuringReleaseRef BUG=683087 Review-Url: https://codereview.chromium.org/2680863002 Cr-Commit-Position: refs/heads/master@{#448792} Committed: https://chromium.googlesource.com/chromium/src/+/212e6fd564db2eef90c3855ab96cb75f35cba32d

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+107 lines, -7 lines) Patch
M ui/views/controls/menu/menu_controller.cc View 2 chunks +11 lines, -7 lines 2 comments Download
M ui/views/controls/menu/menu_runner_impl.h View 2 chunks +8 lines, -0 lines 0 comments Download
M ui/views/controls/menu/menu_runner_unittest.cc View 2 chunks +88 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (8 generated)
jonross
Hey, Previously I added some checks to MenuController to try to find potential causes of ...
3 years, 10 months ago (2017-02-07 17:04:56 UTC) #4
sky
https://codereview.chromium.org/2680863002/diff/1/ui/views/controls/menu/menu_controller.cc File ui/views/controls/menu/menu_controller.cc (right): https://codereview.chromium.org/2680863002/diff/1/ui/views/controls/menu/menu_controller.cc#newcode2639 ui/views/controls/menu/menu_controller.cc:2639: ViewsDelegate::GetInstance()->ReleaseRef(); Is your worry that this line is causing ...
3 years, 10 months ago (2017-02-07 19:23:51 UTC) #7
jonross
https://codereview.chromium.org/2680863002/diff/1/ui/views/controls/menu/menu_controller.cc File ui/views/controls/menu/menu_controller.cc (right): https://codereview.chromium.org/2680863002/diff/1/ui/views/controls/menu/menu_controller.cc#newcode2639 ui/views/controls/menu/menu_controller.cc:2639: ViewsDelegate::GetInstance()->ReleaseRef(); On 2017/02/07 19:23:51, sky wrote: > Is your ...
3 years, 10 months ago (2017-02-07 20:07:21 UTC) #8
sky
Ok, LGTM
3 years, 10 months ago (2017-02-07 20:51:29 UTC) #9
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/2680863002/1
3 years, 10 months ago (2017-02-07 21:04:02 UTC) #11
commit-bot: I haz the power
3 years, 10 months ago (2017-02-07 23:42:12 UTC) #14
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/212e6fd564db2eef90c3855ab96c...

Powered by Google App Engine
This is Rietveld 408576698