| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "mojo/system/message_pipe.h" | 5 #include "mojo/system/message_pipe.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "mojo/system/channel_endpoint.h" | 8 #include "mojo/system/channel_endpoint.h" |
| 9 #include "mojo/system/local_message_pipe_endpoint.h" | 9 #include "mojo/system/local_message_pipe_endpoint.h" |
| 10 #include "mojo/system/message_in_transit.h" | 10 #include "mojo/system/message_in_transit.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 channel_endpoint.get(), | 177 channel_endpoint.get(), |
| 178 static_cast<LocalMessagePipeEndpoint*>(endpoints_[port].get()), | 178 static_cast<LocalMessagePipeEndpoint*>(endpoints_[port].get()), |
| 179 is_peer_open)); | 179 is_peer_open)); |
| 180 endpoints_[port].swap(replacement_endpoint); | 180 endpoints_[port].swap(replacement_endpoint); |
| 181 | 181 |
| 182 return channel_endpoint; | 182 return channel_endpoint; |
| 183 } | 183 } |
| 184 | 184 |
| 185 MojoResult MessagePipe::EnqueueMessage(unsigned port, | 185 MojoResult MessagePipe::EnqueueMessage(unsigned port, |
| 186 scoped_ptr<MessageInTransit> message) { | 186 scoped_ptr<MessageInTransit> message) { |
| 187 return EnqueueMessageInternal(port, message.Pass(), NULL); | 187 return EnqueueMessageInternal(port, message.Pass(), nullptr); |
| 188 } | 188 } |
| 189 | 189 |
| 190 bool MessagePipe::Attach(unsigned port, ChannelEndpoint* channel_endpoint) { | 190 bool MessagePipe::Attach(unsigned port, ChannelEndpoint* channel_endpoint) { |
| 191 DCHECK(port == 0 || port == 1); | 191 DCHECK(port == 0 || port == 1); |
| 192 DCHECK(channel_endpoint); | 192 DCHECK(channel_endpoint); |
| 193 | 193 |
| 194 base::AutoLock locker(lock_); | 194 base::AutoLock locker(lock_); |
| 195 if (!endpoints_[port]) | 195 if (!endpoints_[port]) |
| 196 return false; | 196 return false; |
| 197 | 197 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 MojoResult MessagePipe::HandleControlMessage( | 314 MojoResult MessagePipe::HandleControlMessage( |
| 315 unsigned /*port*/, | 315 unsigned /*port*/, |
| 316 scoped_ptr<MessageInTransit> message) { | 316 scoped_ptr<MessageInTransit> message) { |
| 317 LOG(WARNING) << "Unrecognized MessagePipe control message subtype " | 317 LOG(WARNING) << "Unrecognized MessagePipe control message subtype " |
| 318 << message->subtype(); | 318 << message->subtype(); |
| 319 return MOJO_RESULT_UNKNOWN; | 319 return MOJO_RESULT_UNKNOWN; |
| 320 } | 320 } |
| 321 | 321 |
| 322 } // namespace system | 322 } // namespace system |
| 323 } // namespace mojo | 323 } // namespace mojo |
| OLD | NEW |