summaryrefslogtreecommitdiffstats
path: root/mojo/public/cpp/system/watcher.cc
diff options
context:
space:
mode:
Diffstat (limited to 'mojo/public/cpp/system/watcher.cc')
-rw-r--r--mojo/public/cpp/system/watcher.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/mojo/public/cpp/system/watcher.cc b/mojo/public/cpp/system/watcher.cc
index ad965ff..5723533 100644
--- a/mojo/public/cpp/system/watcher.cc
+++ b/mojo/public/cpp/system/watcher.cc
@@ -96,7 +96,9 @@ void Watcher::Cancel() {
MojoResult result =
MojoCancelWatch(handle_.value(), reinterpret_cast<uintptr_t>(this));
message_loop_observer_.reset();
- DCHECK_EQ(result, MOJO_RESULT_OK);
+ // |result| may be MOJO_RESULT_INVALID_ARGUMENT if |handle_| has closed, but
+ // OnHandleReady has not yet been called.
+ DCHECK(result == MOJO_RESULT_INVALID_ARGUMENT || result == MOJO_RESULT_OK);
handle_.set_value(kInvalidHandleValue);
callback_.Reset();
}