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

Unified Diff: third_party/mojo/src/mojo/edk/embedder/platform_channel_pair_posix_unittest.cc

Issue 1545333002: Convert Pass()→std::move() in //third_party/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
Index: third_party/mojo/src/mojo/edk/embedder/platform_channel_pair_posix_unittest.cc
diff --git a/third_party/mojo/src/mojo/edk/embedder/platform_channel_pair_posix_unittest.cc b/third_party/mojo/src/mojo/edk/embedder/platform_channel_pair_posix_unittest.cc
index 4927b4b8745cf6468f848c4bb039c66b16e57886..3bd3f4facf3ff5e6cf2334fd63da03f0769b869d 100644
--- a/third_party/mojo/src/mojo/edk/embedder/platform_channel_pair_posix_unittest.cc
+++ b/third_party/mojo/src/mojo/edk/embedder/platform_channel_pair_posix_unittest.cc
@@ -12,8 +12,8 @@
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
-
#include <deque>
+#include <utility>
#include "base/files/scoped_file.h"
#include "base/logging.h"
@@ -83,8 +83,8 @@ class PlatformChannelPairPosixTest : public testing::Test {
TEST_F(PlatformChannelPairPosixTest, NoSigPipe) {
PlatformChannelPair channel_pair;
- ScopedPlatformHandle server_handle = channel_pair.PassServerHandle().Pass();
- ScopedPlatformHandle client_handle = channel_pair.PassClientHandle().Pass();
+ ScopedPlatformHandle server_handle = channel_pair.PassServerHandle();
+ ScopedPlatformHandle client_handle = channel_pair.PassClientHandle();
// Write to the client.
static const char kHello[] = "hello";
@@ -124,8 +124,8 @@ TEST_F(PlatformChannelPairPosixTest, NoSigPipe) {
TEST_F(PlatformChannelPairPosixTest, SendReceiveData) {
PlatformChannelPair channel_pair;
- ScopedPlatformHandle server_handle = channel_pair.PassServerHandle().Pass();
- ScopedPlatformHandle client_handle = channel_pair.PassClientHandle().Pass();
+ ScopedPlatformHandle server_handle = channel_pair.PassServerHandle();
+ ScopedPlatformHandle client_handle = channel_pair.PassClientHandle();
for (size_t i = 0; i < 10; i++) {
std::string send_string(1 << i, 'A' + i);
@@ -150,8 +150,8 @@ TEST_F(PlatformChannelPairPosixTest, SendReceiveFDs) {
static const char kHello[] = "hello";
PlatformChannelPair channel_pair;
- ScopedPlatformHandle server_handle = channel_pair.PassServerHandle().Pass();
- ScopedPlatformHandle client_handle = channel_pair.PassClientHandle().Pass();
+ ScopedPlatformHandle server_handle = channel_pair.PassServerHandle();
+ ScopedPlatformHandle client_handle = channel_pair.PassClientHandle();
// Reduce the number of FDs opened on OS X to avoid test flake.
#if defined(OS_MACOSX)
@@ -170,7 +170,7 @@ TEST_F(PlatformChannelPairPosixTest, SendReceiveFDs) {
ASSERT_TRUE(fp);
ASSERT_EQ(j, fwrite(std::string(j, c).data(), 1, j, fp.get()));
platform_handles->push_back(
- test::PlatformHandleFromFILE(fp.Pass()).release());
+ test::PlatformHandleFromFILE(std::move(fp)).release());
ASSERT_TRUE(platform_handles->back().is_valid());
}
@@ -211,8 +211,8 @@ TEST_F(PlatformChannelPairPosixTest, AppendReceivedFDs) {
static const char kHello[] = "hello";
PlatformChannelPair channel_pair;
- ScopedPlatformHandle server_handle = channel_pair.PassServerHandle().Pass();
- ScopedPlatformHandle client_handle = channel_pair.PassClientHandle().Pass();
+ ScopedPlatformHandle server_handle = channel_pair.PassServerHandle();
+ ScopedPlatformHandle client_handle = channel_pair.PassClientHandle();
const std::string file_contents("hello world");
@@ -223,7 +223,7 @@ TEST_F(PlatformChannelPairPosixTest, AppendReceivedFDs) {
fwrite(file_contents.data(), 1, file_contents.size(), fp.get()));
ScopedPlatformHandleVectorPtr platform_handles(new PlatformHandleVector);
platform_handles->push_back(
- test::PlatformHandleFromFILE(fp.Pass()).release());
+ test::PlatformHandleFromFILE(std::move(fp)).release());
ASSERT_TRUE(platform_handles->back().is_valid());
// Send the FD (+ "hello").

Powered by Google App Engine
This is Rietveld 408576698