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

Unified Diff: chrome/browser/repost_form_warning_controller.cc

Issue 1657005: Merge 44481 - Ensure proper teardown of repost form warning objects.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/375/src/
Patch Set: Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/repost_form_warning_controller.h ('k') | chrome/browser/views/repost_form_warning_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/repost_form_warning_controller.cc
===================================================================
--- chrome/browser/repost_form_warning_controller.cc (revision 44638)
+++ chrome/browser/repost_form_warning_controller.cc (working copy)
@@ -21,6 +21,11 @@
}
RepostFormWarningController::~RepostFormWarningController() {
+ // If we end up here, the constrained window has been closed, so make sure we
+ // don't close it again.
+ window_ = NULL;
+ // Make sure everything is cleaned up.
+ Cancel();
}
void RepostFormWarningController::Show(
@@ -48,7 +53,8 @@
// Close the dialog if we load a page (because reloading might not apply to
// the same page anymore) or if the tab is closed, because then we won't have
// a navigation controller anymore.
- if ((type == NotificationType::LOAD_START ||
+ if (tab_contents_ &&
+ (type == NotificationType::LOAD_START ||
type == NotificationType::TAB_CLOSING ||
type == NotificationType::REPOST_WARNING_SHOWN)) {
DCHECK_EQ(Source<NavigationController>(source).ptr(),
@@ -58,9 +64,9 @@
}
void RepostFormWarningController::CloseDialog() {
+ // Make sure we won't do anything when |Cancel()| is called again.
tab_contents_ = NULL;
if (window_) {
window_->CloseConstrainedWindow();
}
- delete this;
}
« no previous file with comments | « chrome/browser/repost_form_warning_controller.h ('k') | chrome/browser/views/repost_form_warning_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698