Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1222)

Unified Diff: content/browser/download/download_file_manager.cc

Issue 8401001: Fix history importing by delaying DownloadManager creation. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: comments Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/download/download_file_manager.cc
diff --git a/content/browser/download/download_file_manager.cc b/content/browser/download/download_file_manager.cc
index e6ecc9f81d49118e9e0b8301cba279c05d6eae05..b3fdb0843b51f03b44449d61b6aab497d589c49b 100644
--- a/content/browser/download/download_file_manager.cc
+++ b/content/browser/download/download_file_manager.cc
@@ -67,9 +67,8 @@ void DownloadFileManager::CreateDownloadFile(
return;
}
- DownloadId global_id(download_manager, info->download_id);
- DCHECK(GetDownloadFile(global_id) == NULL);
- downloads_[global_id] = download_file.release();
+ DCHECK(GetDownloadFile(info->download_id) == NULL);
+ downloads_[info->download_id] = download_file.release();
// The file is now ready, we can un-pause the request and start saving data.
request_handle.ResumeRequest();
@@ -79,7 +78,8 @@ void DownloadFileManager::CreateDownloadFile(
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
NewRunnableMethod(download_manager,
- &DownloadManager::StartDownload, info->download_id));
+ &DownloadManager::StartDownload,
+ info->download_id.local()));
}
DownloadFile* DownloadFileManager::GetDownloadFile(DownloadId global_id) {
@@ -290,7 +290,7 @@ void DownloadFileManager::OnDownloadManagerShutdown(DownloadManager* manager) {
for (std::set<DownloadFile*>::iterator i = to_remove.begin();
i != to_remove.end(); ++i) {
- downloads_.erase(DownloadId((*i)->GetDownloadManager(), (*i)->id()));
+ downloads_.erase((*i)->global_id());
delete *i;
}
}

Powered by Google App Engine
This is Rietveld 408576698