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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 GetPeerPort(port), | 76 GetPeerPort(port), |
77 make_scoped_ptr(new MessageInTransit( | 77 make_scoped_ptr(new MessageInTransit( |
78 MessageInTransit::kTypeMessagePipeEndpoint, | 78 MessageInTransit::kTypeMessagePipeEndpoint, |
79 MessageInTransit::kSubtypeMessagePipeEndpointData, | 79 MessageInTransit::kSubtypeMessagePipeEndpointData, |
80 num_bytes, | 80 num_bytes, |
81 bytes)), | 81 bytes)), |
82 transports); | 82 transports); |
83 } | 83 } |
84 | 84 |
85 MojoResult MessagePipe::ReadMessage(unsigned port, | 85 MojoResult MessagePipe::ReadMessage(unsigned port, |
86 void* bytes, | 86 UserPointer<void> bytes, |
87 uint32_t* num_bytes, | 87 UserPointer<uint32_t> num_bytes, |
88 DispatcherVector* dispatchers, | 88 DispatcherVector* dispatchers, |
89 uint32_t* num_dispatchers, | 89 uint32_t* num_dispatchers, |
90 MojoReadMessageFlags flags) { | 90 MojoReadMessageFlags flags) { |
91 DCHECK(port == 0 || port == 1); | 91 DCHECK(port == 0 || port == 1); |
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); |
(...skipping 178 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 |