Index: mojo/edk/system/multiprocess_message_pipe_unittest.cc |
diff --git a/mojo/edk/system/multiprocess_message_pipe_unittest.cc b/mojo/edk/system/multiprocess_message_pipe_unittest.cc |
index f1afa0e14c0b49aa1fd8de1177d6c050e5343e99..4d9424fb4306e89737560a4381896122acc751d6 100644 |
--- a/mojo/edk/system/multiprocess_message_pipe_unittest.cc |
+++ b/mojo/edk/system/multiprocess_message_pipe_unittest.cc |
@@ -5,8 +5,8 @@ |
#include <stdint.h> |
#include <stdio.h> |
#include <string.h> |
- |
#include <string> |
+#include <utility> |
#include <vector> |
#include "base/bind.h" |
@@ -44,10 +44,10 @@ class MultiprocessMessagePipeTest |
// not including any "quitquitquit" message, modulo 100. |
MOJO_MULTIPROCESS_TEST_CHILD_MAIN(EchoEcho) { |
ScopedPlatformHandle client_platform_handle = |
- test::MultiprocessTestHelper::client_platform_handle.Pass(); |
+ std::move(test::MultiprocessTestHelper::client_platform_handle); |
CHECK(client_platform_handle.is_valid()); |
ScopedMessagePipeHandle mp = |
- CreateMessagePipe(client_platform_handle.Pass()); |
+ CreateMessagePipe(std::move(client_platform_handle)); |
const std::string quitquitquit("quitquitquit"); |
int rv = 0; |
@@ -102,8 +102,8 @@ MOJO_MULTIPROCESS_TEST_CHILD_MAIN(EchoEcho) { |
TEST_F(MultiprocessMessagePipeTest, MAYBE_Basic) { |
helper()->StartChild("EchoEcho"); |
- ScopedMessagePipeHandle mp = CreateMessagePipe( |
- helper()->server_platform_handle.Pass()); |
+ ScopedMessagePipeHandle mp = |
+ CreateMessagePipe(std::move(helper()->server_platform_handle)); |
std::string hello("hello"); |
ASSERT_EQ(MOJO_RESULT_OK, |
@@ -148,8 +148,8 @@ TEST_F(MultiprocessMessagePipeTest, MAYBE_Basic) { |
TEST_F(MultiprocessMessagePipeTest, MAYBE_QueueMessages) { |
helper()->StartChild("EchoEcho"); |
- ScopedMessagePipeHandle mp = CreateMessagePipe( |
- helper()->server_platform_handle.Pass()); |
+ ScopedMessagePipeHandle mp = |
+ CreateMessagePipe(std::move(helper()->server_platform_handle)); |
static const size_t kNumMessages = 1001; |
for (size_t i = 0; i < kNumMessages; i++) { |
@@ -203,10 +203,10 @@ TEST_F(MultiprocessMessagePipeTest, MAYBE_QueueMessages) { |
MOJO_MULTIPROCESS_TEST_CHILD_MAIN(CheckSharedBuffer) { |
ScopedPlatformHandle client_platform_handle = |
- test::MultiprocessTestHelper::client_platform_handle.Pass(); |
+ std::move(test::MultiprocessTestHelper::client_platform_handle); |
CHECK(client_platform_handle.is_valid()); |
ScopedMessagePipeHandle mp = |
- CreateMessagePipe(client_platform_handle.Pass()); |
+ CreateMessagePipe(std::move(client_platform_handle)); |
// Wait for the first message from our parent. |
HandleSignalsState hss; |
@@ -291,8 +291,8 @@ MOJO_MULTIPROCESS_TEST_CHILD_MAIN(CheckSharedBuffer) { |
TEST_F(MultiprocessMessagePipeTest, MAYBE_SharedBufferPassing) { |
helper()->StartChild("CheckSharedBuffer"); |
- ScopedMessagePipeHandle mp = CreateMessagePipe( |
- helper()->server_platform_handle.Pass()); |
+ ScopedMessagePipeHandle mp = |
+ CreateMessagePipe(std::move(helper()->server_platform_handle)); |
// Make a shared buffer. |
MojoCreateSharedBufferOptions options; |
@@ -372,10 +372,10 @@ TEST_F(MultiprocessMessagePipeTest, MAYBE_SharedBufferPassing) { |
MOJO_MULTIPROCESS_TEST_CHILD_MAIN(CheckPlatformHandleFile) { |
ScopedPlatformHandle client_platform_handle = |
- test::MultiprocessTestHelper::client_platform_handle.Pass(); |
+ std::move(test::MultiprocessTestHelper::client_platform_handle); |
CHECK(client_platform_handle.is_valid()); |
ScopedMessagePipeHandle mp = |
- CreateMessagePipe(client_platform_handle.Pass()); |
+ CreateMessagePipe(std::move(client_platform_handle)); |
HandleSignalsState hss; |
CHECK_EQ(MojoWait(mp.get().value(), MOJO_HANDLE_SIGNAL_READABLE, |
@@ -413,7 +413,7 @@ MOJO_MULTIPROCESS_TEST_CHILD_MAIN(CheckPlatformHandleFile) { |
CHECK(h.is_valid()); |
MojoClose(handles[i]); |
- base::ScopedFILE fp(test::FILEFromPlatformHandle(h.Pass(), "r")); |
+ base::ScopedFILE fp(test::FILEFromPlatformHandle(std::move(h), "r")); |
CHECK(fp); |
std::string fread_buffer(100, '\0'); |
size_t bytes_read = |
@@ -434,8 +434,8 @@ TEST_P(MultiprocessMessagePipeTestWithPipeCount, PlatformHandlePassing) { |
ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
helper()->StartChild("CheckPlatformHandleFile"); |
- ScopedMessagePipeHandle mp = CreateMessagePipe( |
- helper()->server_platform_handle.Pass()); |
+ ScopedMessagePipeHandle mp = |
+ CreateMessagePipe(std::move(helper()->server_platform_handle)); |
std::vector<MojoHandle> handles; |
@@ -449,10 +449,11 @@ TEST_P(MultiprocessMessagePipeTestWithPipeCount, PlatformHandlePassing) { |
fflush(fp.get()); |
rewind(fp.get()); |
MojoHandle handle; |
- ASSERT_EQ(CreatePlatformHandleWrapper( |
- ScopedPlatformHandle(test::PlatformHandleFromFILE(fp.Pass())), |
- &handle), |
- MOJO_RESULT_OK); |
+ ASSERT_EQ( |
+ CreatePlatformHandleWrapper( |
+ ScopedPlatformHandle(test::PlatformHandleFromFILE(std::move(fp))), |
+ &handle), |
+ MOJO_RESULT_OK); |
handles.push_back(handle); |
} |
@@ -486,11 +487,11 @@ INSTANTIATE_TEST_CASE_P(PipeCount, |
MOJO_MULTIPROCESS_TEST_CHILD_MAIN(CheckMessagePipe) { |
ScopedPlatformHandle client_platform_handle = |
- test::MultiprocessTestHelper::client_platform_handle.Pass(); |
+ std::move(test::MultiprocessTestHelper::client_platform_handle); |
CHECK(client_platform_handle.is_valid()); |
ScopedMessagePipeHandle mp = |
- CreateMessagePipe(client_platform_handle.Pass()); |
+ CreateMessagePipe(std::move(client_platform_handle)); |
// Wait for the first message from our parent. |
HandleSignalsState hss; |
@@ -553,7 +554,7 @@ TEST_F(MultiprocessMessagePipeTest, MAYBE_MessagePipePassing) { |
helper()->StartChild("CheckMessagePipe"); |
ScopedMessagePipeHandle mp = |
- CreateMessagePipe(helper()->server_platform_handle.Pass()); |
+ CreateMessagePipe(std::move(helper()->server_platform_handle)); |
MojoCreateSharedBufferOptions options; |
options.struct_size = sizeof(options); |
options.flags = MOJO_CREATE_SHARED_BUFFER_OPTIONS_FLAG_NONE; |
@@ -606,7 +607,7 @@ TEST_F(MultiprocessMessagePipeTest, MAYBE_MessagePipeTwoPassing) { |
helper()->StartChild("CheckMessagePipe"); |
ScopedMessagePipeHandle mp = |
- CreateMessagePipe(helper()->server_platform_handle.Pass()); |
+ CreateMessagePipe(std::move(helper()->server_platform_handle)); |
MojoHandle mp1, mp2; |
ASSERT_EQ(MOJO_RESULT_OK, |
@@ -646,11 +647,11 @@ TEST_F(MultiprocessMessagePipeTest, MAYBE_MessagePipeTwoPassing) { |
MOJO_MULTIPROCESS_TEST_CHILD_MAIN(DataPipeConsumer) { |
ScopedPlatformHandle client_platform_handle = |
- test::MultiprocessTestHelper::client_platform_handle.Pass(); |
+ std::move(test::MultiprocessTestHelper::client_platform_handle); |
CHECK(client_platform_handle.is_valid()); |
ScopedMessagePipeHandle mp = |
- CreateMessagePipe(client_platform_handle.Pass()); |
+ CreateMessagePipe(std::move(client_platform_handle)); |
// Wait for the first message from our parent. |
HandleSignalsState hss; |
@@ -713,7 +714,7 @@ TEST_F(MultiprocessMessagePipeTest, MAYBE_DataPipeConsumer) { |
helper()->StartChild("DataPipeConsumer"); |
ScopedMessagePipeHandle mp = |
- CreateMessagePipe(helper()->server_platform_handle.Pass()); |
+ CreateMessagePipe(std::move(helper()->server_platform_handle)); |
MojoCreateSharedBufferOptions options; |
options.struct_size = sizeof(options); |
options.flags = MOJO_CREATE_SHARED_BUFFER_OPTIONS_FLAG_NONE; |