| Index: chrome/browser/plugins/plugin_installer.cc
|
| diff --git a/chrome/browser/plugins/plugin_installer.cc b/chrome/browser/plugins/plugin_installer.cc
|
| index 2b2ea7e87546380ba9ee5c5d4cecc13e5829b940..6f4e32f5e62b5d39a36269b2fdf4da18552c98a2 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));
|
| }
|
| }
|
|
|
| @@ -153,23 +153,18 @@ void PluginInstaller::StartInstalling(const GURL& plugin_url,
|
|
|
| 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(const GURL& plugin_url,
|
|
|