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(), | 112 message_view.transport_data_buffer_size(), platform_handles.Pass(), |
113 platform_handles.Pass(), | |
114 channel_)); | 113 channel_)); |
115 } | 114 } |
116 | 115 |
117 // Take a ref, and call |EnqueueMessage()| outside the lock. | 116 // Take a ref, and call |EnqueueMessage()| outside the lock. |
118 message_pipe = message_pipe_; | 117 message_pipe = message_pipe_; |
119 port = port_; | 118 port = port_; |
120 } | 119 } |
121 | 120 |
122 MojoResult result = message_pipe->EnqueueMessage( | 121 MojoResult result = message_pipe->EnqueueMessage( |
123 MessagePipe::GetPeerPort(port), message.Pass()); | 122 MessagePipe::GetPeerPort(port), message.Pass()); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 DCHECK(remote_id_.is_valid()); | 171 DCHECK(remote_id_.is_valid()); |
173 | 172 |
174 message->SerializeAndCloseDispatchers(channel_); | 173 message->SerializeAndCloseDispatchers(channel_); |
175 message->set_source_id(local_id_); | 174 message->set_source_id(local_id_); |
176 message->set_destination_id(remote_id_); | 175 message->set_destination_id(remote_id_); |
177 return channel_->WriteMessage(message.Pass()); | 176 return channel_->WriteMessage(message.Pass()); |
178 } | 177 } |
179 | 178 |
180 } // namespace system | 179 } // namespace system |
181 } // namespace mojo | 180 } // namespace mojo |
OLD | NEW |