OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/public/cpp/bindings/lib/interface_endpoint_client.h" | 5 #include "mojo/public/cpp/bindings/lib/interface_endpoint_client.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 return false; | 154 return false; |
155 | 155 |
156 return handle_.router()->SendMessage(handle_, message); | 156 return handle_.router()->SendMessage(handle_, message); |
157 } | 157 } |
158 | 158 |
159 bool InterfaceEndpointClient::AcceptWithResponder(Message* message, | 159 bool InterfaceEndpointClient::AcceptWithResponder(Message* message, |
160 MessageReceiver* responder) { | 160 MessageReceiver* responder) { |
161 DCHECK(thread_checker_.CalledOnValidThread()); | 161 DCHECK(thread_checker_.CalledOnValidThread()); |
162 DCHECK(message->has_flag(kMessageExpectsResponse)); | 162 DCHECK(message->has_flag(kMessageExpectsResponse)); |
163 | 163 |
| 164 // TODO(yzshen): Sync method call using assoicated interfaces or master |
| 165 // interfaces that serve associated interfaces hasn't been supported yet. |
| 166 if (message->has_flag(kMessageIsSync)) { |
| 167 NOTIMPLEMENTED(); |
| 168 return false; |
| 169 } |
| 170 |
164 if (encountered_error_) | 171 if (encountered_error_) |
165 return false; | 172 return false; |
166 | 173 |
167 // Reserve 0 in case we want it to convey special meaning in the future. | 174 // Reserve 0 in case we want it to convey special meaning in the future. |
168 uint64_t request_id = next_request_id_++; | 175 uint64_t request_id = next_request_id_++; |
169 if (request_id == 0) | 176 if (request_id == 0) |
170 request_id = next_request_id_++; | 177 request_id = next_request_id_++; |
171 | 178 |
172 message->set_request_id(request_id); | 179 message->set_request_id(request_id); |
173 | 180 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 } else { | 227 } else { |
221 if (!incoming_receiver_) | 228 if (!incoming_receiver_) |
222 return false; | 229 return false; |
223 | 230 |
224 return incoming_receiver_->Accept(message); | 231 return incoming_receiver_->Accept(message); |
225 } | 232 } |
226 } | 233 } |
227 | 234 |
228 } // namespace internal | 235 } // namespace internal |
229 } // namespace mojo | 236 } // namespace mojo |
OLD | NEW |