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

Unified Diff: mojo/package_manager/content_handler_unittest.cc

Issue 1538823002: Convert Pass()→std::move() in 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
« no previous file with comments | « mojo/package_manager/content_handler_connection.cc ('k') | mojo/package_manager/package_manager_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/package_manager/content_handler_unittest.cc
diff --git a/mojo/package_manager/content_handler_unittest.cc b/mojo/package_manager/content_handler_unittest.cc
index dfce5fcc06ac91a95501819d5455ff6921eea271..e6bafe4b9d7f62e112107cf088e86e7204e7dbd7 100644
--- a/mojo/package_manager/content_handler_unittest.cc
+++ b/mojo/package_manager/content_handler_unittest.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <utility>
+
#include "base/at_exit.h"
#include "base/bind.h"
#include "base/macros.h"
@@ -47,7 +49,7 @@ class TestFetcher : public shell::Fetcher {
GURL GetRedirectReferer() const override { return GURL(); }
URLResponsePtr AsURLResponse(base::TaskRunner* task_runner,
uint32_t skip) override {
- return URLResponse::New().Pass();
+ return URLResponse::New();
}
void AsPath(
base::TaskRunner* task_runner,
@@ -72,14 +74,14 @@ class TestContentHandler : public ContentHandler, public ApplicationDelegate {
public:
TestContentHandler(ApplicationConnection* connection,
InterfaceRequest<ContentHandler> request)
- : binding_(this, request.Pass()) {}
+ : binding_(this, std::move(request)) {}
// ContentHandler:
void StartApplication(
InterfaceRequest<Application> application_request,
URLResponsePtr response,
const Callback<void()>& destruct_callback) override {
- apps_.push_back(new ApplicationImpl(this, application_request.Pass()));
+ apps_.push_back(new ApplicationImpl(this, std::move(application_request)));
destruct_callback.Run();
}
@@ -105,7 +107,7 @@ class TestApplicationLoader : public shell::ApplicationLoader,
void Load(const GURL& url,
InterfaceRequest<Application> application_request) override {
++num_loads_;
- test_app_.reset(new ApplicationImpl(this, application_request.Pass()));
+ test_app_.reset(new ApplicationImpl(this, std::move(application_request)));
}
// ApplicationDelegate implementation.
@@ -117,7 +119,7 @@ class TestApplicationLoader : public shell::ApplicationLoader,
// InterfaceFactory<ContentHandler> implementation.
void Create(ApplicationConnection* connection,
InterfaceRequest<ContentHandler> request) override {
- new TestContentHandler(connection, request.Pass());
+ new TestContentHandler(connection, std::move(request));
}
scoped_ptr<ApplicationImpl> test_app_;
@@ -200,7 +202,7 @@ TEST_F(ContentHandlerTest, ContentHandlerConnectionGetsRequestorURL) {
params->SetTargetURL(GURL("test:test"));
params->set_on_application_end(
base::Bind(&QuitClosure, base::Unretained(&called)));
- application_manager_->ConnectToApplication(params.Pass());
+ application_manager_->ConnectToApplication(std::move(params));
loop_.Run();
EXPECT_TRUE(called);
@@ -226,7 +228,7 @@ TEST_F(ContentHandlerTest,
content_handler_id = t;
run_loop.Quit();
});
- application_manager_->ConnectToApplication(params.Pass());
+ application_manager_->ConnectToApplication(std::move(params));
run_loop.Run();
EXPECT_NE(Shell::kInvalidContentHandlerID, content_handler_id);
}
@@ -242,7 +244,7 @@ TEST_F(ContentHandlerTest,
content_handler_id2 = t;
run_loop.Quit();
});
- application_manager_->ConnectToApplication(params.Pass());
+ application_manager_->ConnectToApplication(std::move(params));
run_loop.Run();
EXPECT_NE(Shell::kInvalidContentHandlerID, content_handler_id2);
}
@@ -266,7 +268,7 @@ TEST_F(ContentHandlerTest, DifferedContentHandlersGetDifferentIDs) {
content_handler_id = t;
run_loop.Quit();
});
- application_manager_->ConnectToApplication(params.Pass());
+ application_manager_->ConnectToApplication(std::move(params));
run_loop.Run();
EXPECT_NE(Shell::kInvalidContentHandlerID, content_handler_id);
}
@@ -293,7 +295,7 @@ TEST_F(ContentHandlerTest, DifferedContentHandlersGetDifferentIDs) {
content_handler_id2 = t;
run_loop.Quit();
});
- application_manager_->ConnectToApplication(params.Pass());
+ application_manager_->ConnectToApplication(std::move(params));
run_loop.Run();
EXPECT_NE(Shell::kInvalidContentHandlerID, content_handler_id2);
}
@@ -312,7 +314,7 @@ TEST_F(ContentHandlerTest,
params->SetTargetURL(GURL("test:test"));
params->set_connect_callback(
[&content_handler_id](uint32_t t) { content_handler_id = t; });
- application_manager_->ConnectToApplication(params.Pass());
+ application_manager_->ConnectToApplication(std::move(params));
EXPECT_EQ(0u, content_handler_id);
}
« no previous file with comments | « mojo/package_manager/content_handler_connection.cc ('k') | mojo/package_manager/package_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698