diff options
author | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-08 19:28:09 +0000 |
---|---|---|
committer | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-08 19:28:09 +0000 |
commit | 42ce94ec8e98df0744cc1dea26b49c084fe185f0 (patch) | |
tree | 8b585da323dc3bbabb3c61a8941aed90e1819648 /ipc/ipc_channel_posix.h | |
parent | ade3ef65f389b00a101da5eb18a02b966d354b18 (diff) | |
download | chromium_src-42ce94ec8e98df0744cc1dea26b49c084fe185f0.zip chromium_src-42ce94ec8e98df0744cc1dea26b49c084fe185f0.tar.gz chromium_src-42ce94ec8e98df0744cc1dea26b49c084fe185f0.tar.bz2 |
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
Diffstat (limited to 'ipc/ipc_channel_posix.h')
-rw-r--r-- | ipc/ipc_channel_posix.h | 20 |
1 files changed, 3 insertions, 17 deletions
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 @@ class Channel::ChannelImpl : public MessageLoopForIO::Watcher { 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(); |