Chromium Code Reviews
DescriptionFix 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 #
Messages
Total messages: 19 (11 generated)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||