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

Unified Diff: mojo/edk/system/awakable.cc

Issue 2076263003: Plumb the handle signals state to Awakable::Awake(). (Closed) Base URL: https://github.com/domokit/mojo.git@work794_wait_set_4.2
Patch Set: Created 4 years, 6 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/edk/system/awakable.h ('k') | mojo/edk/system/awakable_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/awakable.cc
diff --git a/mojo/edk/system/awakable.cc b/mojo/edk/system/awakable.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f3d233639d96a97b6cac845d27306370400bf7b9
--- /dev/null
+++ b/mojo/edk/system/awakable.cc
@@ -0,0 +1,27 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/edk/system/awakable.h"
+
+#include "base/logging.h"
+
+namespace mojo {
+namespace system {
+
+// static
+MojoResult Awakable::MojoResultForAwakeReason(AwakeReason reason) {
+ switch (reason) {
+ case AwakeReason::SATISFIED:
+ return MOJO_RESULT_OK;
+ case AwakeReason::UNSATISFIABLE:
+ return MOJO_RESULT_FAILED_PRECONDITION;
+ case AwakeReason::CANCELLED:
+ return MOJO_RESULT_CANCELLED;
+ }
+ NOTREACHED();
+ return MOJO_RESULT_INTERNAL;
+}
+
+} // namespace system
+} // namespace mojo
« no previous file with comments | « mojo/edk/system/awakable.h ('k') | mojo/edk/system/awakable_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698