IPC: Add MojoHandleAttachment

This CL introduces MojoHandleAttachment, a MessageAttachment subclass.
With this and ChannelMojo, we are able to send Mojo MessagePipes
over IPC.

There is also MojoMessageHelper which provides some static member functions
that reads and writes MessagePipes from/to a Message. In coming changes,
we'll add ParamTraits for MessagePipe based on this.

[email protected], [email protected]
TEST=IPCChannelMojoTest.SendMessagePipe, IPCChannelMojoTest.SendPlatformHandleAndPipe
BUG=448190

Review URL: https://codereview.chromium.org/866223005

Cr-Commit-Position: refs/heads/master@{#314930}
diff --git a/ipc/ipc_message.cc b/ipc/ipc_message.cc
index c5a5a83c..99c56efa 100644
--- a/ipc/ipc_message.cc
+++ b/ipc/ipc_message.cc
@@ -155,4 +155,8 @@
   return attachment_set_.get() && !attachment_set_->empty();
 }
 
+bool Message::HasMojoHandles() const {
+  return attachment_set_.get() && 0 < attachment_set_->num_mojo_handles();
+}
+
 }  // namespace IPC