Add support for Attachment Brokering of IPC::Channels on multiple threads.

Attachment brokering makes the assumption that there's a single thread
on which IO related to IPC::Channels occurs. This assumption is violated
when the flag --single-process is set.

BUG=590213

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

Cr-Commit-Position: refs/heads/master@{#382431}


CrOS-Libchrome-Original-Commit: a91d0513fa16b2e8c48acbaf7a5c18659ab10d07
diff --git a/ipc/attachment_broker.h b/ipc/attachment_broker.h
index 9bca157..70383ed 100644
--- a/ipc/attachment_broker.h
+++ b/ipc/attachment_broker.h
@@ -27,6 +27,7 @@
 
 namespace base {
 class SequencedTaskRunner;
+class SingleThreadTaskRunner;
 };
 
 namespace IPC {
@@ -94,7 +95,11 @@
   // communicates attachment information with the broker process. In the broker
   // process, these channels must be registered and deregistered with the
   // Attachment Broker as they are created and destroyed.
-  virtual void RegisterCommunicationChannel(Endpoint* endpoint);
+  //
+  // Invocations of Send() on |endpoint| will occur on thread bound to |runner|.
+  virtual void RegisterCommunicationChannel(
+      Endpoint* endpoint,
+      scoped_refptr<base::SingleThreadTaskRunner> runner);
   virtual void DeregisterCommunicationChannel(Endpoint* endpoint);
 
   // In each unprivileged process, exactly one channel should be used to