WrapPlatformFile / UnwrapPlatformFile appear to accept null / invalid handles. Unwrap appears to return MOJO_RESULT_OK as well.
WrapSharedMemoryHandle allows invalid handles to be wrapped, but UnwrappedSharedMemoryHandle returns MOJO_RESULT_INVALID_ARGUMENT when trying to unwrap an invalid handle. This should ideally be symmetrical.
As another data point, WrapMachPort / UnwrapMachPort appear to allow invalid / null handles as well.
It might be good to explicitly document how these helper functions handle null / invalid handles as well.
Comment 1 by roc...@chromium.org
, Oct 17