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

Unified Diff: components/nacl/browser/pnacl_host.cc

Issue 1548203002: Convert Pass()→std::move() in //components/[n-z]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bad headers 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 | « components/nacl/browser/nacl_process_host.cc ('k') | components/nacl/loader/nacl_ipc_adapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/browser/pnacl_host.cc
diff --git a/components/nacl/browser/pnacl_host.cc b/components/nacl/browser/pnacl_host.cc
index a0375e28da9462b3081e6de9d09e4bd867243662..f5f18f30a06bb3d2240a686cfd1c737ee3f6bbe5 100644
--- a/components/nacl/browser/pnacl_host.cc
+++ b/components/nacl/browser/pnacl_host.cc
@@ -4,6 +4,8 @@
#include "components/nacl/browser/pnacl_host.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/files/file_path.h"
@@ -50,9 +52,7 @@ class FileProxy {
FileProxy::FileProxy(scoped_ptr<base::File> file,
base::WeakPtr<pnacl::PnaclHost> host)
- : file_(file.Pass()),
- host_(host) {
-}
+ : file_(std::move(file)), host_(host) {}
int FileProxy::Write(scoped_refptr<net::DrainableIOBuffer> buffer) {
int rv = file_->Write(0, buffer->data(), buffer->size());
@@ -63,7 +63,7 @@ int FileProxy::Write(scoped_refptr<net::DrainableIOBuffer> buffer) {
void FileProxy::WriteDone(const PnaclHost::TranslationID& id, int result) {
if (host_) {
- host_->OnBufferCopiedToTempFile(id, file_.Pass(), result);
+ host_->OnBufferCopiedToTempFile(id, std::move(file_), result);
} else {
BrowserThread::PostBlockingPoolTask(
FROM_HERE,
@@ -207,8 +207,8 @@ void PnaclHost::DoCreateTemporaryFile(base::FilePath temp_dir,
if (!file.IsValid())
PLOG(ERROR) << "Temp file open failed: " << file.error_details();
}
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE, base::Bind(cb, Passed(file.Pass())));
+ BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
+ base::Bind(cb, Passed(std::move(file))));
}
void PnaclHost::CreateTemporaryFile(TempFileCallback cb) {
@@ -331,7 +331,7 @@ void PnaclHost::OnTempFileReturn(const TranslationID& id,
// file was being created.
LOG(ERROR) << "OnTempFileReturn: id not found";
BrowserThread::PostBlockingPoolTask(
- FROM_HERE, base::Bind(CloseBaseFile, Passed(file.Pass())));
+ FROM_HERE, base::Bind(CloseBaseFile, Passed(std::move(file))));
return;
}
if (!file.IsValid()) {
@@ -349,7 +349,7 @@ void PnaclHost::OnTempFileReturn(const TranslationID& id,
}
PendingTranslation* pt = &entry->second;
pt->got_nexe_fd = true;
- pt->nexe_fd = new base::File(file.Pass());
+ pt->nexe_fd = new base::File(std::move(file));
CheckCacheQueryReady(entry);
}
@@ -385,7 +385,7 @@ void PnaclHost::CheckCacheQueryReady(
scoped_ptr<base::File> file(pt->nexe_fd);
pt->nexe_fd = NULL;
pt->got_nexe_fd = false;
- FileProxy* proxy(new FileProxy(file.Pass(), weak_factory_.GetWeakPtr()));
+ FileProxy* proxy(new FileProxy(std::move(file), weak_factory_.GetWeakPtr()));
if (!base::PostTaskAndReplyWithResult(
BrowserThread::GetBlockingPool(),
« no previous file with comments | « components/nacl/browser/nacl_process_host.cc ('k') | components/nacl/loader/nacl_ipc_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698