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

Unified Diff: chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc

Issue 24436003: Don't leave renderer process frozen when canceling JavaScript dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clear callback after calling. Created 7 years, 3 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 | « no previous file | chrome/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc
diff --git a/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc b/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc
index c65a732ceba0cf96993196f6b6f54fb912404664..758d79e1b5cb678f8f8b0b50c6c08e30c9fcf727 100644
--- a/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc
+++ b/chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.cc
@@ -108,7 +108,10 @@ void JavaScriptAppModalDialog::Invalidate() {
return;
AppModalDialog::Invalidate();
- callback_.Reset();
+ if (!callback_.is_null()) {
+ callback_.Run(false, string16());
+ callback_.Reset();
+ }
if (native_dialog())
CloseModalDialog();
}
@@ -161,7 +164,10 @@ void JavaScriptAppModalDialog::NotifyDelegate(bool success,
if (!IsValid())
return;
- callback_.Run(success, user_input);
+ if (!callback_.is_null()) {
+ callback_.Run(success, user_input);
+ callback_.Reset();
+ }
// The callback_ above may delete web_contents_, thus removing the extra
// data from the map owned by ChromeJavaScriptDialogManager. Make sure
« no previous file with comments | « no previous file | chrome/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698