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

Unified Diff: chrome/browser/plugins/plugin_infobar_delegates.cc

Issue 11029045: Fix crash when a download is requested for an outdated plugin. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: bauerb@ Created 8 years, 2 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/plugins/plugin_installer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugins/plugin_infobar_delegates.cc
diff --git a/chrome/browser/plugins/plugin_infobar_delegates.cc b/chrome/browser/plugins/plugin_infobar_delegates.cc
index 78607fcc76c10c4fb47e6d06fb485c031c309341..1a8f7c5b33bbd5265f10ac4721dbc6cefa481377 100644
--- a/chrome/browser/plugins/plugin_infobar_delegates.cc
+++ b/chrome/browser/plugins/plugin_infobar_delegates.cc
@@ -233,15 +233,16 @@ bool OutdatedPluginInfoBarDelegate::Accept() {
}
content::WebContents* web_contents = owner()->GetWebContents();
+ // A call to any of |OpenDownloadURL()| or |StartInstalling()| will
+ // result in killing ourselves. Accordingly, we make sure to
Bernhard Bauer 2012/10/05 14:22:45 Nit: let's say "deleting" instead of "killing".
+ // not pass a reference to an object that can go away.
+ // http://crbug.com/54167
+ GURL plugin_url(plugin_metadata_->plugin_url());
if (plugin_metadata_->url_for_display()) {
- installer()->OpenDownloadURL(plugin_metadata_->url_for_display(),
- plugin_metadata_->plugin_url(),
- web_contents);
+ installer()->OpenDownloadURL(plugin_url, web_contents);
} else {
- installer()->StartInstalling(
- plugin_metadata_->url_for_display(),
- plugin_metadata_->plugin_url(),
- TabContents::FromWebContents(web_contents));
+ installer()->StartInstalling(plugin_url,
+ TabContents::FromWebContents(web_contents));
}
return false;
}
« no previous file with comments | « no previous file | chrome/browser/plugins/plugin_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698