| 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/public/cpp/bindings/lib/connector.h" | 5 #include "mojo/public/cpp/bindings/lib/connector.h" |
| 6 | 6 |
| 7 #include <assert.h> | 7 #include <assert.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 | 9 |
| 10 #include "mojo/public/cpp/bindings/error_handler.h" | 10 #include "mojo/public/cpp/bindings/error_handler.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } else { | 107 } else { |
| 108 error_ = true; | 108 error_ = true; |
| 109 } | 109 } |
| 110 | 110 |
| 111 if (error_ && error_handler_) | 111 if (error_ && error_handler_) |
| 112 error_handler_->OnConnectionError(); | 112 error_handler_->OnConnectionError(); |
| 113 } | 113 } |
| 114 | 114 |
| 115 void Connector::WaitToReadMore() { | 115 void Connector::WaitToReadMore() { |
| 116 async_wait_id_ = waiter_->AsyncWait(message_pipe_.get().value(), | 116 async_wait_id_ = waiter_->AsyncWait(message_pipe_.get().value(), |
| 117 MOJO_WAIT_FLAG_READABLE, | 117 MOJO_HANDLE_SIGNAL_READABLE, |
| 118 MOJO_DEADLINE_INDEFINITE, | 118 MOJO_DEADLINE_INDEFINITE, |
| 119 &Connector::CallOnHandleReady, | 119 &Connector::CallOnHandleReady, |
| 120 this); | 120 this); |
| 121 } | 121 } |
| 122 | 122 |
| 123 bool Connector::ReadMore() { | 123 bool Connector::ReadMore() { |
| 124 while (true) { | 124 while (true) { |
| 125 bool receiver_result = false; | 125 bool receiver_result = false; |
| 126 | 126 |
| 127 // Detect if |this| was destroyed during message dispatch. Allow for the | 127 // Detect if |this| was destroyed during message dispatch. Allow for the |
| (...skipping 20 matching lines...) Expand all Loading... |
| 148 (enforce_errors_from_incoming_receiver_ && !receiver_result)) { | 148 (enforce_errors_from_incoming_receiver_ && !receiver_result)) { |
| 149 error_ = true; | 149 error_ = true; |
| 150 break; | 150 break; |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 return true; | 153 return true; |
| 154 } | 154 } |
| 155 | 155 |
| 156 } // namespace internal | 156 } // namespace internal |
| 157 } // namespace mojo | 157 } // namespace mojo |
| OLD | NEW |