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

Unified Diff: mojo/public/cpp/bindings/tests/sample_service_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/sample_service_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/sample_service_unittest.cc b/mojo/public/cpp/bindings/tests/sample_service_unittest.cc
index f9b957e74042408816e4d294130ed4c9c33a69a5..741ea8fdec05c341d84449e3f9d9f7c4e5316825 100644
--- a/mojo/public/cpp/bindings/tests/sample_service_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/sample_service_unittest.cc
@@ -4,10 +4,10 @@
#include <stddef.h>
#include <stdint.h>
-
#include <algorithm>
#include <ostream>
#include <string>
+#include <utility>
#include "mojo/public/interfaces/bindings/tests/sample_service.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -53,7 +53,7 @@ FooPtr MakeFoo() {
bar->beta = base + 20;
bar->gamma = base + 40;
bar->type = type;
- extra_bars[i] = bar.Pass();
+ extra_bars[i] = std::move(bar);
}
mojo::Array<uint8_t> data(10);
@@ -71,8 +71,8 @@ FooPtr MakeFoo() {
mojo::ScopedDataPipeProducerHandle producer;
mojo::ScopedDataPipeConsumerHandle consumer;
mojo::CreateDataPipe(&options, &producer, &consumer);
- input_streams[i] = consumer.Pass();
- output_streams[i] = producer.Pass();
+ input_streams[i] = std::move(consumer);
+ output_streams[i] = std::move(producer);
}
mojo::Array<mojo::Array<bool>> array_of_array_of_bools(2);
@@ -80,7 +80,7 @@ FooPtr MakeFoo() {
mojo::Array<bool> array_of_bools(2);
for (size_t j = 0; j < 2; ++j)
array_of_bools[j] = j;
- array_of_array_of_bools[i] = array_of_bools.Pass();
+ array_of_array_of_bools[i] = std::move(array_of_bools);
}
mojo::MessagePipe pipe;
@@ -91,15 +91,15 @@ FooPtr MakeFoo() {
foo->a = false;
foo->b = true;
foo->c = false;
- foo->bar = bar.Pass();
- foo->extra_bars = extra_bars.Pass();
- foo->data = data.Pass();
- foo->source = pipe.handle1.Pass();
- foo->input_streams = input_streams.Pass();
- foo->output_streams = output_streams.Pass();
- foo->array_of_array_of_bools = array_of_array_of_bools.Pass();
-
- return foo.Pass();
+ foo->bar = std::move(bar);
+ foo->extra_bars = std::move(extra_bars);
+ foo->data = std::move(data);
+ foo->source = std::move(pipe.handle1);
+ foo->input_streams = std::move(input_streams);
+ foo->output_streams = std::move(output_streams);
+ foo->array_of_array_of_bools = std::move(array_of_array_of_bools);
+
+ return foo;
}
// Check that the given |Foo| is identical to the one made by |MakeFoo()|.
@@ -332,8 +332,8 @@ TEST_F(BindingsSampleTest, Basic) {
CheckFoo(*foo);
PortPtr port;
- service->Frobinate(foo.Pass(), Service::BAZ_OPTIONS_EXTRA, port.Pass(),
- Service::FrobinateCallback());
+ service->Frobinate(std::move(foo), Service::BAZ_OPTIONS_EXTRA,
+ std::move(port), Service::FrobinateCallback());
delete service;
}
« no previous file with comments | « mojo/public/cpp/bindings/tests/router_unittest.cc ('k') | mojo/public/cpp/bindings/tests/serialization_warning_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698