Index: content/browser/download/download_manager_impl.cc |
diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc |
index 617494f2ef6d273f43c1e37a307adf865c3fe119..7a54c3c07ad407999932df0471c474c98eef478d 100644 |
--- a/content/browser/download/download_manager_impl.cc |
+++ b/content/browser/download/download_manager_impl.cc |
@@ -127,19 +127,22 @@ namespace content { |
// static |
DownloadManager* DownloadManager::Create( |
- content::DownloadManagerDelegate* delegate) { |
- return new DownloadManagerImpl(delegate); |
+ content::DownloadManagerDelegate* delegate, |
+ net::NetLog* net_log) { |
+ return new DownloadManagerImpl(delegate, net_log); |
} |
} // namespace content |
DownloadManagerImpl::DownloadManagerImpl( |
- content::DownloadManagerDelegate* delegate) |
+ content::DownloadManagerDelegate* delegate, |
+ net::NetLog* net_log) |
: shutdown_needed_(false), |
browser_context_(NULL), |
file_manager_(NULL), |
delegate_(delegate), |
- largest_db_handle_in_history_(DownloadItem::kUninitializedHandle) { |
+ largest_db_handle_in_history_(DownloadItem::kUninitializedHandle), |
+ net_log_(net_log) { |
} |
DownloadManagerImpl::~DownloadManagerImpl() { |
@@ -389,19 +392,23 @@ FilePath DownloadManagerImpl::LastDownloadPath() { |
return last_download_path_; |
} |
-void DownloadManagerImpl::CreateDownloadItem( |
+net::BoundNetLog DownloadManagerImpl::CreateDownloadItem( |
DownloadCreateInfo* info, const DownloadRequestHandle& request_handle) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ net::BoundNetLog bound_net_log = |
+ net::BoundNetLog::Make(net_log_, net::NetLog::SOURCE_DOWNLOAD); |
DownloadItem* download = new DownloadItemImpl( |
this, *info, new DownloadRequestHandle(request_handle), |
- browser_context_->IsOffTheRecord(), net::BoundNetLog()); |
+ browser_context_->IsOffTheRecord(), bound_net_log); |
int32 download_id = info->download_id.local(); |
DCHECK(!ContainsKey(in_progress_, download_id)); |
CHECK_96627(!ContainsKey(active_downloads_, download_id)); |
downloads_.insert(download); |
active_downloads_[download_id] = download; |
+ |
+ return bound_net_log; |
} |
DownloadItem* DownloadManagerImpl::CreateSavePackageDownloadItem( |
@@ -409,8 +416,10 @@ DownloadItem* DownloadManagerImpl::CreateSavePackageDownloadItem( |
const GURL& page_url, |
bool is_otr, |
DownloadItem::Observer* observer) { |
+ net::BoundNetLog bound_net_log = |
+ net::BoundNetLog::Make(net_log_, net::NetLog::SOURCE_DOWNLOAD); |
DownloadItem* download = new DownloadItemImpl( |
- this, main_file_path, page_url, is_otr, GetNextId(), net::BoundNetLog()); |
+ this, main_file_path, page_url, is_otr, GetNextId(), bound_net_log); |
download->AddObserver(observer); |
@@ -914,8 +923,10 @@ void DownloadManagerImpl::OnPersistentStoreQueryComplete( |
largest_db_handle_in_history_ = 0; |
for (size_t i = 0; i < entries->size(); ++i) { |
+ net::BoundNetLog bound_net_log = |
+ net::BoundNetLog::Make(net_log_, net::NetLog::SOURCE_DOWNLOAD); |
DownloadItem* download = new DownloadItemImpl( |
- this, GetNextId(), entries->at(i), net::BoundNetLog()); |
+ this, GetNextId(), entries->at(i), bound_net_log); |
CHECK_96627(!ContainsKey(history_downloads_, download->GetDbHandle())); |
downloads_.insert(download); |
history_downloads_[download->GetDbHandle()] = download; |