Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Unified Diff: mojo/message_pump/message_pump_mojo.cc

Issue 1825553002: Properly "handle" MOJO_RESULT_BUSY in a few flaces. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/public/cpp/system/tests/core_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/message_pump/message_pump_mojo.cc
diff --git a/mojo/message_pump/message_pump_mojo.cc b/mojo/message_pump/message_pump_mojo.cc
index accd345f1c1f1b7dbba737764d9ac3508f92bf5d..471a0ad8332741702f947edc443e12cf78a0e3f0 100644
--- a/mojo/message_pump/message_pump_mojo.cc
+++ b/mojo/message_pump/message_pump_mojo.cc
@@ -205,7 +205,6 @@ bool MessagePumpMojo::DoInternalWork(const RunState& run_state, bool block) {
}
} else {
switch (result) {
- case MOJO_RESULT_CANCELLED:
case MOJO_RESULT_FAILED_PRECONDITION:
RemoveInvalidHandle(*run_state_->wait_state, result,
wait_many_result.index);
@@ -213,6 +212,11 @@ bool MessagePumpMojo::DoInternalWork(const RunState& run_state, bool block) {
case MOJO_RESULT_DEADLINE_EXCEEDED:
did_work = false;
break;
+ case MOJO_RESULT_INVALID_ARGUMENT:
+ case MOJO_RESULT_CANCELLED:
+ case MOJO_RESULT_BUSY:
+ // These results indicate a bug in "our" code (e.g., race conditions).
+ // Fall through.
default:
base::debug::Alias(&result);
// Unexpected result is likely fatal, crash so we can determine cause.
« no previous file with comments | « no previous file | mojo/public/cpp/system/tests/core_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698