summaryrefslogtreecommitdiff
path: root/chromium/mojo/public/c/system/invitation.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/mojo/public/c/system/invitation.h
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/mojo/public/c/system/invitation.h')
-rw-r--r--chromium/mojo/public/c/system/invitation.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/chromium/mojo/public/c/system/invitation.h b/chromium/mojo/public/c/system/invitation.h
index e63001eb0be..f95bcc4e096 100644
--- a/chromium/mojo/public/c/system/invitation.h
+++ b/chromium/mojo/public/c/system/invitation.h
@@ -251,6 +251,25 @@ struct MOJO_ALIGNAS(8) MojoAcceptInvitationOptions {
MOJO_STATIC_ASSERT(sizeof(struct MojoAcceptInvitationOptions) == 8,
"MojoAcceptInvitationOptions has wrong size");
+// Flags passed to |MojoSetDefaultProcessErrorHandler()| via
+// |MojoSetDefaultProcessErrorHandlerOptions|.
+typedef uint32_t MojoSetDefaultProcessErrorHandlerFlags;
+
+// No flags. Default behavior.
+#define MOJO_SET_DEFAULT_PROCESS_ERROR_HANDLER_FLAG_NONE \
+ ((MojoSetDefaultProcessErrorHandlerFlags)0)
+
+// Options passed to |MojoSetDefaultProcessErrorHandler()|.
+struct MOJO_ALIGNAS(8) MojoSetDefaultProcessErrorHandlerOptions {
+ // The size of this structure, used for versioning.
+ uint32_t struct_size;
+
+ // See |MojoSetDefaultProcessErrorHandlerFlags|.
+ MojoSetDefaultProcessErrorHandlerFlags flags;
+};
+MOJO_STATIC_ASSERT(sizeof(struct MojoSetDefaultProcessErrorHandlerOptions) == 8,
+ "MojoSetDefaultProcessErrorHandlerOptions has wrong size");
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -266,6 +285,12 @@ typedef void (*MojoProcessErrorHandler)(
uintptr_t context,
const struct MojoProcessErrorDetails* details);
+// Similar to above, but registered globally via
+// |MojoSetDefaultProcessErrorHandler()| and invoked only for communication
+// errors regarding processes NOT invited by the calling process.
+typedef void (*MojoDefaultProcessErrorHandler)(
+ const struct MojoProcessErrorDetails* details);
+
// Creates a new invitation to be sent to another process.
//
// An invitation is used to invite another process to join this process's
@@ -474,6 +499,31 @@ MOJO_SYSTEM_EXPORT MojoResult MojoAcceptInvitation(
const struct MojoAcceptInvitationOptions* options,
MojoHandle* invitation_handle);
+// Registers a process-wide handler to be invoked when an error is raised on a
+// connection to a peer process. Such errors can be raised if the peer process
+// sends malformed data to this process.
+//
+// Note that this handler is only invoked for connections to processes NOT
+// explicitly invited by this process. To handle errors concerning processes
+// invited by this process, see the MojoProcessErrorHandler argument to
+// |MojoSendInvitation()|.
+//
+// The general use case for this API is to be able to log or report instances of
+// bad IPCs received by a client process which no real ability or authority to
+// identify the source.
+//
+// Returns:
+// |MOJO_RESULT_OK| if |handler| is successfully registered as the global
+// default process error handler within the calling process. If |handler|
+// is null, any registered default process error handler is removed.
+// |MOJO_RESULT_ALREADY_EXISTS| if |handler| is non-null and there is already
+// a registered error handler. Callers wishing to replace an existing
+// handler must first call |MojoSetDefaultProcessErrorHandler()| with null
+// in order to do so.
+MOJO_SYSTEM_EXPORT MojoResult MojoSetDefaultProcessErrorHandler(
+ MojoDefaultProcessErrorHandler handler,
+ const struct MojoSetDefaultProcessErrorHandlerOptions* options);
+
#ifdef __cplusplus
} // extern "C"
#endif