Reintroduce verbose logging in IPC::Channel::Send().

Platform-specific IPC::Channel implementations included Chrome IPC
message logging, but this was not carried into the Mojo-based Channel
implementation.

Chrome IPC message logging is higher-level than Mojo IPC message logs,
which can be useful for certain kinds of diagnosis.

Bug: 816620
Change-Id: I467857fd07b66c3d468039d6fb7c2950f931c8bb
Reviewed-on: https://chromium-review.googlesource.com/956347
Reviewed-by: Ken Rockot <[email protected]>
Commit-Queue: Wez <[email protected]>
Cr-Commit-Position: refs/heads/master@{#542050}
diff --git a/ipc/ipc_channel_mojo.cc b/ipc/ipc_channel_mojo.cc
index d7ce34a..cb10b09 100644
--- a/ipc/ipc_channel_mojo.cc
+++ b/ipc/ipc_channel_mojo.cc
@@ -217,6 +217,12 @@
 }
 
 bool ChannelMojo::Send(Message* message) {
+  DVLOG(2) << "sending message @" << message << " on channel @" << this
+           << " with type " << message->type();
+#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED)
+  Logging::GetInstance()->OnSendMessage(message);
+#endif
+
   std::unique_ptr<Message> scoped_message = base::WrapUnique(message);
   if (!message_reader_)
     return false;