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

Unified Diff: mojo/edk/system/child_broker.cc

Issue 1529303004: Convert Pass()→std::move() in mojo/edk/ (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/edk/js/tests/js_to_cpp_tests.cc ('k') | mojo/edk/system/child_broker_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/child_broker.cc
diff --git a/mojo/edk/system/child_broker.cc b/mojo/edk/system/child_broker.cc
index 703f2adbf1d6dbdedeb971bbcd84587002197d9a..5e8253e73c26337cfdf274971196a060650d9325 100644
--- a/mojo/edk/system/child_broker.cc
+++ b/mojo/edk/system/child_broker.cc
@@ -4,6 +4,8 @@
#include "mojo/edk/system/child_broker.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/logging.h"
#include "mojo/edk/embedder/embedder_internal.h"
@@ -22,7 +24,7 @@ ChildBroker* ChildBroker::GetInstance() {
void ChildBroker::SetChildBrokerHostHandle(ScopedPlatformHandle handle) {
ScopedPlatformHandle parent_async_channel_handle;
#if defined(OS_POSIX)
- parent_async_channel_handle = handle.Pass();
+ parent_async_channel_handle = std::move(handle);
#else
// On Windows we have two pipes to the parent. The first is for the token
// exchange for creating and passing handles, since the child needs the
@@ -119,7 +121,7 @@ void ChildBroker::ConnectMessagePipe(uint64_t pipe_id,
data.type = CANCEL_CONNECT_MESSAGE_PIPE;
scoped_ptr<MessageInTransit> message(new MessageInTransit(
MessageInTransit::Type::MESSAGE, sizeof(data), &data));
- WriteAsyncMessage(message.Pass());
+ WriteAsyncMessage(std::move(message));
if (!in_process_pipes_channel1_) {
ScopedPlatformHandle server_handle, client_handle;
@@ -131,10 +133,10 @@ void ChildBroker::ConnectMessagePipe(uint64_t pipe_id,
client_handle = channel_pair.PassClientHandle();
#endif
in_process_pipes_channel1_ = new RoutedRawChannel(
- server_handle.Pass(),
+ std::move(server_handle),
base::Bind(&ChildBroker::ChannelDestructed, base::Unretained(this)));
in_process_pipes_channel2_ = new RoutedRawChannel(
- client_handle.Pass(),
+ std::move(client_handle),
base::Bind(&ChildBroker::ChannelDestructed, base::Unretained(this)));
}
@@ -149,7 +151,7 @@ void ChildBroker::ConnectMessagePipe(uint64_t pipe_id,
scoped_ptr<MessageInTransit> message(new MessageInTransit(
MessageInTransit::Type::MESSAGE, sizeof(data), &data));
pending_connects_[pipe_id] = message_pipe;
- WriteAsyncMessage(message.Pass());
+ WriteAsyncMessage(std::move(message));
}
void ChildBroker::CloseMessagePipe(
@@ -191,7 +193,7 @@ void ChildBroker::OnReadMessage(
CHECK(channels_.find(message->process_id) == channels_.end());
channels_[message->process_id] = new RoutedRawChannel(
- handle.Pass(),
+ std::move(handle),
base::Bind(&ChildBroker::ChannelDestructed, base::Unretained(this)));
} else if (type == PEER_PIPE_CONNECTED) {
DCHECK(!platform_handles);
@@ -237,9 +239,9 @@ void ChildBroker::WriteAsyncMessage(scoped_ptr<MessageInTransit> message) {
DCHECK(internal::g_io_thread_task_runner->RunsTasksOnCurrentThread());
message->set_route_id(kBrokerRouteId);
if (parent_async_channel_) {
- parent_async_channel_->channel()->WriteMessage(message.Pass());
+ parent_async_channel_->channel()->WriteMessage(std::move(message));
} else {
- async_channel_queue_.AddMessage(message.Pass());
+ async_channel_queue_.AddMessage(std::move(message));
}
}
@@ -248,7 +250,7 @@ void ChildBroker::InitAsyncChannel(
DCHECK(internal::g_io_thread_task_runner->RunsTasksOnCurrentThread());
parent_async_channel_ = new RoutedRawChannel(
- parent_async_channel_handle.Pass() ,
+ std::move(parent_async_channel_handle),
base::Bind(&ChildBroker::ChannelDestructed, base::Unretained(this)));
parent_async_channel_->AddRoute(kBrokerRouteId, this);
while (!async_channel_queue_.IsEmpty()) {
« no previous file with comments | « mojo/edk/js/tests/js_to_cpp_tests.cc ('k') | mojo/edk/system/child_broker_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698