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

Unified Diff: content/child/web_data_consumer_handle_impl_unittest.cc

Issue 1544293002: Convert Pass()→std::move() in //content (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 | « content/child/web_data_consumer_handle_impl.cc ('k') | content/child/web_discardable_memory_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/web_data_consumer_handle_impl_unittest.cc
diff --git a/content/child/web_data_consumer_handle_impl_unittest.cc b/content/child/web_data_consumer_handle_impl_unittest.cc
index 54121ba226ca6d3cd65b2b738e90a824f4e8e562..747d8d86b445a1e82f5a934fe72b29797a8988ae 100644
--- a/content/child/web_data_consumer_handle_impl_unittest.cc
+++ b/content/child/web_data_consumer_handle_impl_unittest.cc
@@ -6,9 +6,10 @@
#include <stddef.h>
#include <stdint.h>
-
#include <algorithm>
#include <string>
+#include <utility>
+
#include "base/bind.h"
#include "base/location.h"
#include "base/memory/scoped_ptr.h"
@@ -61,7 +62,7 @@ class ReadDataOperation : public ReadDataOperationBase {
ReadDataOperation(mojo::ScopedDataPipeConsumerHandle handle,
base::MessageLoop* main_message_loop,
const base::Closure& on_done)
- : handle_(new WebDataConsumerHandleImpl(handle.Pass())),
+ : handle_(new WebDataConsumerHandleImpl(std::move(handle))),
main_message_loop_(main_message_loop),
on_done_(on_done) {}
@@ -116,8 +117,9 @@ class TwoPhaseReadDataOperation : public ReadDataOperationBase {
TwoPhaseReadDataOperation(mojo::ScopedDataPipeConsumerHandle handle,
base::MessageLoop* main_message_loop,
const base::Closure& on_done)
- : handle_(new WebDataConsumerHandleImpl(handle.Pass())),
- main_message_loop_(main_message_loop), on_done_(on_done) {}
+ : handle_(new WebDataConsumerHandleImpl(std::move(handle))),
+ main_message_loop_(main_message_loop),
+ on_done_(on_done) {}
const std::string& result() const { return result_; }
@@ -228,9 +230,7 @@ class WebDataConsumerHandleImplTest : public ::testing::Test {
TEST_F(WebDataConsumerHandleImplTest, ReadData) {
base::RunLoop run_loop;
auto operation = make_scoped_ptr(new ReadDataOperation(
- consumer_.Pass(),
- &message_loop_,
- run_loop.QuitClosure()));
+ std::move(consumer_), &message_loop_, run_loop.QuitClosure()));
base::Thread t("DataConsumerHandle test thread");
ASSERT_TRUE(t.Start());
@@ -251,9 +251,7 @@ TEST_F(WebDataConsumerHandleImplTest, ReadData) {
TEST_F(WebDataConsumerHandleImplTest, TwoPhaseReadData) {
base::RunLoop run_loop;
auto operation = make_scoped_ptr(new TwoPhaseReadDataOperation(
- consumer_.Pass(),
- &message_loop_,
- run_loop.QuitClosure()));
+ std::move(consumer_), &message_loop_, run_loop.QuitClosure()));
base::Thread t("DataConsumerHandle test thread");
ASSERT_TRUE(t.Start());
« no previous file with comments | « content/child/web_data_consumer_handle_impl.cc ('k') | content/child/web_discardable_memory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698