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

Unified Diff: chrome/browser/extensions/webstore_installer.cc

Issue 10453039: Debug crash in WebstoreInstaller::StartDownload() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/webstore_installer.cc
diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc
index d1193418342dcecba43261a8614072aaeda2a081..9f6535523a85eeb4f4a564d060eec384a3a9b086 100644
--- a/chrome/browser/extensions/webstore_installer.cc
+++ b/chrome/browser/extensions/webstore_installer.cc
@@ -195,9 +195,7 @@ void WebstoreInstaller::Start() {
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
base::Bind(&GetDownloadFilePath, download_path, id_,
- base::Bind(&WebstoreInstaller::StartDownload,
- base::Unretained(this))));
-
+ base::Bind(&WebstoreInstaller::StartDownload, this)));
}
void WebstoreInstaller::Observe(int type,
@@ -303,7 +301,7 @@ void WebstoreInstaller::OnDownloadOpened(DownloadItem* download) {
void WebstoreInstaller::StartDownload(const FilePath& file) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- if (file.empty()) {
+ if (file.empty() || !controller_ || !controller_->GetWebContents()) {
Aaron Boodman 2012/06/11 21:53:42 How can controller_ be NULL?
benjhayden 2012/06/12 17:51:53 Changed the c-tor to validate it. PTAL.
ReportFailure(kDownloadDirectoryError);
return;
}
@@ -319,9 +317,10 @@ void WebstoreInstaller::StartDownload(const FilePath& file) {
scoped_ptr<DownloadUrlParameters> params(
DownloadUrlParameters::FromWebContents(
controller_->GetWebContents(), download_url_, save_info));
- params->set_referrer(
- content::Referrer(controller_->GetActiveEntry()->GetURL(),
- WebKit::WebReferrerPolicyDefault));
+ if (controller_->GetActiveEntry())
+ params->set_referrer(
+ content::Referrer(controller_->GetActiveEntry()->GetURL(),
+ WebKit::WebReferrerPolicyDefault));
params->set_callback(base::Bind(&WebstoreInstaller::OnDownloadStarted, this));
profile_->GetDownloadManager()->DownloadUrl(params.Pass());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698