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

Unified Diff: mojo/edk/system/incoming_endpoint.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/incoming_endpoint.h ('k') | mojo/edk/system/ipc_support_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/incoming_endpoint.cc
diff --git a/mojo/edk/system/incoming_endpoint.cc b/mojo/edk/system/incoming_endpoint.cc
index e8b88d19a6d3c14d9d4c418ecda09225dc305a4f..4fd8789ffe1e69dcc2cdebdbecedc3cf5b3a2cc1 100644
--- a/mojo/edk/system/incoming_endpoint.cc
+++ b/mojo/edk/system/incoming_endpoint.cc
@@ -16,39 +16,36 @@
namespace mojo {
namespace system {
-IncomingEndpoint::IncomingEndpoint() {
-}
-
RefPtr<ChannelEndpoint> IncomingEndpoint::Init() {
- endpoint_ = MakeRefCounted<ChannelEndpoint>(this, 0);
+ endpoint_ =
+ MakeRefCounted<ChannelEndpoint>(RefPtr<IncomingEndpoint>(this), 0);
return endpoint_;
}
-scoped_refptr<MessagePipe> IncomingEndpoint::ConvertToMessagePipe() {
+RefPtr<MessagePipe> IncomingEndpoint::ConvertToMessagePipe() {
MutexLocker locker(&mutex_);
- scoped_refptr<MessagePipe> message_pipe(
- MessagePipe::CreateLocalProxyFromExisting(&message_queue_,
- std::move(endpoint_)));
+ RefPtr<MessagePipe> message_pipe = MessagePipe::CreateLocalProxyFromExisting(
+ &message_queue_, std::move(endpoint_));
DCHECK(message_queue_.IsEmpty());
return message_pipe;
}
-scoped_refptr<DataPipe> IncomingEndpoint::ConvertToDataPipeProducer(
+RefPtr<DataPipe> IncomingEndpoint::ConvertToDataPipeProducer(
const MojoCreateDataPipeOptions& validated_options,
size_t consumer_num_bytes) {
MutexLocker locker(&mutex_);
- scoped_refptr<DataPipe> data_pipe(DataPipe::CreateRemoteConsumerFromExisting(
+ auto data_pipe = DataPipe::CreateRemoteConsumerFromExisting(
validated_options, consumer_num_bytes, &message_queue_,
- std::move(endpoint_)));
+ std::move(endpoint_));
DCHECK(message_queue_.IsEmpty());
return data_pipe;
}
-scoped_refptr<DataPipe> IncomingEndpoint::ConvertToDataPipeConsumer(
+RefPtr<DataPipe> IncomingEndpoint::ConvertToDataPipeConsumer(
const MojoCreateDataPipeOptions& validated_options) {
MutexLocker locker(&mutex_);
- scoped_refptr<DataPipe> data_pipe(DataPipe::CreateRemoteProducerFromExisting(
- validated_options, &message_queue_, std::move(endpoint_)));
+ auto data_pipe = DataPipe::CreateRemoteProducerFromExisting(
+ validated_options, &message_queue_, std::move(endpoint_));
DCHECK(message_queue_.IsEmpty());
return data_pipe;
}
@@ -75,8 +72,9 @@ void IncomingEndpoint::OnDetachFromChannel(unsigned /*port*/) {
Close();
}
-IncomingEndpoint::~IncomingEndpoint() {
-}
+IncomingEndpoint::IncomingEndpoint() {}
+
+IncomingEndpoint::~IncomingEndpoint() {}
} // namespace system
} // namespace mojo
« no previous file with comments | « mojo/edk/system/incoming_endpoint.h ('k') | mojo/edk/system/ipc_support_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698