| 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 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 258 |
| 259 return payload_validator_->Accept(message); | 259 return payload_validator_->Accept(message); |
| 260 } | 260 } |
| 261 | 261 |
| 262 void InterfaceEndpointClient::NotifyError() { | 262 void InterfaceEndpointClient::NotifyError() { |
| 263 DCHECK(thread_checker_.CalledOnValidThread()); | 263 DCHECK(thread_checker_.CalledOnValidThread()); |
| 264 | 264 |
| 265 if (encountered_error_) | 265 if (encountered_error_) |
| 266 return; | 266 return; |
| 267 encountered_error_ = true; | 267 encountered_error_ = true; |
| 268 error_handler_.Run(); | 268 if (!error_handler_.is_null()) |
| 269 error_handler_.Run(); |
| 269 } | 270 } |
| 270 | 271 |
| 271 bool InterfaceEndpointClient::HandleValidatedMessage(Message* message) { | 272 bool InterfaceEndpointClient::HandleValidatedMessage(Message* message) { |
| 272 DCHECK_EQ(handle_.id(), message->interface_id()); | 273 DCHECK_EQ(handle_.id(), message->interface_id()); |
| 273 | 274 |
| 274 if (message->has_flag(kMessageExpectsResponse)) { | 275 if (message->has_flag(kMessageExpectsResponse)) { |
| 275 if (!incoming_receiver_) | 276 if (!incoming_receiver_) |
| 276 return false; | 277 return false; |
| 277 | 278 |
| 278 MessageReceiverWithStatus* responder = | 279 MessageReceiverWithStatus* responder = |
| (...skipping 24 matching lines...) Expand all Loading... |
| 303 } else { | 304 } else { |
| 304 if (!incoming_receiver_) | 305 if (!incoming_receiver_) |
| 305 return false; | 306 return false; |
| 306 | 307 |
| 307 return incoming_receiver_->Accept(message); | 308 return incoming_receiver_->Accept(message); |
| 308 } | 309 } |
| 309 } | 310 } |
| 310 | 311 |
| 311 } // namespace internal | 312 } // namespace internal |
| 312 } // namespace mojo | 313 } // namespace mojo |
| OLD | NEW |