Step two of optionally sending messages to/from message ports as base::Value.

This CL changes every place a MessagePort is transferred between process to
properly propagate the send_messages_as_values flag, as well as makes it
possible for NavigatorConnectContext to set this flag when setting up a
new connection.

This is part of a series of changes:
[1/5] Blink side changes in https://codereview.chromium.org/924983002/ that expose a needed v8 context
[2/5] https://codereview.chromium.org/921013002/ allow MessagePort to send messages as values
[3/5] This CL
[4/5] https://codereview.chromium.org/938403005/ which uses this for navigator.connect services and adds infrastructure for layout tests
[5/5] https://codereview.chromium.org/940423004/ adds layout tests to blink to test these new features

BUG=426458

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

Cr-Commit-Position: refs/heads/master@{#318578}
diff --git a/content/browser/message_port_service.h b/content/browser/message_port_service.h
index 1e561b2..d5e3379 100644
--- a/content/browser/message_port_service.h
+++ b/content/browser/message_port_service.h
@@ -21,7 +21,8 @@
 
 class CONTENT_EXPORT MessagePortService {
  public:
-  typedef std::vector<std::pair<content::MessagePortMessage, std::vector<int>>>
+  typedef std::vector<std::pair<content::MessagePortMessage,
+                                std::vector<TransferredMessagePort>>>
       QueuedMessages;
 
   // Returns the MessagePortService singleton.
@@ -33,9 +34,10 @@
               int* message_port_id);
   void Destroy(int message_port_id);
   void Entangle(int local_message_port_id, int remote_message_port_id);
-  void PostMessage(int sender_message_port_id,
-                   const MessagePortMessage& message,
-                   const std::vector<int>& sent_message_port_ids);
+  void PostMessage(
+      int sender_message_port_id,
+      const MessagePortMessage& message,
+      const std::vector<TransferredMessagePort>& sent_message_ports);
   void QueueMessages(int message_port_id);
   void SendQueuedMessages(int message_port_id,
                           const QueuedMessages& queued_messages);
@@ -72,9 +74,10 @@
   MessagePortService();
   ~MessagePortService();
 
-  void PostMessageTo(int message_port_id,
-                     const MessagePortMessage& message,
-                     const std::vector<int>& sent_message_port_ids);
+  void PostMessageTo(
+      int message_port_id,
+      const MessagePortMessage& message,
+      const std::vector<TransferredMessagePort>& sent_message_ports);
 
   // Handles the details of removing a message port id. Before calling this,
   // verify that the message port id exists.