| 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.h" | 8 #include "mojo/system/channel.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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 base::AutoLock locker(lock_); | 93 base::AutoLock locker(lock_); |
| 94 DCHECK(endpoints_[port]); | 94 DCHECK(endpoints_[port]); |
| 95 | 95 |
| 96 return endpoints_[port]->ReadMessage(bytes, num_bytes, dispatchers, | 96 return endpoints_[port]->ReadMessage(bytes, num_bytes, dispatchers, |
| 97 num_dispatchers, flags); | 97 num_dispatchers, flags); |
| 98 } | 98 } |
| 99 | 99 |
| 100 MojoResult MessagePipe::AddWaiter(unsigned port, | 100 MojoResult MessagePipe::AddWaiter(unsigned port, |
| 101 Waiter* waiter, | 101 Waiter* waiter, |
| 102 MojoWaitFlags flags, | 102 MojoHandleSignals signals, |
| 103 uint32_t context) { | 103 uint32_t context) { |
| 104 DCHECK(port == 0 || port == 1); | 104 DCHECK(port == 0 || port == 1); |
| 105 | 105 |
| 106 base::AutoLock locker(lock_); | 106 base::AutoLock locker(lock_); |
| 107 DCHECK(endpoints_[port]); | 107 DCHECK(endpoints_[port]); |
| 108 | 108 |
| 109 return endpoints_[port]->AddWaiter(waiter, flags, context); | 109 return endpoints_[port]->AddWaiter(waiter, signals, context); |
| 110 } | 110 } |
| 111 | 111 |
| 112 void MessagePipe::RemoveWaiter(unsigned port, Waiter* waiter) { | 112 void MessagePipe::RemoveWaiter(unsigned port, Waiter* waiter) { |
| 113 DCHECK(port == 0 || port == 1); | 113 DCHECK(port == 0 || port == 1); |
| 114 | 114 |
| 115 base::AutoLock locker(lock_); | 115 base::AutoLock locker(lock_); |
| 116 DCHECK(endpoints_[port]); | 116 DCHECK(endpoints_[port]); |
| 117 | 117 |
| 118 endpoints_[port]->RemoveWaiter(waiter); | 118 endpoints_[port]->RemoveWaiter(waiter); |
| 119 } | 119 } |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 MojoResult MessagePipe::HandleControlMessage( | 276 MojoResult MessagePipe::HandleControlMessage( |
| 277 unsigned /*port*/, | 277 unsigned /*port*/, |
| 278 scoped_ptr<MessageInTransit> message) { | 278 scoped_ptr<MessageInTransit> message) { |
| 279 LOG(WARNING) << "Unrecognized MessagePipe control message subtype " | 279 LOG(WARNING) << "Unrecognized MessagePipe control message subtype " |
| 280 << message->subtype(); | 280 << message->subtype(); |
| 281 return MOJO_RESULT_UNKNOWN; | 281 return MOJO_RESULT_UNKNOWN; |
| 282 } | 282 } |
| 283 | 283 |
| 284 } // namespace system | 284 } // namespace system |
| 285 } // namespace mojo | 285 } // namespace mojo |
| OLD | NEW |