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

Issue 2659903002: Change MenuControllerDelegate to provide WeakPtr (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

Change MenuControllerDelegate to provide WeakPtr So it is possible that a MenuControllerDelegate can be destroyed in a fashion which does not notify the associated MenuController. This can leak to the controller attempting to access the delegate after death. Specifically a MenuControllerDelegate, which does not own the controller is closed. Then at some point later on released as its Widgets are cleaned up. The MenuController is then further interacted with, beginning to show another menu. Then at some point the MenuController is finally shutdown. Notifying all associated delegates. This change updates MenuControllerDelegate to provide a WeakPtr. MenuController will verify existance before notifying delegates of shutdown. TEST=MenuRunnerImplTest.NestedDelegateDestroyedWhileMenuRunning BUG=683087

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -20 lines) Patch
M ui/views/controls/menu/menu_controller.h View 2 chunks +3 lines, -2 lines 0 comments Download
M ui/views/controls/menu/menu_controller.cc View 6 chunks +17 lines, -10 lines 0 comments Download
M ui/views/controls/menu/menu_controller_delegate.h View 2 chunks +4 lines, -1 line 0 comments Download
M ui/views/controls/menu/menu_controller_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/controls/menu/menu_runner_impl.h View 1 chunk +0 lines, -3 lines 0 comments Download
M ui/views/controls/menu/menu_runner_impl.cc View 2 chunks +2 lines, -3 lines 0 comments Download
M ui/views/controls/menu/menu_runner_unittest.cc View 1 chunk +35 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (5 generated)
jonross
3 years, 10 months ago (2017-01-27 16:25:05 UTC) #4
Hey sky@,

This is a follow up to yesterday's review. There is apparently a way for
MenuRunnerImpl to die without any notification to the MenuController.

Could you review this change?

Thanks,
Jon

Powered by Google App Engine
This is Rietveld 408576698