Chromium Code Reviews| Index: chrome/browser/extensions/api/downloads/downloads_api.cc |
| diff --git a/chrome/browser/extensions/api/downloads/downloads_api.cc b/chrome/browser/extensions/api/downloads/downloads_api.cc |
| index 2e21ccabf9e5981bebaef8a1920ecb220660c3ac..eb18822cf04f497497626e513326a484444c5062 100644 |
| --- a/chrome/browser/extensions/api/downloads/downloads_api.cc |
| +++ b/chrome/browser/extensions/api/downloads/downloads_api.cc |
| @@ -645,12 +645,15 @@ bool DownloadsDownloadFunction::RunImpl() { |
| return true; |
| } |
| -void DownloadsDownloadFunction::OnStarted(DownloadId dl_id, net::Error error) { |
| +void DownloadsDownloadFunction::OnStarted( |
| + DownloadItem* item, net::Error error) { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| - VLOG(1) << __FUNCTION__ << " " << dl_id << " " << error; |
| - if (dl_id.local() >= 0) { |
| - SetResult(base::Value::CreateIntegerValue(dl_id.local())); |
| + VLOG(1) << __FUNCTION__ << " " << item << " " << error; |
|
Finnur
2012/10/09 15:57:51
don't you still want the id here and not the point
benjhayden
2012/10/09 20:57:18
I'm not interested in the particular value of the
|
| + if (item) { |
| + DCHECK_EQ(net::OK, error); |
| + SetResult(base::Value::CreateIntegerValue(item->GetId())); |
| } else { |
| + DCHECK_NE(net::OK, error); |
| error_ = net::ErrorToString(error); |
| } |
| SendResponse(error_.empty()); |