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

Unified Diff: mojo/system/entrypoints.cc

Issue 454603002: Mojo: Plumb new Wait/WaitMany API out to Core. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 4 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/system/core_unittest.cc ('k') | mojo/system/memory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/entrypoints.cc
diff --git a/mojo/system/entrypoints.cc b/mojo/system/entrypoints.cc
index fc4bdc6933013624b52832ef8850dfdbeac37e05..32c7235ed2519f91e4fa56de9df0e1d8faec2085 100644
--- a/mojo/system/entrypoints.cc
+++ b/mojo/system/entrypoints.cc
@@ -4,6 +4,7 @@
#include "mojo/system/entrypoints.h"
+#include "base/logging.h"
#include "mojo/public/c/system/buffer.h"
#include "mojo/public/c/system/data_pipe.h"
#include "mojo/public/c/system/functions.h"
@@ -43,17 +44,23 @@ MojoResult MojoClose(MojoHandle handle) {
MojoResult MojoWait(MojoHandle handle,
MojoHandleSignals signals,
MojoDeadline deadline) {
- return g_core->Wait(handle, signals, deadline);
+ return g_core->Wait(
+ handle, signals, deadline, mojo::system::NullUserPointer());
}
MojoResult MojoWaitMany(const MojoHandle* handles,
const MojoHandleSignals* signals,
uint32_t num_handles,
MojoDeadline deadline) {
- return g_core->WaitMany(MakeUserPointer(handles),
- MakeUserPointer(signals),
- num_handles,
- deadline);
+ uint32_t result_index = static_cast<uint32_t>(-1);
+ MojoResult result = g_core->WaitMany(MakeUserPointer(handles),
+ MakeUserPointer(signals),
+ num_handles,
+ deadline,
+ MakeUserPointer(&result_index),
+ mojo::system::NullUserPointer());
+ return (result == MOJO_RESULT_OK) ? static_cast<MojoResult>(result_index)
+ : result;
}
MojoResult MojoCreateMessagePipe(const MojoCreateMessagePipeOptions* options,
« no previous file with comments | « mojo/system/core_unittest.cc ('k') | mojo/system/memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698