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

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

Issue 1396783004: Convert mojo::system::ChannelEndpointClient to use our new refcounting stuff (instead of base's). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 2 months 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/system/channel_unittest.cc ('k') | mojo/edk/system/data_pipe.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/core.cc
diff --git a/mojo/edk/system/core.cc b/mojo/edk/system/core.cc
index 450897c7ee490e07fcdf999760ed9fe12f801c78..30f7085072c9bbe02245fa98627022dafc701da3 100644
--- a/mojo/edk/system/core.cc
+++ b/mojo/edk/system/core.cc
@@ -222,9 +222,9 @@ MojoResult Core::CreateMessagePipe(
return MOJO_RESULT_RESOURCE_EXHAUSTED;
}
- scoped_refptr<MessagePipe> message_pipe(MessagePipe::CreateLocalLocal());
- dispatcher0->Init(message_pipe, 0);
- dispatcher1->Init(message_pipe, 1);
+ auto message_pipe = MessagePipe::CreateLocalLocal();
+ dispatcher0->Init(message_pipe.Clone(), 0);
+ dispatcher1->Init(std::move(message_pipe), 1);
message_pipe_handle0.Put(handle_pair.first);
message_pipe_handle1.Put(handle_pair.second);
@@ -390,9 +390,9 @@ MojoResult Core::CreateDataPipe(
}
DCHECK_NE(handle_pair.second, MOJO_HANDLE_INVALID);
- scoped_refptr<DataPipe> data_pipe(DataPipe::CreateLocal(validated_options));
- producer_dispatcher->Init(data_pipe);
- consumer_dispatcher->Init(data_pipe);
+ auto data_pipe = DataPipe::CreateLocal(validated_options);
+ producer_dispatcher->Init(data_pipe.Clone());
+ consumer_dispatcher->Init(std::move(data_pipe));
data_pipe_producer_handle.Put(handle_pair.first);
data_pipe_consumer_handle.Put(handle_pair.second);
« no previous file with comments | « mojo/edk/system/channel_unittest.cc ('k') | mojo/edk/system/data_pipe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698