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

Unified Diff: mojo/public/cpp/bindings/tests/connector_unittest.cc

Issue 1535943002: Convert Pass()→std::move() in //mojo/public/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Regenerate correctly 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: mojo/public/cpp/bindings/tests/connector_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/connector_unittest.cc b/mojo/public/cpp/bindings/tests/connector_unittest.cc
index 601304b8e02a6a956dd959f9dbddc89c066576de..96bb89fde55f9c21a0fa76e583f9791bde176a4c 100644
--- a/mojo/public/cpp/bindings/tests/connector_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/connector_unittest.cc
@@ -2,13 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "mojo/public/cpp/bindings/lib/connector.h"
+
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
+#include <utility>
#include "base/message_loop/message_loop.h"
#include "mojo/message_pump/message_pump_mojo.h"
-#include "mojo/public/cpp/bindings/lib/connector.h"
#include "mojo/public/cpp/bindings/lib/message_builder.h"
#include "mojo/public/cpp/bindings/tests/message_queue.h"
#include "mojo/public/cpp/system/macros.h"
@@ -101,9 +103,9 @@ class ConnectorTest : public testing::Test {
};
TEST_F(ConnectorTest, Basic) {
- internal::Connector connector0(handle0_.Pass(),
+ internal::Connector connector0(std::move(handle0_),
internal::Connector::SINGLE_THREADED_SEND);
- internal::Connector connector1(handle1_.Pass(),
+ internal::Connector connector1(std::move(handle1_),
internal::Connector::SINGLE_THREADED_SEND);
const char kText[] = "hello world";
@@ -129,9 +131,9 @@ TEST_F(ConnectorTest, Basic) {
}
TEST_F(ConnectorTest, Basic_Synchronous) {
- internal::Connector connector0(handle0_.Pass(),
+ internal::Connector connector0(std::move(handle0_),
internal::Connector::SINGLE_THREADED_SEND);
- internal::Connector connector1(handle1_.Pass(),
+ internal::Connector connector1(std::move(handle1_),
internal::Connector::SINGLE_THREADED_SEND);
const char kText[] = "hello world";
@@ -157,9 +159,9 @@ TEST_F(ConnectorTest, Basic_Synchronous) {
}
TEST_F(ConnectorTest, Basic_EarlyIncomingReceiver) {
- internal::Connector connector0(handle0_.Pass(),
+ internal::Connector connector0(std::move(handle0_),
internal::Connector::SINGLE_THREADED_SEND);
- internal::Connector connector1(handle1_.Pass(),
+ internal::Connector connector1(std::move(handle1_),
internal::Connector::SINGLE_THREADED_SEND);
MessageAccumulator accumulator;
@@ -185,9 +187,9 @@ TEST_F(ConnectorTest, Basic_EarlyIncomingReceiver) {
}
TEST_F(ConnectorTest, Basic_TwoMessages) {
- internal::Connector connector0(handle0_.Pass(),
+ internal::Connector connector0(std::move(handle0_),
internal::Connector::SINGLE_THREADED_SEND);
- internal::Connector connector1(handle1_.Pass(),
+ internal::Connector connector1(std::move(handle1_),
internal::Connector::SINGLE_THREADED_SEND);
const char* kText[] = {"hello", "world"};
@@ -217,9 +219,9 @@ TEST_F(ConnectorTest, Basic_TwoMessages) {
}
TEST_F(ConnectorTest, Basic_TwoMessages_Synchronous) {
- internal::Connector connector0(handle0_.Pass(),
+ internal::Connector connector0(std::move(handle0_),
internal::Connector::SINGLE_THREADED_SEND);
- internal::Connector connector1(handle1_.Pass(),
+ internal::Connector connector1(std::move(handle1_),
internal::Connector::SINGLE_THREADED_SEND);
const char* kText[] = {"hello", "world"};
@@ -249,7 +251,7 @@ TEST_F(ConnectorTest, Basic_TwoMessages_Synchronous) {
}
TEST_F(ConnectorTest, WriteToClosedPipe) {
- internal::Connector connector0(handle0_.Pass(),
+ internal::Connector connector0(std::move(handle0_),
internal::Connector::SINGLE_THREADED_SEND);
const char kText[] = "hello world";
@@ -277,9 +279,9 @@ TEST_F(ConnectorTest, WriteToClosedPipe) {
}
TEST_F(ConnectorTest, MessageWithHandles) {
- internal::Connector connector0(handle0_.Pass(),
+ internal::Connector connector0(std::move(handle0_),
internal::Connector::SINGLE_THREADED_SEND);
- internal::Connector connector1(handle1_.Pass(),
+ internal::Connector connector1(std::move(handle1_),
internal::Connector::SINGLE_THREADED_SEND);
const char kText[] = "hello world";
@@ -319,9 +321,9 @@ TEST_F(ConnectorTest, MessageWithHandles) {
// |smph| now owns this handle.
internal::Connector connector_received(
- smph.Pass(), internal::Connector::SINGLE_THREADED_SEND);
+ std::move(smph), internal::Connector::SINGLE_THREADED_SEND);
internal::Connector connector_original(
- pipe.handle1.Pass(), internal::Connector::SINGLE_THREADED_SEND);
+ std::move(pipe.handle1), internal::Connector::SINGLE_THREADED_SEND);
Message message2;
AllocMessage(kText, &message2);
@@ -340,7 +342,7 @@ TEST_F(ConnectorTest, MessageWithHandles) {
}
TEST_F(ConnectorTest, WaitForIncomingMessageWithError) {
- internal::Connector connector0(handle0_.Pass(),
+ internal::Connector connector0(std::move(handle0_),
internal::Connector::SINGLE_THREADED_SEND);
// Close the other end of the pipe.
handle1_.reset();
@@ -348,10 +350,10 @@ TEST_F(ConnectorTest, WaitForIncomingMessageWithError) {
}
TEST_F(ConnectorTest, WaitForIncomingMessageWithDeletion) {
- internal::Connector connector0(handle0_.Pass(),
+ internal::Connector connector0(std::move(handle0_),
internal::Connector::SINGLE_THREADED_SEND);
internal::Connector* connector1 = new internal::Connector(
- handle1_.Pass(), internal::Connector::SINGLE_THREADED_SEND);
+ std::move(handle1_), internal::Connector::SINGLE_THREADED_SEND);
const char kText[] = "hello world";
@@ -377,9 +379,9 @@ TEST_F(ConnectorTest, WaitForIncomingMessageWithDeletion) {
}
TEST_F(ConnectorTest, WaitForIncomingMessageWithReentrancy) {
- internal::Connector connector0(handle0_.Pass(),
+ internal::Connector connector0(std::move(handle0_),
internal::Connector::SINGLE_THREADED_SEND);
- internal::Connector connector1(handle1_.Pass(),
+ internal::Connector connector1(std::move(handle1_),
internal::Connector::SINGLE_THREADED_SEND);
const char* kText[] = {"hello", "world"};
@@ -411,13 +413,13 @@ TEST_F(ConnectorTest, WaitForIncomingMessageWithReentrancy) {
}
TEST_F(ConnectorTest, RaiseError) {
- internal::Connector connector0(handle0_.Pass(),
+ internal::Connector connector0(std::move(handle0_),
internal::Connector::SINGLE_THREADED_SEND);
bool error_handler_called0 = false;
connector0.set_connection_error_handler(
[&error_handler_called0]() { error_handler_called0 = true; });
- internal::Connector connector1(handle1_.Pass(),
+ internal::Connector connector1(std::move(handle1_),
internal::Connector::SINGLE_THREADED_SEND);
bool error_handler_called1 = false;
connector1.set_connection_error_handler(
« no previous file with comments | « mojo/public/cpp/bindings/tests/bindings_perftest.cc ('k') | mojo/public/cpp/bindings/tests/equals_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698