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

Unified Diff: mojo/edk/system/raw_channel_posix.cc

Issue 1529303004: Convert Pass()→std::move() in mojo/edk/ (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/edk/system/raw_channel.cc ('k') | mojo/edk/system/raw_channel_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/raw_channel_posix.cc
diff --git a/mojo/edk/system/raw_channel_posix.cc b/mojo/edk/system/raw_channel_posix.cc
index ac93463a40a4a7ebed6c7bbb58a930034e1c76cd..ded0ffcbd77dbce422a7daa05bc0cbc533e73c2a 100644
--- a/mojo/edk/system/raw_channel_posix.cc
+++ b/mojo/edk/system/raw_channel_posix.cc
@@ -10,9 +10,9 @@
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
-
#include <algorithm>
#include <deque>
+#include <utility>
#include "base/bind.h"
#include "base/location.h"
@@ -109,7 +109,7 @@ class RawChannelPosix final : public RawChannel,
};
RawChannelPosix::RawChannelPosix(ScopedPlatformHandle handle)
- : fd_(handle.Pass()),
+ : fd_(std::move(handle)),
pending_read_(false),
pending_write_(false),
weak_ptr_factory_(this) {
@@ -152,9 +152,9 @@ void RawChannelPosix::EnqueueMessageNoLock(
new PlatformHandleVector(
platform_handles->begin() + i,
platform_handles->begin() + i + kPlatformChannelMaxNumHandles));
- fd_message->SetTransportData(make_scoped_ptr(
- new TransportData(fds.Pass(), GetSerializedPlatformHandleSize())));
- RawChannel::EnqueueMessageNoLock(fd_message.Pass());
+ fd_message->SetTransportData(make_scoped_ptr(new TransportData(
+ std::move(fds), GetSerializedPlatformHandleSize())));
+ RawChannel::EnqueueMessageNoLock(std::move(fd_message));
}
// Remove the handles that we "moved" into the other messages.
@@ -163,7 +163,7 @@ void RawChannelPosix::EnqueueMessageNoLock(
}
}
- RawChannel::EnqueueMessageNoLock(message.Pass());
+ RawChannel::EnqueueMessageNoLock(std::move(message));
}
bool RawChannelPosix::OnReadMessageForRawChannel(
@@ -196,7 +196,7 @@ ScopedPlatformHandle RawChannelPosix::ReleaseHandleNoLock(
read_platform_handles_.pop_front();
}
- return fd_.Pass();
+ return std::move(fd_);
}
void RawChannelPosix::SetSerializedFDs(
@@ -218,9 +218,9 @@ void RawChannelPosix::SetSerializedFDs(
ScopedPlatformHandleVectorPtr fds(
new PlatformHandleVector(serialized_write_fds->begin() + i,
serialized_write_fds->begin() + i + batch));
- fd_message->SetTransportData(make_scoped_ptr(
- new TransportData(fds.Pass(), GetSerializedPlatformHandleSize())));
- RawChannel::EnqueueMessageNoLock(fd_message.Pass());
+ fd_message->SetTransportData(make_scoped_ptr(new TransportData(
+ std::move(fds), GetSerializedPlatformHandleSize())));
+ RawChannel::EnqueueMessageNoLock(std::move(fd_message));
i += batch;
}
}
@@ -269,7 +269,7 @@ ScopedPlatformHandleVectorPtr RawChannelPosix::GetReadPlatformHandles(
read_platform_handles_.erase(
read_platform_handles_.begin(),
read_platform_handles_.begin() + num_platform_handles);
- return rv.Pass();
+ return rv;
}
size_t RawChannelPosix::SerializePlatformHandles(std::vector<int>* fds) {
@@ -557,7 +557,7 @@ void RawChannelPosix::WaitToWrite() {
// Static factory method declared in raw_channel.h.
// static
RawChannel* RawChannel::Create(ScopedPlatformHandle handle) {
- return new RawChannelPosix(handle.Pass());
+ return new RawChannelPosix(std::move(handle));
}
size_t RawChannel::GetSerializedPlatformHandleSize() {
« no previous file with comments | « mojo/edk/system/raw_channel.cc ('k') | mojo/edk/system/raw_channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698