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

Unified Diff: mojo/common/message_pump_mojo.cc

Issue 276093002: Two fixes for mojo JS bindings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: alias Created 6 years, 7 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 | « mojo/bindings/js/waiting_callback.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f966519343ae3e813ece4e27b6df3b10b3bec912 100644
--- a/mojo/common/message_pump_mojo.cc
+++ b/mojo/common/message_pump_mojo.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include <vector>
+#include "base/debug/alias.h"
#include "base/logging.h"
#include "base/time/time.h"
#include "mojo/common/message_pump_mojo_handler.h"
@@ -154,14 +155,17 @@ 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:
break;
default:
- NOTREACHED();
+ base::debug::Alias(&result);
+ // Unexpected result is likely fatal, crash so we can determine cause.
+ CHECK(false);
}
}
@@ -187,7 +191,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());
« no previous file with comments | « mojo/bindings/js/waiting_callback.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698