Add mojo/c/system/{time.h,wait.h}.
time.h contains the types (previously in types.h) and
MojoGetTimeTicks() (previously in functions.h).
wait.h contains MojoWait() and MojoWaitMany() (previously in
functions.h).
handle.h gets MojoClose() (previously in functions.h).
Removal of types.h and functions.h will be done separately.
R=jamesr@chromium.org
Review URL: https://codereview.chromium.org/1783623005 .
diff --git a/examples/tiny/tiny.c b/examples/tiny/tiny.c
index 2680b6f..e8638dc 100644
--- a/examples/tiny/tiny.c
+++ b/examples/tiny/tiny.c
@@ -4,7 +4,6 @@
#include "mojo/public/c/system/main.h"
#include "mojo/public/c/system/handle.h"
-#include "mojo/public/c/system/functions.h"
#include "mojo/public/c/system/result.h"
MojoResult MojoMain(MojoHandle app_request) {
diff --git a/mojo/android/system/core_impl.cc b/mojo/android/system/core_impl.cc
index a85ffcb..d44f124 100644
--- a/mojo/android/system/core_impl.cc
+++ b/mojo/android/system/core_impl.cc
@@ -16,10 +16,11 @@
#include "mojo/public/c/environment/async_waiter.h"
#include "mojo/public/c/system/buffer.h"
#include "mojo/public/c/system/data_pipe.h"
-#include "mojo/public/c/system/functions.h"
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/message_pipe.h"
#include "mojo/public/c/system/result.h"
+#include "mojo/public/c/system/time.h"
+#include "mojo/public/c/system/wait.h"
#include "mojo/public/cpp/environment/environment.h"
namespace {
diff --git a/mojo/edk/embedder/entrypoints.cc b/mojo/edk/embedder/entrypoints.cc
index b6205ce..7ee0c9e 100644
--- a/mojo/edk/embedder/entrypoints.cc
+++ b/mojo/edk/embedder/entrypoints.cc
@@ -6,8 +6,10 @@
#include "mojo/edk/system/core.h"
#include "mojo/public/c/system/buffer.h"
#include "mojo/public/c/system/data_pipe.h"
-#include "mojo/public/c/system/functions.h"
+#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/message_pipe.h"
+#include "mojo/public/c/system/time.h"
+#include "mojo/public/c/system/wait.h"
using mojo::embedder::internal::g_core;
using mojo::system::MakeUserPointer;
@@ -24,9 +26,9 @@
}
MojoResult MojoWait(MojoHandle handle,
- MojoHandleSignals signals,
- MojoDeadline deadline,
- MojoHandleSignalsState* signals_state) {
+ MojoHandleSignals signals,
+ MojoDeadline deadline,
+ MojoHandleSignalsState* signals_state) {
return g_core->Wait(handle, signals, deadline,
MakeUserPointer(signals_state));
}
diff --git a/mojo/edk/embedder/multiprocess_embedder_unittest.cc b/mojo/edk/embedder/multiprocess_embedder_unittest.cc
index 3b860d1..5650a9d 100644
--- a/mojo/edk/embedder/multiprocess_embedder_unittest.cc
+++ b/mojo/edk/embedder/multiprocess_embedder_unittest.cc
@@ -19,8 +19,9 @@
#include "mojo/edk/util/command_line.h"
#include "mojo/edk/util/ref_ptr.h"
#include "mojo/edk/util/waitable_event.h"
-#include "mojo/public/c/system/functions.h"
#include "mojo/public/c/system/handle.h"
+#include "mojo/public/c/system/time.h"
+#include "mojo/public/c/system/wait.h"
#include "mojo/public/cpp/system/handle.h"
#include "mojo/public/cpp/system/macros.h"
#include "mojo/public/cpp/system/message_pipe.h"
diff --git a/mojo/edk/embedder/system_impl_private_entrypoints.cc b/mojo/edk/embedder/system_impl_private_entrypoints.cc
index 3a159ab..2e6d380 100644
--- a/mojo/edk/embedder/system_impl_private_entrypoints.cc
+++ b/mojo/edk/embedder/system_impl_private_entrypoints.cc
@@ -9,8 +9,11 @@
#include "mojo/edk/util/ref_ptr.h"
#include "mojo/public/c/system/buffer.h"
#include "mojo/public/c/system/data_pipe.h"
-#include "mojo/public/c/system/functions.h"
+#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/message_pipe.h"
+#include "mojo/public/c/system/result.h"
+#include "mojo/public/c/system/time.h"
+#include "mojo/public/c/system/wait.h"
#include "mojo/public/platform/native/system_impl_private.h"
using mojo::embedder::internal::g_core;
diff --git a/mojo/edk/platform/test_stopwatch.h b/mojo/edk/platform/test_stopwatch.h
index 5a24c9d..ed461eb 100644
--- a/mojo/edk/platform/test_stopwatch.h
+++ b/mojo/edk/platform/test_stopwatch.h
@@ -7,7 +7,7 @@
#ifndef MOJO_EDK_PLATFORM_TEST_STOPWATCH_H_
#define MOJO_EDK_PLATFORM_TEST_STOPWATCH_H_
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
#include "mojo/public/cpp/system/macros.h"
namespace mojo {
diff --git a/mojo/edk/platform/thread_utils.h b/mojo/edk/platform/thread_utils.h
index 0336b86..85884c1 100644
--- a/mojo/edk/platform/thread_utils.h
+++ b/mojo/edk/platform/thread_utils.h
@@ -5,7 +5,7 @@
#ifndef MOJO_EDK_PLATFORM_THREAD_UTILS_H_
#define MOJO_EDK_PLATFORM_THREAD_UTILS_H_
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
namespace mojo {
namespace platform {
diff --git a/mojo/edk/platform/time_ticks.h b/mojo/edk/platform/time_ticks.h
index 0299ee1..73d702d 100644
--- a/mojo/edk/platform/time_ticks.h
+++ b/mojo/edk/platform/time_ticks.h
@@ -5,7 +5,7 @@
#ifndef MOJO_EDK_PLATFORM_TIME_TICKS_H_
#define MOJO_EDK_PLATFORM_TIME_TICKS_H_
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
namespace mojo {
namespace platform {
diff --git a/mojo/edk/system/core.h b/mojo/edk/system/core.h
index f1ce192..1f4abe5 100644
--- a/mojo/edk/system/core.h
+++ b/mojo/edk/system/core.h
@@ -20,7 +20,7 @@
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/message_pipe.h"
#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
#include "mojo/public/cpp/system/macros.h"
namespace mojo {
@@ -83,10 +83,17 @@
// of these methods is to look at the header files defining the corresponding
// API functions, referenced below.
- // These methods correspond to the API functions defined in
- // "mojo/public/c/system/functions.h":
+ // This method corresponds to the API function defined in
+ // "mojo/public/c/system/time.h":
+
MojoTimeTicks GetTimeTicksNow();
+
+ // This method corresponds to the API function defined in
+ // "mojo/public/c/system/handle.h":
MojoResult Close(MojoHandle handle);
+
+ // These methods correspond to the API functions defined in
+ // "mojo/public/c/system/wait.h":
MojoResult Wait(MojoHandle handle,
MojoHandleSignals signals,
MojoDeadline deadline,
diff --git a/mojo/edk/system/test/timeouts.h b/mojo/edk/system/test/timeouts.h
index aa69ec2..8cfd5a3 100644
--- a/mojo/edk/system/test/timeouts.h
+++ b/mojo/edk/system/test/timeouts.h
@@ -7,7 +7,7 @@
#ifndef MOJO_EDK_SYSTEM_TEST_TIMEOUTS_H_
#define MOJO_EDK_SYSTEM_TEST_TIMEOUTS_H_
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
namespace mojo {
namespace system {
diff --git a/mojo/edk/system/waiter.h b/mojo/edk/system/waiter.h
index 9c56fc7..e0bcf47 100644
--- a/mojo/edk/system/waiter.h
+++ b/mojo/edk/system/waiter.h
@@ -12,7 +12,7 @@
#include "mojo/edk/util/mutex.h"
#include "mojo/edk/util/thread_annotations.h"
#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
#include "mojo/public/cpp/system/macros.h"
namespace mojo {
diff --git a/mojo/edk/system/waiter_test_utils.h b/mojo/edk/system/waiter_test_utils.h
index 1a24f20..13bc760 100644
--- a/mojo/edk/system/waiter_test_utils.h
+++ b/mojo/edk/system/waiter_test_utils.h
@@ -14,7 +14,7 @@
#include "mojo/edk/util/ref_ptr.h"
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
#include "mojo/public/cpp/system/macros.h"
namespace mojo {
diff --git a/mojo/nacl/nonsfi/irt_mojo_nonsfi.cc b/mojo/nacl/nonsfi/irt_mojo_nonsfi.cc
index 95dfd02..4f184d7 100644
--- a/mojo/nacl/nonsfi/irt_mojo_nonsfi.cc
+++ b/mojo/nacl/nonsfi/irt_mojo_nonsfi.cc
@@ -4,7 +4,12 @@
#include "mojo/nacl/nonsfi/irt_mojo_nonsfi.h"
-#include "mojo/public/c/system/functions.h"
+#include "mojo/public/c/system/buffer.h"
+#include "mojo/public/c/system/data_pipe.h"
+#include "mojo/public/c/system/handle.h"
+#include "mojo/public/c/system/message_pipe.h"
+#include "mojo/public/c/system/time.h"
+#include "mojo/public/c/system/wait.h"
#include "mojo/public/platform/nacl/mgl_irt.h"
#include "mojo/public/platform/nacl/mojo_irt.h"
#include "native_client/src/public/irt_core.h"
diff --git a/mojo/nacl/nonsfi/irt_mojo_nonsfi.h b/mojo/nacl/nonsfi/irt_mojo_nonsfi.h
index e2d7b91..1355813 100644
--- a/mojo/nacl/nonsfi/irt_mojo_nonsfi.h
+++ b/mojo/nacl/nonsfi/irt_mojo_nonsfi.h
@@ -5,7 +5,8 @@
#ifndef MOJO_NACL_NONSFI_IRT_MOJO_NONSFI_H_
#define MOJO_NACL_NONSFI_IRT_MOJO_NONSFI_H_
-#include "mojo/public/c/system/functions.h"
+#include "mojo/public/c/system/handle.h"
+#include "mojo/public/c/system/result.h"
#include "native_client/src/untrusted/irt/irt_dev.h"
namespace nacl {
diff --git a/mojo/nacl/sfi/nacl_bindings/mojo_syscall.cc b/mojo/nacl/sfi/nacl_bindings/mojo_syscall.cc
index 09824d3..b31a478 100644
--- a/mojo/nacl/sfi/nacl_bindings/mojo_syscall.cc
+++ b/mojo/nacl/sfi/nacl_bindings/mojo_syscall.cc
@@ -15,7 +15,7 @@
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/message_pipe.h"
#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
#include "mojo/public/platform/native/system_impl_private.h"
#include "native_client/src/public/chrome_main.h"
#include "native_client/src/public/nacl_app.h"
diff --git a/mojo/nacl/sfi/nacl_bindings_generator/libmojo.cc.tmpl b/mojo/nacl/sfi/nacl_bindings_generator/libmojo.cc.tmpl
index eea9862..ee717ab 100644
--- a/mojo/nacl/sfi/nacl_bindings_generator/libmojo.cc.tmpl
+++ b/mojo/nacl/sfi/nacl_bindings_generator/libmojo.cc.tmpl
@@ -8,11 +8,11 @@
#include "mojo/public/c/system/buffer.h"
#include "mojo/public/c/system/data_pipe.h"
-#include "mojo/public/c/system/functions.h"
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/message_pipe.h"
#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
+#include "mojo/public/c/system/wait.h"
#include "{{platform_dir}}/mojo_irt.h"
#include "native_client/src/untrusted/irt/irt.h"
diff --git a/mojo/nacl/sfi/nacl_bindings_generator/mojo_irt.h.tmpl b/mojo/nacl/sfi/nacl_bindings_generator/mojo_irt.h.tmpl
index d23e73c..34b799c 100644
--- a/mojo/nacl/sfi/nacl_bindings_generator/mojo_irt.h.tmpl
+++ b/mojo/nacl/sfi/nacl_bindings_generator/mojo_irt.h.tmpl
@@ -12,7 +12,7 @@
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/message_pipe.h"
#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
#define NACL_IRT_MOJO_v0_1 "nacl-irt-mojo-0.1"
diff --git a/mojo/nacl/sfi/nacl_bindings_generator/mojo_syscall.cc.tmpl b/mojo/nacl/sfi/nacl_bindings_generator/mojo_syscall.cc.tmpl
index 7803b72..950e535 100644
--- a/mojo/nacl/sfi/nacl_bindings_generator/mojo_syscall.cc.tmpl
+++ b/mojo/nacl/sfi/nacl_bindings_generator/mojo_syscall.cc.tmpl
@@ -14,7 +14,7 @@
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/message_pipe.h"
#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
#include "mojo/public/platform/native/system_impl_private.h"
#include "native_client/src/public/chrome_main.h"
#include "native_client/src/public/nacl_app.h"
diff --git a/mojo/public/c/environment/async_waiter.h b/mojo/public/c/environment/async_waiter.h
index a5cde70..c414773 100644
--- a/mojo/public/c/environment/async_waiter.h
+++ b/mojo/public/c/environment/async_waiter.h
@@ -7,7 +7,7 @@
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
typedef uintptr_t MojoAsyncWaitID;
diff --git a/mojo/public/c/system/BUILD.gn b/mojo/public/c/system/BUILD.gn
index db88348..0e728f5 100644
--- a/mojo/public/c/system/BUILD.gn
+++ b/mojo/public/c/system/BUILD.gn
@@ -17,6 +17,8 @@
"macros.h",
"message_pipe.h",
"result.h",
+ "time.h",
"types.h",
+ "wait.h",
]
}
diff --git a/mojo/public/c/system/core.h b/mojo/public/c/system/core.h
index 6e2674f..186b6da 100644
--- a/mojo/public/c/system/core.h
+++ b/mojo/public/c/system/core.h
@@ -6,8 +6,6 @@
//
// TODO(vtl): Delete this header file.
//
-// This is a catch-all header that includes everything.
-//
// Note: This header should be compilable as C.
#ifndef MOJO_PUBLIC_C_SYSTEM_CORE_H_
@@ -15,12 +13,12 @@
#include "mojo/public/c/system/buffer.h"
#include "mojo/public/c/system/data_pipe.h"
-#include "mojo/public/c/system/functions.h"
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/macros.h"
#include "mojo/public/c/system/main.h"
#include "mojo/public/c/system/message_pipe.h"
#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
+#include "mojo/public/c/system/wait.h"
#endif // MOJO_PUBLIC_C_SYSTEM_CORE_H_
diff --git a/mojo/public/c/system/functions.h b/mojo/public/c/system/functions.h
index 3482c5d..2c62392 100644
--- a/mojo/public/c/system/functions.h
+++ b/mojo/public/c/system/functions.h
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// This file contains basic functions common to different Mojo system APIs.
+// DEPRECATED -- do not use: include individual header files instead.
+//
+// TODO(vtl): Delete this header file.
//
// Note: This header should be compilable as C.
@@ -10,126 +12,7 @@
#define MOJO_PUBLIC_C_SYSTEM_FUNCTIONS_H_
#include "mojo/public/c/system/handle.h"
-#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Note: Pointer parameters that are labelled "optional" may be null (at least
-// under some circumstances). Non-const pointer parameters are also labeled
-// "in", "out", or "in/out", to indicate how they are used. (Note that how/if
-// such a parameter is used may depend on other parameters or the requested
-// operation's success/failure. E.g., a separate |flags| parameter may control
-// whether a given "in/out" parameter is used for input, output, or both.)
-
-// Returns the time, in microseconds, since some undefined point in the past.
-// The values are only meaningful relative to other values that were obtained
-// from the same device without an intervening system restart. Such values are
-// guaranteed to be monotonically non-decreasing with the passage of real time.
-// Although the units are microseconds, the resolution of the clock may vary and
-// is typically in the range of ~1-15 ms.
-MojoTimeTicks MojoGetTimeTicksNow(void);
-
-// Closes the given |handle|.
-//
-// Returns:
-// |MOJO_RESULT_OK| on success.
-// |MOJO_RESULT_INVALID_ARGUMENT| if |handle| is not a valid handle.
-//
-// Concurrent operations on |handle| may succeed (or fail as usual) if they
-// happen before the close, be cancelled with result |MOJO_RESULT_CANCELLED| if
-// they properly overlap (this is likely the case with |MojoWait()|, etc.), or
-// fail with |MOJO_RESULT_INVALID_ARGUMENT| if they happen after.
-MojoResult MojoClose(MojoHandle handle);
-
-// Waits on the given handle until one of the following happens:
-// - A signal indicated by |signals| is satisfied.
-// - It becomes known that no signal indicated by |signals| will ever be
-// satisfied. (See the description of the |MOJO_RESULT_CANCELLED| and
-// |MOJO_RESULT_FAILED_PRECONDITION| return values below.)
-// - Until |deadline| has passed.
-//
-// If |deadline| is |MOJO_DEADLINE_INDEFINITE|, this will wait "forever" (until
-// one of the other wait termination conditions is satisfied). If |deadline| is
-// 0, this will return |MOJO_RESULT_DEADLINE_EXCEEDED| only if one of the other
-// termination conditions (e.g., a signal is satisfied, or all signals are
-// unsatisfiable) is not already satisfied.
-//
-// |signals_state| (optional): See documentation for |MojoHandleSignalsState|.
-//
-// Returns:
-// |MOJO_RESULT_OK| if some signal in |signals| was satisfied (or is already
-// satisfied).
-// |MOJO_RESULT_CANCELLED| if |handle| was closed (necessarily from another
-// thread) during the wait.
-// |MOJO_RESULT_INVALID_ARGUMENT| if |handle| is not a valid handle (e.g., if
-// it has already been closed). The |signals_state| value is unchanged.
-// |MOJO_RESULT_DEADLINE_EXCEEDED| if the deadline has passed without any of
-// the signals being satisfied.
-// |MOJO_RESULT_FAILED_PRECONDITION| if it becomes known that none of the
-// signals in |signals| can ever be satisfied (e.g., when waiting on one
-// end of a message pipe and the other end is closed).
-//
-// If there are multiple waiters (on different threads, obviously) waiting on
-// the same handle and signal, and that signal becomes satisfied, all waiters
-// will be awoken.
-MojoResult MojoWait(
- MojoHandle handle,
- MojoHandleSignals signals,
- MojoDeadline deadline,
- struct MojoHandleSignalsState* signals_state); // Optional out.
-
-// Waits on |handles[0]|, ..., |handles[num_handles-1]| until:
-// - (At least) one handle satisfies a signal indicated in its respective
-// |signals[0]|, ..., |signals[num_handles-1]|.
-// - It becomes known that no signal in some |signals[i]| will ever be
-// satisfied.
-// - |deadline| has passed.
-//
-// This means that |MojoWaitMany()| behaves as if |MojoWait()| were called on
-// each handle/signals pair simultaneously, completing when the first
-// |MojoWait()| would complete.
-//
-// See |MojoWait()| for more details about |deadline|.
-//
-// |result_index| (optional) is used to return the index of the handle that
-// caused the call to return. For example, the index |i| (from 0 to
-// |num_handles-1|) if |handle[i]| satisfies a signal from |signals[i]|. You
-// must manually initialize this to a suitable sentinel value (e.g. -1)
-// before you make this call because this value is not updated if there is
-// no specific handle that causes the function to return. Pass null if you
-// don't need this value to be returned.
-//
-// |signals_states| (optional) points to an array of size |num_handles| of
-// MojoHandleSignalsState. See |MojoHandleSignalsState| for more details
-// about the meaning of each array entry. This array is not an atomic
-// snapshot. The array will be updated if the function does not return
-// |MOJO_RESULT_INVALID_ARGUMENT| or |MOJO_RESULT_RESOURCE_EXHAUSTED|.
-//
-// Returns:
-// |MOJO_RESULT_CANCELLED| if some |handle[i]| was closed (necessarily from
-// another thread) during the wait.
-// |MOJO_RESULT_RESOURCE_EXHAUSTED| if there are too many handles. The
-// |signals_state| array is unchanged.
-// |MOJO_RESULT_INVALID_ARGUMENT| if some |handle[i]| is not a valid handle
-// (e.g., if it is zero or if it has already been closed). The
-// |signals_state| array is unchanged.
-// |MOJO_RESULT_DEADLINE_EXCEEDED| if the deadline has passed without any of
-// handles satisfying any of its signals.
-// |MOJO_RESULT_FAILED_PRECONDITION| if it is or becomes impossible that SOME
-// |handle[i]| will ever satisfy any of the signals in |signals[i]|.
-MojoResult MojoWaitMany(
- const MojoHandle* handles,
- const MojoHandleSignals* signals,
- uint32_t num_handles,
- MojoDeadline deadline,
- uint32_t* result_index, // Optional out
- struct MojoHandleSignalsState* signals_states); // Optional out
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+#include "mojo/public/c/system/time.h"
+#include "mojo/public/c/system/wait.h"
#endif // MOJO_PUBLIC_C_SYSTEM_FUNCTIONS_H_
diff --git a/mojo/public/c/system/handle.h b/mojo/public/c/system/handle.h
index 73a7ed8..2751886 100644
--- a/mojo/public/c/system/handle.h
+++ b/mojo/public/c/system/handle.h
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// This file contains the handle-related definitions/declarations.
+// This file contains Mojo system handle-related declarations/definitions.
//
// Note: This header should be compilable as C.
@@ -12,6 +12,7 @@
#include <stdint.h>
#include "mojo/public/c/system/macros.h"
+#include "mojo/public/c/system/result.h"
// |MojoHandle|: Handles to Mojo objects.
// |MOJO_HANDLE_INVALID| - A value that is never a valid handle.
@@ -54,4 +55,24 @@
MOJO_STATIC_ASSERT(sizeof(MojoHandleSignalsState) == 8,
"MojoHandleSignalsState has wrong size");
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Closes the given |handle|.
+//
+// Returns:
+// |MOJO_RESULT_OK| on success.
+// |MOJO_RESULT_INVALID_ARGUMENT| if |handle| is not a valid handle.
+//
+// Concurrent operations on |handle| may succeed (or fail as usual) if they
+// happen before the close, be cancelled with result |MOJO_RESULT_CANCELLED| if
+// they properly overlap (this is likely the case with |MojoWait()|, etc.), or
+// fail with |MOJO_RESULT_INVALID_ARGUMENT| if they happen after.
+MojoResult MojoClose(MojoHandle handle);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // MOJO_PUBLIC_C_SYSTEM_HANDLE_H_
diff --git a/mojo/public/c/system/tests/core_perftest.cc b/mojo/public/c/system/tests/core_perftest.cc
index fd7df02..dff6fa7 100644
--- a/mojo/public/c/system/tests/core_perftest.cc
+++ b/mojo/public/c/system/tests/core_perftest.cc
@@ -12,11 +12,11 @@
#include <functional>
#include <thread>
-#include "mojo/public/c/system/functions.h"
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/message_pipe.h"
#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
+#include "mojo/public/c/system/wait.h"
#include "mojo/public/cpp/system/macros.h"
#include "mojo/public/cpp/test_support/test_support.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/mojo/public/c/system/tests/core_unittest.cc b/mojo/public/c/system/tests/core_unittest.cc
index 99dffa8..f528b3f 100644
--- a/mojo/public/c/system/tests/core_unittest.cc
+++ b/mojo/public/c/system/tests/core_unittest.cc
@@ -8,11 +8,11 @@
#include "mojo/public/c/system/buffer.h"
#include "mojo/public/c/system/data_pipe.h"
-#include "mojo/public/c/system/functions.h"
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/message_pipe.h"
#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
+#include "mojo/public/c/system/wait.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
diff --git a/mojo/public/c/system/tests/core_unittest_pure_c.c b/mojo/public/c/system/tests/core_unittest_pure_c.c
index a1a4519..d9e290d 100644
--- a/mojo/public/c/system/tests/core_unittest_pure_c.c
+++ b/mojo/public/c/system/tests/core_unittest_pure_c.c
@@ -12,12 +12,12 @@
// Include all the header files that are meant to be compilable as C. Start with
// core.h, since it's the most important one.
#include "mojo/public/c/environment/async_waiter.h"
-#include "mojo/public/c/system/functions.h"
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/macros.h"
#include "mojo/public/c/system/message_pipe.h"
#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
+#include "mojo/public/c/system/wait.h"
// The joys of the C preprocessor....
#define STRINGIFY(x) #x
diff --git a/mojo/public/c/system/time.h b/mojo/public/c/system/time.h
new file mode 100644
index 0000000..3bb4a89
--- /dev/null
+++ b/mojo/public/c/system/time.h
@@ -0,0 +1,50 @@
+// 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.
+
+// This file contains Mojo system time-related declarations/definitions.
+//
+// Note: This header should be compilable as C.
+
+#ifndef MOJO_PUBLIC_C_SYSTEM_TIME_H_
+#define MOJO_PUBLIC_C_SYSTEM_TIME_H_
+
+#include <stdint.h>
+
+// |MojoTimeTicks|: A time delta, in microseconds, the meaning of which is
+// source-dependent.
+
+typedef int64_t MojoTimeTicks;
+
+// |MojoDeadline|: Used to specify deadlines (timeouts), in microseconds (except
+// for |MOJO_DEADLINE_INDEFINITE|).
+// |MOJO_DEADLINE_INDEFINITE| - Used to indicate "forever".
+
+typedef uint64_t MojoDeadline;
+
+#define MOJO_DEADLINE_INDEFINITE ((MojoDeadline)-1)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Note: Pointer parameters that are labelled "optional" may be null (at least
+// under some circumstances). Non-const pointer parameters are also labeled
+// "in", "out", or "in/out", to indicate how they are used. (Note that how/if
+// such a parameter is used may depend on other parameters or the requested
+// operation's success/failure. E.g., a separate |flags| parameter may control
+// whether a given "in/out" parameter is used for input, output, or both.)
+
+// Returns the time, in microseconds, since some undefined point in the past.
+// The values are only meaningful relative to other values that were obtained
+// from the same device without an intervening system restart. Such values are
+// guaranteed to be monotonically non-decreasing with the passage of real time.
+// Although the units are microseconds, the resolution of the clock may vary and
+// is typically in the range of ~1-15 ms.
+MojoTimeTicks MojoGetTimeTicksNow(void);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // MOJO_PUBLIC_C_SYSTEM_TIME_H_
diff --git a/mojo/public/c/system/types.h b/mojo/public/c/system/types.h
index 7a2a223..ad382eb 100644
--- a/mojo/public/c/system/types.h
+++ b/mojo/public/c/system/types.h
@@ -2,36 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// This file contains types and constants/macros common to different Mojo system
-// APIs.
-// TODO(vtl): Split this file apart (and eliminate).
+// DEPRECATED -- do not use: include individual header files instead.
+//
+// TODO(vtl): Delete this header file.
//
// Note: This header should be compilable as C.
#ifndef MOJO_PUBLIC_C_SYSTEM_TYPES_H_
#define MOJO_PUBLIC_C_SYSTEM_TYPES_H_
-#include <stdint.h>
-
-// TODO(vtl): These includes are here only for historic reasons. If you actually
-// need either, please include it directly.
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/result.h"
-
-// TODO(vtl): Notes: Use of undefined flags will lead to undefined behavior
-// (typically they'll be ignored), not necessarily an error.
-
-// |MojoTimeTicks|: A time delta, in microseconds, the meaning of which is
-// source-dependent.
-
-typedef int64_t MojoTimeTicks;
-
-// |MojoDeadline|: Used to specify deadlines (timeouts), in microseconds (except
-// for |MOJO_DEADLINE_INDEFINITE|).
-// |MOJO_DEADLINE_INDEFINITE| - Used to indicate "forever".
-
-typedef uint64_t MojoDeadline;
-
-#define MOJO_DEADLINE_INDEFINITE ((MojoDeadline)-1)
+#include "mojo/public/c/system/time.h"
#endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_
diff --git a/mojo/public/c/system/wait.h b/mojo/public/c/system/wait.h
new file mode 100644
index 0000000..4ac513b
--- /dev/null
+++ b/mojo/public/c/system/wait.h
@@ -0,0 +1,108 @@
+// 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.
+
+// This file contains basic functions common to different Mojo system APIs.
+//
+// Note: This header should be compilable as C.
+
+#ifndef MOJO_PUBLIC_C_SYSTEM_WAIT_H_
+#define MOJO_PUBLIC_C_SYSTEM_WAIT_H_
+
+#include "mojo/public/c/system/handle.h"
+#include "mojo/public/c/system/result.h"
+#include "mojo/public/c/system/time.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Waits on the given handle until one of the following happens:
+// - A signal indicated by |signals| is satisfied.
+// - It becomes known that no signal indicated by |signals| will ever be
+// satisfied. (See the description of the |MOJO_RESULT_CANCELLED| and
+// |MOJO_RESULT_FAILED_PRECONDITION| return values below.)
+// - Until |deadline| has passed.
+//
+// If |deadline| is |MOJO_DEADLINE_INDEFINITE|, this will wait "forever" (until
+// one of the other wait termination conditions is satisfied). If |deadline| is
+// 0, this will return |MOJO_RESULT_DEADLINE_EXCEEDED| only if one of the other
+// termination conditions (e.g., a signal is satisfied, or all signals are
+// unsatisfiable) is not already satisfied.
+//
+// |signals_state| (optional): See documentation for |MojoHandleSignalsState|.
+//
+// Returns:
+// |MOJO_RESULT_OK| if some signal in |signals| was satisfied (or is already
+// satisfied).
+// |MOJO_RESULT_CANCELLED| if |handle| was closed (necessarily from another
+// thread) during the wait.
+// |MOJO_RESULT_INVALID_ARGUMENT| if |handle| is not a valid handle (e.g., if
+// it has already been closed). The |signals_state| value is unchanged.
+// |MOJO_RESULT_DEADLINE_EXCEEDED| if the deadline has passed without any of
+// the signals being satisfied.
+// |MOJO_RESULT_FAILED_PRECONDITION| if it becomes known that none of the
+// signals in |signals| can ever be satisfied (e.g., when waiting on one
+// end of a message pipe and the other end is closed).
+//
+// If there are multiple waiters (on different threads, obviously) waiting on
+// the same handle and signal, and that signal becomes satisfied, all waiters
+// will be awoken.
+MojoResult MojoWait(
+ MojoHandle handle,
+ MojoHandleSignals signals,
+ MojoDeadline deadline,
+ struct MojoHandleSignalsState* signals_state); // Optional out.
+
+// Waits on |handles[0]|, ..., |handles[num_handles-1]| until:
+// - (At least) one handle satisfies a signal indicated in its respective
+// |signals[0]|, ..., |signals[num_handles-1]|.
+// - It becomes known that no signal in some |signals[i]| will ever be
+// satisfied.
+// - |deadline| has passed.
+//
+// This means that |MojoWaitMany()| behaves as if |MojoWait()| were called on
+// each handle/signals pair simultaneously, completing when the first
+// |MojoWait()| would complete.
+//
+// See |MojoWait()| for more details about |deadline|.
+//
+// |result_index| (optional) is used to return the index of the handle that
+// caused the call to return. For example, the index |i| (from 0 to
+// |num_handles-1|) if |handle[i]| satisfies a signal from |signals[i]|. You
+// must manually initialize this to a suitable sentinel value (e.g. -1)
+// before you make this call because this value is not updated if there is
+// no specific handle that causes the function to return. Pass null if you
+// don't need this value to be returned.
+//
+// |signals_states| (optional) points to an array of size |num_handles| of
+// MojoHandleSignalsState. See |MojoHandleSignalsState| for more details
+// about the meaning of each array entry. This array is not an atomic
+// snapshot. The array will be updated if the function does not return
+// |MOJO_RESULT_INVALID_ARGUMENT| or |MOJO_RESULT_RESOURCE_EXHAUSTED|.
+//
+// Returns:
+// |MOJO_RESULT_CANCELLED| if some |handle[i]| was closed (necessarily from
+// another thread) during the wait.
+// |MOJO_RESULT_RESOURCE_EXHAUSTED| if there are too many handles. The
+// |signals_state| array is unchanged.
+// |MOJO_RESULT_INVALID_ARGUMENT| if some |handle[i]| is not a valid handle
+// (e.g., if it is zero or if it has already been closed). The
+// |signals_state| array is unchanged.
+// |MOJO_RESULT_DEADLINE_EXCEEDED| if the deadline has passed without any of
+// handles satisfying any of its signals.
+// |MOJO_RESULT_FAILED_PRECONDITION| if it is or becomes impossible that SOME
+// |handle[i]| will ever satisfy any of the signals in |signals[i]|.
+MojoResult MojoWaitMany(
+ const MojoHandle* handles,
+ const MojoHandleSignals* signals,
+ uint32_t num_handles,
+ MojoDeadline deadline,
+ uint32_t* result_index, // Optional out
+ struct MojoHandleSignalsState* signals_states); // Optional out
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // MOJO_PUBLIC_C_SYSTEM_WAIT_H_
diff --git a/mojo/public/cpp/system/functions.h b/mojo/public/cpp/system/functions.h
index 9cfe316..31861db 100644
--- a/mojo/public/cpp/system/functions.h
+++ b/mojo/public/cpp/system/functions.h
@@ -11,7 +11,7 @@
#ifndef MOJO_PUBLIC_CPP_SYSTEM_FUNCTIONS_H_
#define MOJO_PUBLIC_CPP_SYSTEM_FUNCTIONS_H_
-#include "mojo/public/c/system/functions.h"
+#include "mojo/public/c/system/time.h"
namespace mojo {
diff --git a/mojo/public/cpp/system/handle.h b/mojo/public/cpp/system/handle.h
index 02256ab..72951e7 100644
--- a/mojo/public/cpp/system/handle.h
+++ b/mojo/public/cpp/system/handle.h
@@ -8,10 +8,10 @@
#include <assert.h>
#include <limits>
-#include "mojo/public/c/system/functions.h"
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
+#include "mojo/public/c/system/wait.h"
#include "mojo/public/cpp/system/macros.h"
namespace mojo {
diff --git a/mojo/public/platform/dart/dart_handle_watcher.cc b/mojo/public/platform/dart/dart_handle_watcher.cc
index 2ccd195..9720407 100644
--- a/mojo/public/platform/dart/dart_handle_watcher.cc
+++ b/mojo/public/platform/dart/dart_handle_watcher.cc
@@ -17,11 +17,11 @@
#include "dart/runtime/include/dart_api.h"
#include "dart/runtime/include/dart_native_api.h"
-#include "mojo/public/c/system/functions.h"
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/message_pipe.h"
#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
+#include "mojo/public/c/system/wait.h"
namespace mojo {
namespace dart {
diff --git a/mojo/public/platform/dart/mojo_natives.cc b/mojo/public/platform/dart/mojo_natives.cc
index 41d245e..00c836d 100644
--- a/mojo/public/platform/dart/mojo_natives.cc
+++ b/mojo/public/platform/dart/mojo_natives.cc
@@ -11,11 +11,10 @@
#include "dart/runtime/include/dart_api.h"
#include "mojo/public/c/system/buffer.h"
#include "mojo/public/c/system/data_pipe.h"
-#include "mojo/public/c/system/functions.h"
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/message_pipe.h"
#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
#include "mojo/public/cpp/environment/logging.h"
#include "mojo/public/cpp/system/core.h"
#include "mojo/public/cpp/system/macros.h"
diff --git a/mojo/public/platform/nacl/libmojo.cc b/mojo/public/platform/nacl/libmojo.cc
index 14e8742..bb96760 100644
--- a/mojo/public/platform/nacl/libmojo.cc
+++ b/mojo/public/platform/nacl/libmojo.cc
@@ -9,11 +9,11 @@
#include "mojo/public/c/system/buffer.h"
#include "mojo/public/c/system/data_pipe.h"
-#include "mojo/public/c/system/functions.h"
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/message_pipe.h"
#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
+#include "mojo/public/c/system/wait.h"
#include "mojo/public/platform/nacl/mojo_irt.h"
#include "native_client/src/untrusted/irt/irt.h"
diff --git a/mojo/public/platform/nacl/mojo_irt.h b/mojo/public/platform/nacl/mojo_irt.h
index bc993b2..4d23403 100644
--- a/mojo/public/platform/nacl/mojo_irt.h
+++ b/mojo/public/platform/nacl/mojo_irt.h
@@ -13,7 +13,7 @@
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/message_pipe.h"
#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
#define NACL_IRT_MOJO_v0_1 "nacl-irt-mojo-0.1"
diff --git a/mojo/public/platform/native/system_impl_private.h b/mojo/public/platform/native/system_impl_private.h
index 8245a87..0540cca 100644
--- a/mojo/public/platform/native/system_impl_private.h
+++ b/mojo/public/platform/native/system_impl_private.h
@@ -12,7 +12,7 @@
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/message_pipe.h"
#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
// This interface provides the Mojo system API, but with the ability to confine
// calls to a specific handle namespace. Handles in one namespace are unrelated
diff --git a/mojo/public/platform/native/system_impl_private_thunks.h b/mojo/public/platform/native/system_impl_private_thunks.h
index 6301d5c..565bc6d 100644
--- a/mojo/public/platform/native/system_impl_private_thunks.h
+++ b/mojo/public/platform/native/system_impl_private_thunks.h
@@ -12,7 +12,7 @@
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/message_pipe.h"
#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
#include "mojo/public/platform/native/system_impl_private.h"
// Structure used to bind the basic Mojo Core functions of a DSO to those of
diff --git a/mojo/public/platform/native/system_thunks.h b/mojo/public/platform/native/system_thunks.h
index c2996cf..2dbe3a3 100644
--- a/mojo/public/platform/native/system_thunks.h
+++ b/mojo/public/platform/native/system_thunks.h
@@ -11,11 +11,11 @@
#include "mojo/public/c/system/buffer.h"
#include "mojo/public/c/system/data_pipe.h"
-#include "mojo/public/c/system/functions.h"
#include "mojo/public/c/system/handle.h"
#include "mojo/public/c/system/message_pipe.h"
#include "mojo/public/c/system/result.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/time.h"
+#include "mojo/public/c/system/wait.h"
// The embedder needs to bind the basic Mojo Core functions of a DSO to those of
// the embedder when loading a DSO that is dependent on mojo_system.
diff --git a/mojo/public/platform/native_cgo/system_cgo.go b/mojo/public/platform/native_cgo/system_cgo.go
index fbc4f93..74059de 100644
--- a/mojo/public/platform/native_cgo/system_cgo.go
+++ b/mojo/public/platform/native_cgo/system_cgo.go
@@ -6,11 +6,11 @@
//#include "mojo/public/c/system/buffer.h"
//#include "mojo/public/c/system/data_pipe.h"
-//#include "mojo/public/c/system/functions.h"
//#include "mojo/public/c/system/handle.h"
//#include "mojo/public/c/system/message_pipe.h"
//#include "mojo/public/c/system/result.h"
-//#include "mojo/public/c/system/types.h"
+//#include "mojo/public/c/system/time.h"
+//#include "mojo/public/c/system/wait.h"
//
// // These functions are used to 8-byte align C structs.
// MojoResult CreateSharedBuffer(struct MojoCreateSharedBufferOptions* options,
diff --git a/mojo/public/python/c_async_waiter.pxd b/mojo/public/python/c_async_waiter.pxd
index 099c236..d0f19c0 100644
--- a/mojo/public/python/c_async_waiter.pxd
+++ b/mojo/public/python/c_async_waiter.pxd
@@ -12,7 +12,7 @@
ctypedef uint32_t MojoHandleSignals
-cdef extern from "mojo/public/c/system/types.h" nogil:
+cdef extern from "mojo/public/c/system/time.h" nogil:
ctypedef uint64_t MojoDeadline
diff --git a/mojo/public/python/c_core.pxd b/mojo/public/python/c_core.pxd
index e8430ab..619d750 100644
--- a/mojo/public/python/c_core.pxd
+++ b/mojo/public/python/c_core.pxd
@@ -13,20 +13,6 @@
from cpython.mem cimport PyMem_Malloc, PyMem_Free
from libc.stdint cimport int32_t, int64_t, uint32_t, uint64_t, uintptr_t
-cdef extern from "mojo/public/c/system/handle.h" nogil:
- ctypedef uint32_t MojoHandle
- const MojoHandle MOJO_HANDLE_INVALID
-
- ctypedef uint32_t MojoHandleSignals
- const MojoHandleSignals MOJO_HANDLE_SIGNAL_NONE
- const MojoHandleSignals MOJO_HANDLE_SIGNAL_READABLE
- const MojoHandleSignals MOJO_HANDLE_SIGNAL_WRITABLE
- const MojoHandleSignals MOJO_HANDLE_SIGNAL_PEER_CLOSED
-
- cdef struct MojoHandleSignalsState:
- MojoHandleSignals satisfied_signals
- MojoHandleSignals satisfiable_signals
-
cdef extern from "mojo/public/c/system/result.h" nogil:
ctypedef int32_t MojoResult
const MojoResult MOJO_RESULT_OK
@@ -48,15 +34,31 @@
const MojoResult MOJO_RESULT_BUSY
const MojoResult MOJO_RESULT_SHOULD_WAIT
-cdef extern from "mojo/public/c/system/types.h" nogil:
+cdef extern from "mojo/public/c/system/handle.h" nogil:
+ ctypedef uint32_t MojoHandle
+ const MojoHandle MOJO_HANDLE_INVALID
+
+ ctypedef uint32_t MojoHandleSignals
+ const MojoHandleSignals MOJO_HANDLE_SIGNAL_NONE
+ const MojoHandleSignals MOJO_HANDLE_SIGNAL_READABLE
+ const MojoHandleSignals MOJO_HANDLE_SIGNAL_WRITABLE
+ const MojoHandleSignals MOJO_HANDLE_SIGNAL_PEER_CLOSED
+
+ cdef struct MojoHandleSignalsState:
+ MojoHandleSignals satisfied_signals
+ MojoHandleSignals satisfiable_signals
+
+ MojoResult MojoClose(MojoHandle handle)
+
+cdef extern from "mojo/public/c/system/time.h" nogil:
ctypedef int64_t MojoTimeTicks
ctypedef uint64_t MojoDeadline
const MojoDeadline MOJO_DEADLINE_INDEFINITE
-cdef extern from "mojo/public/c/system/functions.h" nogil:
MojoTimeTicks MojoGetTimeTicksNow()
- MojoResult MojoClose(MojoHandle handle)
+
+cdef extern from "mojo/public/c/system/wait.h" nogil:
MojoResult MojoWait "MojoWait"(MojoHandle handle,
MojoHandleSignals signals,
MojoDeadline deadline,
diff --git a/mojo/public/python/mojo_system.pyx b/mojo/public/python/mojo_system.pyx
index 31ef2a4..4d63ff3 100644
--- a/mojo/public/python/mojo_system.pyx
+++ b/mojo/public/python/mojo_system.pyx
@@ -75,7 +75,7 @@
def GetTimeTicksNow():
"""Monotonically increasing tick count representing "right now."
- See mojo/public/c/system/functions.h
+ See mojo/public/c/system/time.h
"""
return c_core.MojoGetTimeTicksNow()
@@ -203,7 +203,7 @@
Args:
handles_and_signals: list of tuples of handle and signal.
- See mojo/public/c/system/functions.h
+ See mojo/public/c/system/wait.h
"""
cdef uint32_t length = len(handles_and_signals)
cdef uint32_t result_index = <uint32_t>(-1)
@@ -343,7 +343,7 @@
def Close(self):
"""Closes this handle.
- See mojo/public/c/system/functions.h
+ See mojo/public/c/system/handle.h
"""
cdef c_core.MojoResult result = c_core.MOJO_RESULT_OK
if self.IsValid():
@@ -357,7 +357,7 @@
def Wait(self, signals, deadline):
"""Waits on the given handle.
- See mojo/public/c/system/functions.h
+ See mojo/public/c/system/wait.h
"""
cdef c_core.MojoHandle handle = self._mojo_handle
cdef c_core.MojoHandleSignals csignals = signals
diff --git a/services/js/system/mojo_runner_delegate.h b/services/js/system/mojo_runner_delegate.h
index 95b9f74..cf47e74 100644
--- a/services/js/system/mojo_runner_delegate.h
+++ b/services/js/system/mojo_runner_delegate.h
@@ -7,7 +7,7 @@
#include "base/macros.h"
#include "gin/modules/module_runner_delegate.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/handle.h"
namespace mojo {
namespace js {
diff --git a/services/vanadium/security/principal_service.go b/services/vanadium/security/principal_service.go
index 9172769..5331321 100644
--- a/services/vanadium/security/principal_service.go
+++ b/services/vanadium/security/principal_service.go
@@ -22,7 +22,8 @@
vpkg "mojo/services/vanadium/security/interfaces/principal"
)
-//#include "mojo/public/c/system/types.h"
+//#include "mojo/public/c/system/handle.h"
+//#include "mojo/public/c/system/result.h"
import "C"
const blesserURL = "https://dev.v.io/auth/google/bless"
diff --git a/shell/child_process_host_unittest.cc b/shell/child_process_host_unittest.cc
index 276b798..7cd1009 100644
--- a/shell/child_process_host_unittest.cc
+++ b/shell/child_process_host_unittest.cc
@@ -11,7 +11,7 @@
#include "base/message_loop/message_loop.h"
#include "build/build_config.h"
#include "mojo/message_pump/message_pump_mojo.h"
-#include "mojo/public/c/system/types.h"
+#include "mojo/public/c/system/result.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "shell/application_manager/native_application_options.h"
#include "shell/context.h"