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

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

Issue 1545243002: Convert Pass()→std::move() in //content/browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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_manager_impl.cc
diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc
index 9099a3fe4f45f89af16cb61ee5003b07c7274bb3..fed1fcae90831f6768dcc028acd428c68e2f1670 100644
--- a/content/browser/download/download_manager_impl.cc
+++ b/content/browser/download/download_manager_impl.cc
@@ -5,6 +5,7 @@
#include "content/browser/download/download_manager_impl.h"
#include <iterator>
+#include <utility>
#include "base/bind.h"
#include "base/callback.h"
@@ -66,7 +67,7 @@ scoped_ptr<UrlDownloader, BrowserThread::DeleteOnIOThread> BeginDownload(
scoped_ptr<net::UploadElementReader> reader(
net::UploadOwnedBytesElementReader::CreateWithString(body));
request->set_upload(
- net::ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0));
+ net::ElementsUploadDataStream::CreateWithReader(std::move(reader), 0));
}
if (params->post_id() >= 0) {
// The POST in this case does not have an actual body, and only works
@@ -204,9 +205,8 @@ class DownloadItemFactoryImpl : public DownloadItemFactory {
const std::string& mime_type,
scoped_ptr<DownloadRequestHandleInterface> request_handle,
const net::BoundNetLog& bound_net_log) override {
- return new DownloadItemImpl(delegate, download_id, path, url,
- mime_type, request_handle.Pass(),
- bound_net_log);
+ return new DownloadItemImpl(delegate, download_id, path, url, mime_type,
+ std::move(request_handle), bound_net_log);
}
};
@@ -463,12 +463,8 @@ void DownloadManagerImpl::CreateSavePackageDownloadItem(
DCHECK_CURRENTLY_ON(BrowserThread::UI);
GetNextId(base::Bind(
&DownloadManagerImpl::CreateSavePackageDownloadItemWithId,
- weak_factory_.GetWeakPtr(),
- main_file_path,
- page_url,
- mime_type,
- base::Passed(request_handle.Pass()),
- item_created));
+ weak_factory_.GetWeakPtr(), main_file_path, page_url, mime_type,
+ base::Passed(std::move(request_handle)), item_created));
}
void DownloadManagerImpl::CreateSavePackageDownloadItemWithId(
@@ -484,12 +480,7 @@ void DownloadManagerImpl::CreateSavePackageDownloadItemWithId(
net::BoundNetLog bound_net_log =
net::BoundNetLog::Make(net_log_, net::NetLog::SOURCE_DOWNLOAD);
DownloadItemImpl* download_item = item_factory_->CreateSavePageItem(
- this,
- id,
- main_file_path,
- page_url,
- mime_type,
- request_handle.Pass(),
+ this, id, main_file_path, page_url, mime_type, std::move(request_handle),
bound_net_log);
downloads_[download_item->GetId()] = download_item;
FOR_EACH_OBSERVER(Observer, observers_, OnDownloadCreated(
@@ -521,12 +512,12 @@ void DownloadManagerImpl::ResumeInterruptedDownload(
void DownloadManagerImpl::SetDownloadItemFactoryForTesting(
scoped_ptr<DownloadItemFactory> item_factory) {
- item_factory_ = item_factory.Pass();
+ item_factory_ = std::move(item_factory);
}
void DownloadManagerImpl::SetDownloadFileFactoryForTesting(
scoped_ptr<DownloadFileFactory> file_factory) {
- file_factory_ = file_factory.Pass();
+ file_factory_ = std::move(file_factory);
}
DownloadFileFactory* DownloadManagerImpl::GetDownloadFileFactoryForTesting() {
@@ -546,7 +537,7 @@ void DownloadManagerImpl::DownloadRemoved(DownloadItemImpl* download) {
void DownloadManagerImpl::AddUrlDownloader(
scoped_ptr<UrlDownloader, BrowserThread::DeleteOnIOThread> downloader) {
if (downloader)
- url_downloaders_.push_back(downloader.Pass());
+ url_downloaders_.push_back(std::move(downloader));
}
void DownloadManagerImpl::RemoveUrlDownloader(UrlDownloader* downloader) {
« no previous file with comments | « content/browser/download/download_item_impl_unittest.cc ('k') | content/browser/download/download_manager_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698