Index: mojo/edk/system/proxy_message_pipe_endpoint.cc |
diff --git a/mojo/edk/system/proxy_message_pipe_endpoint.cc b/mojo/edk/system/proxy_message_pipe_endpoint.cc |
index 4a954d982bad83d544459e098b537b17ab8108a8..5f0f2e95353e88294a22425ef60b51f3be7624d0 100644 |
--- a/mojo/edk/system/proxy_message_pipe_endpoint.cc |
+++ b/mojo/edk/system/proxy_message_pipe_endpoint.cc |
@@ -20,7 +20,15 @@ ProxyMessagePipeEndpoint::ProxyMessagePipeEndpoint( |
} |
ProxyMessagePipeEndpoint::~ProxyMessagePipeEndpoint() { |
- DCHECK(!channel_endpoint_.get()); |
+ DCHECK(!channel_endpoint_); |
+} |
+ |
+scoped_refptr<ChannelEndpoint> |
+ProxyMessagePipeEndpoint::ReleaseChannelEndpoint() { |
+ DCHECK(channel_endpoint_); |
+ scoped_refptr<ChannelEndpoint> rv; |
+ rv.swap(channel_endpoint_); |
+ return rv; |
} |
MessagePipeEndpoint::Type ProxyMessagePipeEndpoint::GetType() const { |
@@ -37,7 +45,7 @@ bool ProxyMessagePipeEndpoint::OnPeerClose() { |
// This case is handled in |Run()| (which will call us). |
void ProxyMessagePipeEndpoint::EnqueueMessage( |
scoped_ptr<MessageInTransit> message) { |
- DCHECK(channel_endpoint_.get()); |
+ DCHECK(channel_endpoint_); |
LOG_IF(WARNING, !channel_endpoint_->EnqueueMessage(message.Pass())) |
<< "Failed to write enqueue message to channel"; |
} |
@@ -47,7 +55,7 @@ void ProxyMessagePipeEndpoint::Close() { |
} |
void ProxyMessagePipeEndpoint::DetachIfNecessary() { |
- if (channel_endpoint_.get()) { |
+ if (channel_endpoint_) { |
channel_endpoint_->DetachFromClient(); |
channel_endpoint_ = nullptr; |
} |