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/common/message_pump_mojo.h" | 5 #include "mojo/common/message_pump_mojo.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 if (!run_state_) | 177 if (!run_state_) |
178 return; | 178 return; |
179 | 179 |
180 // TODO(sky): deal with error? | 180 // TODO(sky): deal with error? |
181 MojoWriteMessage(run_state_->write_handle(), NULL, 0, NULL, 0, | 181 MojoWriteMessage(run_state_->write_handle(), NULL, 0, NULL, 0, |
182 MOJO_WRITE_MESSAGE_FLAG_NONE); | 182 MOJO_WRITE_MESSAGE_FLAG_NONE); |
183 } | 183 } |
184 | 184 |
185 MessagePumpMojo::WaitState MessagePumpMojo::GetWaitState() const { | 185 MessagePumpMojo::WaitState MessagePumpMojo::GetWaitState() const { |
186 WaitState wait_state; | 186 WaitState wait_state; |
187 wait_state.handles.push_back(run_state_->write_handle()); | 187 wait_state.handles.push_back(run_state_->read_handle()); |
188 wait_state.wait_flags.push_back(MOJO_WAIT_FLAG_READABLE); | 188 wait_state.wait_flags.push_back(MOJO_WAIT_FLAG_READABLE); |
189 | 189 |
190 for (HandleToHandler::const_iterator i = handlers_.begin(); | 190 for (HandleToHandler::const_iterator i = handlers_.begin(); |
191 i != handlers_.end(); ++i) { | 191 i != handlers_.end(); ++i) { |
192 wait_state.handles.push_back(i->first); | 192 wait_state.handles.push_back(i->first); |
193 wait_state.wait_flags.push_back(i->second.wait_flags); | 193 wait_state.wait_flags.push_back(i->second.wait_flags); |
194 } | 194 } |
195 return wait_state; | 195 return wait_state; |
196 } | 196 } |
197 | 197 |
198 } // namespace common | 198 } // namespace common |
199 } // namespace mojo | 199 } // namespace mojo |
OLD | NEW |