| Index: content/browser/download/download_resource_handler.cc
|
| ===================================================================
|
| --- content/browser/download/download_resource_handler.cc (revision 98659)
|
| +++ content/browser/download/download_resource_handler.cc (working copy)
|
| @@ -30,12 +30,11 @@
|
| int render_view_id,
|
| int request_id,
|
| const GURL& url,
|
| - DownloadId dl_id,
|
| DownloadFileManager* download_file_manager,
|
| net::URLRequest* request,
|
| bool save_as,
|
| const DownloadSaveInfo& save_info)
|
| - : download_id_(dl_id),
|
| + : download_id_(-1),
|
| global_id_(render_process_host_id, request_id),
|
| render_view_id_(render_view_id),
|
| content_length_(0),
|
| @@ -46,7 +45,6 @@
|
| buffer_(new DownloadBuffer),
|
| rdh_(rdh),
|
| is_paused_(false) {
|
| - DCHECK(dl_id.IsValid());
|
| download_stats::RecordDownloadCount(download_stats::UNTHROTTLED_COUNT);
|
| }
|
|
|
| @@ -67,7 +65,6 @@
|
| // Send the download creation information to the download thread.
|
| bool DownloadResourceHandler::OnResponseStarted(int request_id,
|
| ResourceResponse* response) {
|
| - DCHECK(download_id_.IsValid());
|
| VLOG(20) << __FUNCTION__ << "()" << DebugString()
|
| << " request_id = " << request_id;
|
| download_start_time_ = base::TimeTicks::Now();
|
| @@ -80,6 +77,8 @@
|
| const ResourceDispatcherHostRequestInfo* request_info =
|
| ResourceDispatcherHost::InfoForRequest(request_);
|
|
|
| + download_id_ = download_file_manager_->GetNextId();
|
| +
|
| // Deleted in DownloadManager.
|
| DownloadCreateInfo* info = new DownloadCreateInfo;
|
| info->url_chain = request_->url_chain();
|
| @@ -88,7 +87,7 @@
|
| info->received_bytes = 0;
|
| info->total_bytes = content_length_;
|
| info->state = DownloadItem::IN_PROGRESS;
|
| - info->download_id = download_id_.local();
|
| + info->download_id = download_id_;
|
| info->has_user_gesture = request_info->has_user_gesture();
|
| info->request_handle = DownloadRequestHandle(rdh_,
|
| global_id_.child_id,
|
| @@ -258,7 +257,7 @@
|
| " save_info_.file_path = \"%" PRFilePath "\""
|
| " }",
|
| request_->url().spec().c_str(),
|
| - download_id_.local(),
|
| + download_id_,
|
| global_id_.child_id,
|
| global_id_.request_id,
|
| render_view_id_,
|
|
|