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

Unified Diff: mojo/fetcher/network_fetcher.cc

Issue 1538823002: Convert Pass()→std::move() in mojo/ (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
« no previous file with comments | « mojo/fetcher/local_fetcher.cc ('k') | mojo/fetcher/network_fetcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/fetcher/network_fetcher.cc
diff --git a/mojo/fetcher/network_fetcher.cc b/mojo/fetcher/network_fetcher.cc
index c9a37f220b16c77f722501921e53aa5412f5362c..f7089e5aa1f1dd57a2b38632fd997a838f73404b 100644
--- a/mojo/fetcher/network_fetcher.cc
+++ b/mojo/fetcher/network_fetcher.cc
@@ -4,6 +4,8 @@
#include "mojo/fetcher/network_fetcher.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/command_line.h"
#include "base/files/file.h"
@@ -37,7 +39,7 @@ NetworkFetcher::NetworkFetcher(bool disable_cache,
disable_cache_(false),
url_(request->url.To<GURL>()),
weak_ptr_factory_(this) {
- StartNetworkRequest(request.Pass(), url_loader_factory);
+ StartNetworkRequest(std::move(request), url_loader_factory);
}
NetworkFetcher::~NetworkFetcher() {
@@ -74,7 +76,7 @@ URLResponsePtr NetworkFetcher::AsURLResponse(base::TaskRunner* task_runner,
MOJO_READ_DATA_FLAG_ALL_OR_NONE | MOJO_READ_DATA_FLAG_DISCARD);
DCHECK_EQ(result, MOJO_RESULT_OK);
}
- return response_.Pass();
+ return std::move(response_);
}
void NetworkFetcher::RecordCacheToURLMapping(const base::FilePath& path,
@@ -197,7 +199,7 @@ void NetworkFetcher::AsPath(
}
base::CreateTemporaryFile(&path_);
- common::CopyToFile(response_->body.Pass(), path_, task_runner,
+ common::CopyToFile(std::move(response_->body), path_, task_runner,
base::Bind(&NetworkFetcher::CopyCompleted,
weak_ptr_factory_.GetWeakPtr(), callback));
}
@@ -226,7 +228,7 @@ void NetworkFetcher::StartNetworkRequest(mojo::URLRequestPtr request,
request->bypass_cache = disable_cache_;
url_loader_factory->CreateURLLoader(GetProxy(&url_loader_));
- url_loader_->Start(request.Pass(),
+ url_loader_->Start(std::move(request),
base::Bind(&NetworkFetcher::OnLoadComplete,
weak_ptr_factory_.GetWeakPtr()));
}
@@ -242,8 +244,8 @@ void NetworkFetcher::OnLoadComplete(URLResponsePtr response) {
return;
}
- response_ = response.Pass();
- loader_callback_.Run(owner.Pass());
+ response_ = std::move(response);
+ loader_callback_.Run(std::move(owner));
}
} // namespace fetcher
« no previous file with comments | « mojo/fetcher/local_fetcher.cc ('k') | mojo/fetcher/network_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698