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

Unified Diff: mojo/public/c/system/types.h

Issue 1811433002: [mojo-edk] Expose notification source to MojoWatch callbacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
Index: mojo/public/c/system/types.h
diff --git a/mojo/public/c/system/types.h b/mojo/public/c/system/types.h
index 4574d7413615eac0a740cfd4925c185d8513e3fd..144edcd35d1a3344aa4e0a77155eb76a44b407db 100644
--- a/mojo/public/c/system/types.h
+++ b/mojo/public/c/system/types.h
@@ -182,4 +182,24 @@ struct MOJO_ALIGNAS(4) MojoHandleSignalsState {
MOJO_STATIC_ASSERT(sizeof(MojoHandleSignalsState) == 8,
"MojoHandleSignalsState has wrong size");
+// |MojoWatchNotificationFlags|: Passed to a callback invoked as a result of
+// signals being raised on a handle watched by |MojoWatch()|. May take the
+// following values:
+// |MOJO_WATCH_NOTIFICATION_EXTERNAL_PROCESS| - The callback is being invoked
Anand Mistry (off Chromium) 2016/03/16 23:04:14 Not a fan of the "EXTERNAL_PROCESS" name, since it
Ken Rockot(use gerrit already) 2016/03/17 00:15:34 Went with FROM_SYSTEM for the public API flag. The
+// as a result of an incoming event from out-of-process. This may be used
+// as an indication that user code is safe to call without fear of
+// reentry.
+
+typedef uint32_t MojoWatchNotificationFlags;
+
+#ifdef __cplusplus
+const MojoWatchNotificationFlags MOJO_WATCH_NOTIFICATION_FLAG_NONE = 0;
+const MojoWatchNotificationFlags MOJO_WATCH_NOTIFICATION_FLAG_EXTERNAL_PROCESS =
+ 1 << 0;
+#else
+#define MOJO_WATCH_NOTIFICATION_FLAG_NONE ((MojoWatchNotificationFlags)0)
+#define MOJO_WATCH_NOTIFICATION_FLAG_EXTERNAL_PROCESS \
+ ((MojoWatchNotificationFlags)1 << 0);
+#endif
+
#endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_

Powered by Google App Engine
This is Rietveld 408576698