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

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

Issue 11028131: Shift passage of FileStream in downloads system to be by scoped_ptr<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporated Al's comments. Created 8 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 7577208cf20139e4b2942b230b6cc5bc71d5b035..8266fc071e5cc54b9b9378231e824405244ec47a 100644
--- a/content/browser/download/download_file_manager.cc
+++ b/content/browser/download/download_file_manager.cc
@@ -63,14 +63,17 @@ void DownloadFileManager::CreateDownloadFile(
DCHECK(info.get());
VLOG(20) << __FUNCTION__ << "()" << " info = " << info->DebugString();
+ // Can't dereference info after info.Pass(), so we need to do it here.
+ DownloadId id(info->download_id);
+
scoped_ptr<DownloadFile> download_file(download_file_factory_->CreateFile(
- info.get(), stream.Pass(), download_manager, get_hash, bound_net_log));
+ info.Pass(), stream.Pass(), download_manager, get_hash, bound_net_log));
content::DownloadInterruptReason interrupt_reason(
download_file->Initialize());
if (interrupt_reason == content::DOWNLOAD_INTERRUPT_REASON_NONE) {
- DCHECK(GetDownloadFile(info->download_id) == NULL);
- downloads_[info->download_id] = download_file.release();
+ DCHECK(GetDownloadFile(id) == NULL);
+ downloads_[id] = download_file.release();
}
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
« no previous file with comments | « content/browser/download/download_file_impl.cc ('k') | content/browser/download/download_file_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698