OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/edk/system/channel_endpoint.h" | 5 #include "mojo/edk/system/channel_endpoint.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "mojo/edk/system/channel.h" | 8 #include "mojo/edk/system/channel.h" |
9 #include "mojo/edk/system/message_pipe.h" | 9 #include "mojo/edk/system/message_pipe.h" |
10 #include "mojo/edk/system/transport_data.h" | 10 #include "mojo/edk/system/transport_data.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 if (!message_pipe_.get()) { | 102 if (!message_pipe_.get()) { |
103 // This isn't a failure per se. (It just means that, e.g., the other end | 103 // This isn't a failure per se. (It just means that, e.g., the other end |
104 // of the message point closed first.) | 104 // of the message point closed first.) |
105 return true; | 105 return true; |
106 } | 106 } |
107 | 107 |
108 if (message_view.transport_data_buffer_size() > 0) { | 108 if (message_view.transport_data_buffer_size() > 0) { |
109 DCHECK(message_view.transport_data_buffer()); | 109 DCHECK(message_view.transport_data_buffer()); |
110 message->SetDispatchers(TransportData::DeserializeDispatchers( | 110 message->SetDispatchers(TransportData::DeserializeDispatchers( |
111 message_view.transport_data_buffer(), | 111 message_view.transport_data_buffer(), |
112 message_view.transport_data_buffer_size(), platform_handles.Pass(), | 112 message_view.transport_data_buffer_size(), |
| 113 platform_handles.Pass(), |
113 channel_)); | 114 channel_)); |
114 } | 115 } |
115 | 116 |
116 // Take a ref, and call |EnqueueMessage()| outside the lock. | 117 // Take a ref, and call |EnqueueMessage()| outside the lock. |
117 message_pipe = message_pipe_; | 118 message_pipe = message_pipe_; |
118 port = port_; | 119 port = port_; |
119 } | 120 } |
120 | 121 |
121 MojoResult result = message_pipe->EnqueueMessage( | 122 MojoResult result = message_pipe->EnqueueMessage( |
122 MessagePipe::GetPeerPort(port), message.Pass()); | 123 MessagePipe::GetPeerPort(port), message.Pass()); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 DCHECK(remote_id_.is_valid()); | 172 DCHECK(remote_id_.is_valid()); |
172 | 173 |
173 message->SerializeAndCloseDispatchers(channel_); | 174 message->SerializeAndCloseDispatchers(channel_); |
174 message->set_source_id(local_id_); | 175 message->set_source_id(local_id_); |
175 message->set_destination_id(remote_id_); | 176 message->set_destination_id(remote_id_); |
176 return channel_->WriteMessage(message.Pass()); | 177 return channel_->WriteMessage(message.Pass()); |
177 } | 178 } |
178 | 179 |
179 } // namespace system | 180 } // namespace system |
180 } // namespace mojo | 181 } // namespace mojo |
OLD | NEW |