Index: mojo/common/message_pump_mojo.cc |
diff --git a/mojo/common/message_pump_mojo.cc b/mojo/common/message_pump_mojo.cc |
index 734c71eabafd3289542b30993d51bb785327ac83..db11c4c3e28f1aad5a73d52f650d812c24fb63b9 100644 |
--- a/mojo/common/message_pump_mojo.cc |
+++ b/mojo/common/message_pump_mojo.cc |
@@ -154,8 +154,9 @@ void MessagePumpMojo::DoInternalWork(const RunState& run_state, bool block) { |
wait_state.handles[index]); |
} else { |
switch (result) { |
- case MOJO_RESULT_INVALID_ARGUMENT: |
+ case MOJO_RESULT_CANCELLED: |
case MOJO_RESULT_FAILED_PRECONDITION: |
+ case MOJO_RESULT_INVALID_ARGUMENT: |
RemoveFirstInvalidHandle(wait_state); |
break; |
case MOJO_RESULT_DEADLINE_EXCEEDED: |
@@ -187,7 +188,8 @@ void MessagePumpMojo::RemoveFirstInvalidHandle(const WaitState& wait_state) { |
const MojoResult result = |
Wait(wait_state.handles[i], wait_state.wait_flags[i], 0); |
if (result == MOJO_RESULT_INVALID_ARGUMENT || |
- result == MOJO_RESULT_FAILED_PRECONDITION) { |
+ result == MOJO_RESULT_FAILED_PRECONDITION || |
+ result == MOJO_RESULT_CANCELLED) { |
// Remove the handle first, this way if OnHandleError() tries to remove |
// the handle our iterator isn't invalidated. |
DCHECK(handlers_.find(wait_state.handles[i]) != handlers_.end()); |