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

Issue 2654093005: Fix MenuRunner Releasing (Closed)

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

Description

Fix MenuRunner Releasing It is possible for MenuRunner to be released while there is no currently active MenuController. However the MenuController which it created has not yet been destroyed. It is possible for there to be multiple non-destroyed MenuControllers. Due to this MenuController::GetActiveInstance is not an appropriate way to determine if the controller you are working with has been destroyed or not. This change updates MenuController to begin providing a WeakPtr of itself. This allows its internal code to detect when delegates have deleted it in response to callbacks. This also allows MenuRunner to track the lifetime of the controller is created. This change also updates MenuRunner to make sure that it destroys the controller it created when it is being released. TEST=MenuRunnerImplTest.MenuRunnerDestroyedWithNoActiveController BUG=683087 Review-Url: https://codereview.chromium.org/2654093005 Cr-Commit-Position: refs/heads/master@{#446498} Committed: https://chromium.googlesource.com/chromium/src/+/f64dfaabfd764eaca10cc87973f22422a8ee721a

Patch Set 1 #

Patch Set 2 : Update test access for non-exported private struct #

Total comments: 4

Patch Set 3 : Clarification and renaming #

Unified diffs Side-by-side diffs Delta from patch set Stats (+126 lines, -40 lines) Patch
M ui/views/controls/menu/menu_controller.h View 1 3 chunks +8 lines, -1 line 0 comments Download
M ui/views/controls/menu/menu_controller.cc View 1 2 9 chunks +36 lines, -22 lines 0 comments Download
M ui/views/controls/menu/menu_runner_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/controls/menu/menu_runner_impl.cc View 1 3 chunks +5 lines, -6 lines 0 comments Download
M ui/views/controls/menu/menu_runner_unittest.cc View 1 3 chunks +45 lines, -1 line 0 comments Download
M ui/views/test/menu_test_utils.h View 1 2 chunks +20 lines, -4 lines 0 comments Download
M ui/views/test/menu_test_utils.cc View 1 1 chunk +11 lines, -5 lines 0 comments Download

Messages

Total messages: 19 (11 generated)
jonross
Hey sky@, Could you review this change to MenuController/MenuRunner. It switches to using WeakPtr for ...
3 years, 11 months ago (2017-01-26 20:27:50 UTC) #9
jonross
Hey sky@, Could you review this change to MenuController/MenuRunner. It switches to using WeakPtr for ...
3 years, 11 months ago (2017-01-26 20:27:51 UTC) #10
jonross
Hey sky@, Could you review this change to MenuController/MenuRunner. It switches to using WeakPtr for ...
3 years, 11 months ago (2017-01-26 20:27:52 UTC) #11
sky
https://codereview.chromium.org/2654093005/diff/20001/ui/views/controls/menu/menu_controller.cc File ui/views/controls/menu/menu_controller.cc (right): https://codereview.chromium.org/2654093005/diff/20001/ui/views/controls/menu/menu_controller.cc#newcode1030 ui/views/controls/menu/menu_controller.cc:1030: base::WeakPtr<MenuController> active_controller = How come you grab a WeakPtr ...
3 years, 11 months ago (2017-01-26 22:08:27 UTC) #12
jonross
https://codereview.chromium.org/2654093005/diff/20001/ui/views/controls/menu/menu_controller.cc File ui/views/controls/menu/menu_controller.cc (right): https://codereview.chromium.org/2654093005/diff/20001/ui/views/controls/menu/menu_controller.cc#newcode1030 ui/views/controls/menu/menu_controller.cc:1030: base::WeakPtr<MenuController> active_controller = On 2017/01/26 22:08:27, sky wrote: > ...
3 years, 11 months ago (2017-01-26 22:26:58 UTC) #13
sky
LGTM
3 years, 11 months ago (2017-01-26 23:03:27 UTC) #14
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/2654093005/40001
3 years, 11 months ago (2017-01-26 23:15:54 UTC) #16
commit-bot: I haz the power
3 years, 11 months ago (2017-01-27 00:16:30 UTC) #19
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/f64dfaabfd764eaca10cc87973f2...

Powered by Google App Engine
This is Rietveld 408576698