Convert over to channel handles

This hides some of the internals of the posix channels from users, and gets rid
of several #ifdef POSIX blocks. Generally simplifies usage of channels xplatform.

BUG=none
TEST=build

Review URL: http://codereview.chromium.org/5598010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68621 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: 42ce94ec8e98df0744cc1dea26b49c084fe185f0
diff --git a/ipc/ipc_channel_posix.h b/ipc/ipc_channel_posix.h
index b7818a2..77a993e 100644
--- a/ipc/ipc_channel_posix.h
+++ b/ipc/ipc_channel_posix.h
@@ -19,27 +19,13 @@
 
 namespace IPC {
 
-// Store that channel name |name| is available via socket |socket|.
-// Used when the channel has been precreated by another process on
-// our behalf and they've just shipped us the socket.
-void AddChannelSocket(const std::string& name, int socket);
-
-// Remove the channel name mapping, and close the corresponding socket.
-void RemoveAndCloseChannelSocket(const std::string& name);
-
-// Returns true if a channel named |name| is available.
-bool ChannelSocketExists(const std::string& name);
-
-// Construct a socket pair appropriate for IPC: UNIX domain, nonblocking.
-// Returns false on error.
-bool SocketPair(int* fd1, int* fd2);
-
 // An implementation of ChannelImpl for POSIX systems that works via
 // socketpairs.  See the .cc file for an overview of the implementation.
 class Channel::ChannelImpl : public MessageLoopForIO::Watcher {
  public:
   // Mirror methods of Channel, see ipc_channel.h for description.
-  ChannelImpl(const std::string& channel_id, Mode mode, Listener* listener);
+  ChannelImpl(const IPC::ChannelHandle &channel_handle, Mode mode,
+              Listener* listener);
   ~ChannelImpl();
   bool Connect();
   void Close();
@@ -48,7 +34,7 @@
   int GetClientFileDescriptor() const;
 
  private:
-  bool CreatePipe(const std::string& channel_id, Mode mode);
+  bool CreatePipe(const IPC::ChannelHandle &channel_handle, Mode mode);
 
   bool ProcessIncomingMessages();
   bool ProcessOutgoingMessages();