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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 message_pipe_.get().value(), | 111 message_pipe_.get().value(), |
112 MOJO_WAIT_FLAG_READABLE, | 112 MOJO_WAIT_FLAG_READABLE, |
113 MOJO_DEADLINE_INDEFINITE, | 113 MOJO_DEADLINE_INDEFINITE, |
114 &Connector::CallOnHandleReady, | 114 &Connector::CallOnHandleReady, |
115 this); | 115 this); |
116 } | 116 } |
117 | 117 |
118 void Connector::ReadMore() { | 118 void Connector::ReadMore() { |
119 while (true) { | 119 while (true) { |
120 bool receiver_result = false; | 120 bool receiver_result = false; |
121 MojoResult rv = ReadAndDispatchMessage( | 121 MojoResult rv = ReadAndDispatchMessage( |
122 message_pipe_.get(), incoming_receiver_, &receiver_result); | 122 message_pipe_.get(), incoming_receiver_, &receiver_result); |
123 if (rv == MOJO_RESULT_SHOULD_WAIT) { | 123 if (rv == MOJO_RESULT_SHOULD_WAIT) { |
124 WaitToReadMore(); | 124 WaitToReadMore(); |
125 break; | 125 break; |
126 } | 126 } |
127 if (rv != MOJO_RESULT_OK || | 127 if (rv != MOJO_RESULT_OK || |
128 (enforce_errors_from_incoming_receiver_ && !receiver_result)) { | 128 (enforce_errors_from_incoming_receiver_ && !receiver_result)) { |
129 error_ = true; | 129 error_ = true; |
130 break; | 130 break; |
131 } | 131 } |
132 } | 132 } |
133 } | 133 } |
134 | 134 |
135 } // namespace internal | 135 } // namespace internal |
136 } // namespace mojo | 136 } // namespace mojo |
OLD | NEW |