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 MOJO_WAIT_FLAG_READABLE, | 107 MOJO_WAIT_FLAG_READABLE, |
108 MOJO_DEADLINE_INDEFINITE, | 108 MOJO_DEADLINE_INDEFINITE, |
109 &Connector::CallOnHandleReady, | 109 &Connector::CallOnHandleReady, |
110 this); | 110 this); |
111 } | 111 } |
112 | 112 |
113 void Connector::ReadMore() { | 113 void Connector::ReadMore() { |
114 while (true) { | 114 while (true) { |
115 MojoResult rv; | 115 MojoResult rv; |
116 | 116 |
117 rv = ReadAndDispatchMessage(message_pipe_.get(), incoming_receiver_, NULL); | 117 bool receiver_result; |
| 118 rv = ReadAndDispatchMessage(message_pipe_.get(), incoming_receiver_, |
| 119 &receiver_result); |
118 if (rv == MOJO_RESULT_SHOULD_WAIT) { | 120 if (rv == MOJO_RESULT_SHOULD_WAIT) { |
119 WaitToReadMore(); | 121 WaitToReadMore(); |
120 break; | 122 break; |
121 } | 123 } |
122 if (rv != MOJO_RESULT_OK) { | 124 if (rv != MOJO_RESULT_OK || !receiver_result) { |
123 error_ = true; | 125 error_ = true; |
124 break; | 126 break; |
125 } | 127 } |
126 } | 128 } |
127 } | 129 } |
128 | 130 |
129 } // namespace internal | 131 } // namespace internal |
130 } // namespace mojo | 132 } // namespace mojo |
OLD | NEW |