DescriptionMerge 44481 - Ensure proper teardown of repost form warning objects.
Make sure a repost form warning is closed properly even when the constrained window is closed from underneath us.
To do this, its controller now calls |Cancel| in its destructor.
We now have a potential cycle of methods calling each other:
* |RepostFormWarningController::CloseDialog| closes the |ConstrainedWindow|.
* This eventually calls |RepostFormWarningWin::DeleteDelegate|, which destroys |RepostFormWarningWin| and |RepostFormWarningController|.
* In its destructor, |RepostFormWarningController| calls |Cancel|, which calls |CloseDialog|.
Therefore, there are some checks in place to make sure we do everything during the teardown exactly once:
* After calling |NavigationController::CancelPendingReload|, we set |tab_contents| to null to make sure we don't call it again.
* During destruction, we set |window_| to null to make sure we don't call |CloseConstrainedWindow| again.
BUG=41367
TEST=RepostFormWarningTest.*
Review URL: http://codereview.chromium.org/1530032
TBR=bauerb@chromium.org
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=44639
Patch Set 1 #
Messages
Total messages: 1 (0 generated)
|