Shift passage of FileStream in downloads system to be by scoped_ptr<>.
http://codereview.chromium.org/10912173/ constructs the DownloadFile, and
thus the BaseFile, on the UI thread and then passes it to the FILE thread.
DownloadFile / BaseFile may be constructed with a FileStream to which to
write the download. The FileStream cannot be passed by linked_ptr<> in this
case, as that is not thread safe.
BUG=123998
[email protected]
Review URL: https://chromiumcodereview.appspot.com/11028131
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162411 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc
index baaf531..3d18682 100644
--- a/content/browser/download/download_manager_impl.cc
+++ b/content/browser/download/download_manager_impl.cc
@@ -75,7 +75,7 @@
const char SavePageData::kKey[] = "DownloadItem SavePageData";
-void BeginDownload(content::DownloadUrlParameters* params) {
+void BeginDownload(scoped_ptr<content::DownloadUrlParameters> params) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// ResourceDispatcherHost{Base} is-not-a URLRequest::Delegate, and
// DownloadUrlParameters can-not include resource_dispatcher_host_impl.h, so
@@ -116,7 +116,7 @@
params->render_process_host_id(),
params->render_view_host_routing_id(),
params->prefer_cache(),
- params->save_info(),
+ params->GetSaveInfo(),
params->callback());
}
@@ -778,7 +778,7 @@
DCHECK(params->method() == "POST");
}
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind(
- &BeginDownload, base::Owned(params.release())));
+ &BeginDownload, base::Passed(params.Pass())));
}
void DownloadManagerImpl::AddObserver(Observer* observer) {