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

Unified Diff: mojo/runner/child/runner_connection.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/runner/child/native_apptest_target.cc ('k') | mojo/runner/child/test_native_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/runner/child/runner_connection.cc
diff --git a/mojo/runner/child/runner_connection.cc b/mojo/runner/child/runner_connection.cc
index 1fdcdb8a3c4c356da72d85249ff46236bd784cdd..7b6584534c8f58bede09ca6fdacb675e378b616e 100644
--- a/mojo/runner/child/runner_connection.cc
+++ b/mojo/runner/child/runner_connection.cc
@@ -4,6 +4,8 @@
#include "mojo/runner/child/runner_connection.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/callback.h"
#include "base/command_line.h"
@@ -74,7 +76,7 @@ using GotApplicationRequestCallback =
void OnGotApplicationRequest(InterfaceRequest<Application>* out_request,
InterfaceRequest<Application> request) {
- *out_request = request.Pass();
+ *out_request = std::move(request);
}
class ChildControllerImpl;
@@ -99,7 +101,7 @@ class RunnerConnectionImpl : public RunnerConnection {
ChildControllerImpl* controller() const { return controller_.get(); }
void set_controller(scoped_ptr<ChildControllerImpl> controller) {
- controller_ = controller.Pass();
+ controller_ = std::move(controller);
}
private:
@@ -146,13 +148,13 @@ class ChildControllerImpl : public ChildController {
scoped_ptr<ChildControllerImpl> impl(
new ChildControllerImpl(connection, callback, unblocker));
- impl->Bind(runner_handle.Pass());
+ impl->Bind(std::move(runner_handle));
- connection->set_controller(impl.Pass());
+ connection->set_controller(std::move(impl));
}
void Bind(ScopedMessagePipeHandle handle) {
- binding_.Bind(handle.Pass());
+ binding_.Bind(std::move(handle));
binding_.set_connection_error_handler([this]() { OnConnectionError(); });
}
@@ -192,7 +194,7 @@ class ChildControllerImpl : public ChildController {
static void ReturnApplicationRequestOnMainThread(
const GotApplicationRequestCallback& callback,
InterfaceRequest<Application> application_request) {
- callback.Run(application_request.Pass());
+ callback.Run(std::move(application_request));
}
base::ThreadChecker thread_checker_;
@@ -221,9 +223,9 @@ bool RunnerConnectionImpl::WaitForApplicationRequest(
scoped_refptr<base::TaskRunner> task_runner;
if (!base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk"))
task_runner = base::ThreadTaskRunnerHandle::Get();
- handle = embedder::CreateChannel(platform_channel.Pass(),
- base::Bind(&DidCreateChannel),
- task_runner);
+ handle =
+ embedder::CreateChannel(std::move(platform_channel),
+ base::Bind(&DidCreateChannel), task_runner);
// Copy of code in child_process.cc
if (base::CommandLine::ForCurrentProcess()->HasSwitch("use-new-edk")) {
// When using the new Mojo EDK, each message pipe is backed by a platform
@@ -275,7 +277,7 @@ RunnerConnection* RunnerConnection::ConnectToRunner(
InterfaceRequest<Application>* request,
ScopedMessagePipeHandle handle) {
RunnerConnectionImpl* connection = new RunnerConnectionImpl;
- if (!connection->WaitForApplicationRequest(request, handle.Pass())) {
+ if (!connection->WaitForApplicationRequest(request, std::move(handle))) {
delete connection;
return nullptr;
}
« no previous file with comments | « mojo/runner/child/native_apptest_target.cc ('k') | mojo/runner/child/test_native_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698