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

Issue 1530032: Ensure proper teardown of repost form warning objects. (Closed)

Created:
10 years, 8 months ago by Bernhard Bauer
Modified:
9 years, 7 months ago
Reviewers:
sky
CC:
John Grabowski, pam+watch_chromium.org, ben+cc_chromium.org
Visibility:
Public.

Description

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.* Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=44481

Patch Set 1 #

Patch Set 2 : Fix compile errors. #

Patch Set 3 : Fix a UI test on Windows. #

Total comments: 3

Patch Set 4 : Remove unnecessary code from RepostFormWarningGtk. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -30 lines) Patch
M chrome/browser/cocoa/repost_form_warning_mac.h View 1 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/cocoa/repost_form_warning_mac.mm View 1 3 chunks +7 lines, -9 lines 0 comments Download
M chrome/browser/gtk/repost_form_warning_gtk.h View 1 3 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/gtk/repost_form_warning_gtk.cc View 1 2 3 1 chunk +1 line, -8 lines 0 comments Download
M chrome/browser/repost_form_warning_controller.h View 2 chunks +2 lines, -4 lines 0 comments Download
M chrome/browser/repost_form_warning_controller.cc View 1 2 3 chunks +8 lines, -2 lines 0 comments Download
M chrome/browser/views/repost_form_warning_view.h View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
Bernhard Bauer
10 years, 8 months ago (2010-04-14 14:38:01 UTC) #1
sky
http://codereview.chromium.org/1530032/diff/5001/6003 File chrome/browser/gtk/repost_form_warning_gtk.cc (right): http://codereview.chromium.org/1530032/diff/5001/6003#newcode68 chrome/browser/gtk/repost_form_warning_gtk.cc:68: delete this; Do you need to set dialog_ to ...
10 years, 8 months ago (2010-04-14 15:09:38 UTC) #2
Bernhard Bauer
http://codereview.chromium.org/1530032/diff/5001/6003 File chrome/browser/gtk/repost_form_warning_gtk.cc (right): http://codereview.chromium.org/1530032/diff/5001/6003#newcode68 chrome/browser/gtk/repost_form_warning_gtk.cc:68: delete this; On 2010/04/14 15:09:39, sky wrote: > Do ...
10 years, 8 months ago (2010-04-14 15:20:58 UTC) #3
sky
http://codereview.chromium.org/1530032/diff/5001/6003 File chrome/browser/gtk/repost_form_warning_gtk.cc (right): http://codereview.chromium.org/1530032/diff/5001/6003#newcode68 chrome/browser/gtk/repost_form_warning_gtk.cc:68: delete this; On 2010/04/14 15:20:58, Bernhard Bauer wrote: > ...
10 years, 8 months ago (2010-04-14 15:34:54 UTC) #4
Bernhard Bauer
On 2010/04/14 15:34:54, sky wrote: > http://codereview.chromium.org/1530032/diff/5001/6003 > File chrome/browser/gtk/repost_form_warning_gtk.cc (right): > > http://codereview.chromium.org/1530032/diff/5001/6003#newcode68 > ...
10 years, 8 months ago (2010-04-14 16:05:54 UTC) #5
sky
10 years, 8 months ago (2010-04-14 16:11:13 UTC) #6
Ok, LGTM.

Powered by Google App Engine
This is Rietveld 408576698