Memory-UMA needs to be able to dedupe base::SharedMemory regions across multiple processes. The current implementation uses POSIX sys-calls to get the inode's st_dev and st_ino. This doesn't scale to macOS, and requires some finessing to work on Windows.
The easiest platform-agnostic solution is to add a GUID to base::SharedMemory and base::SharedMemoryHandle and pass that GUID over IPC. I recommend a 128 bit GUID. [birthday paradox and some math shows we want more than 64-bits].
There's an email thread where Hajime and Ken were talking about changing MojoPlatformhandle to support this. We shouldn't be changing Mojo internals to support an application level change. When we serialize to Mojo, we should include both a platform handle and a GUID. I haven't looked in detail at Mojo serialization of base::SharedMemoryHandle but Chrome IPC serialization is pretty trivial to change:
https://cs.chromium.org/chromium/src/ipc/ipc_message_utils.cc?type=cs&q=sharedmemoryhandle+file:ipc&l=682
Comment 1 by danakj@chromium.org
, Apr 20 2017