Index: chrome/browser/plugins/plugin_installer.cc |
diff --git a/chrome/browser/plugins/plugin_installer.cc b/chrome/browser/plugins/plugin_installer.cc |
index 678addd6dba53ff6e761191cc90006961d6002e9..3ffbd51c0778749840a04fd6a07814d8b057692c 100644 |
--- a/chrome/browser/plugins/plugin_installer.cc |
+++ b/chrome/browser/plugins/plugin_installer.cc |
@@ -60,7 +60,7 @@ void BeginDownload( |
if (error != net::OK) { |
BrowserThread::PostTask( |
BrowserThread::UI, FROM_HERE, |
- base::Bind(callback, content::DownloadId::Invalid(), error)); |
+ base::Bind(callback, static_cast<DownloadItem*>(NULL), error)); |
} |
} |
@@ -155,23 +155,18 @@ void PluginInstaller::StartInstalling(bool url_for_display, |
void PluginInstaller::DownloadStarted( |
scoped_refptr<content::DownloadManager> dlm, |
- content::DownloadId download_id, |
+ content::DownloadItem* item, |
net::Error error) { |
- if (error != net::OK) { |
+ if (!item) { |
+ DCHECK_NE(net::OK, error); |
std::string msg = |
base::StringPrintf("Error %d: %s", error, net::ErrorToString(error)); |
DownloadError(msg); |
return; |
} |
- DownloadItem* download_item = dlm->GetDownload(download_id.local()); |
- // TODO(benjhayden): DCHECK(item && item->IsInProgress()) after figuring out |
- // why DownloadStarted may get net:OK but an invalid id. |
- if (!download_item) { |
- DownloadError("Download not found"); |
- return; |
- } |
- download_item->SetOpenWhenComplete(true); |
- download_item->AddObserver(this); |
+ DCHECK_EQ(net::OK, error); |
+ item->SetOpenWhenComplete(true); |
+ item->AddObserver(this); |
} |
void PluginInstaller::OpenDownloadURL(bool url_for_display, |