diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-01 22:37:59 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-01 22:37:59 +0000 |
commit | 5f594c011f9da68070a44cf3a97b411efa90d7c3 (patch) | |
tree | 8186524397ef59a08dc07b1b6ad92cfce082d6c2 /chrome/common/ipc_channel_posix.h | |
parent | d428c075b54c206d33d177aa926624af7104c52d (diff) | |
download | chromium_src-5f594c011f9da68070a44cf3a97b411efa90d7c3.zip chromium_src-5f594c011f9da68070a44cf3a97b411efa90d7c3.tar.gz chromium_src-5f594c011f9da68070a44cf3a97b411efa90d7c3.tar.bz2 |
posix: add some comments and clean up some IPC channel code.
Review URL: http://codereview.chromium.org/100237
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15111 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/ipc_channel_posix.h')
-rw-r--r-- | chrome/common/ipc_channel_posix.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/common/ipc_channel_posix.h b/chrome/common/ipc_channel_posix.h index f94b171..b45503b 100644 --- a/chrome/common/ipc_channel_posix.h +++ b/chrome/common/ipc_channel_posix.h @@ -18,6 +18,8 @@ namespace IPC { +// 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. @@ -28,17 +30,16 @@ class Channel::ChannelImpl : public MessageLoopForIO::Watcher { void set_listener(Listener* listener) { listener_ = listener; } bool Send(Message* message); void GetClientFileDescriptorMapping(int *src_fd, int *dest_fd) const; - void OnClientConnected(); private: - const std::wstring PipeName(const std::wstring& channel_id) const; bool CreatePipe(const std::wstring& channel_id, Mode mode); bool ProcessIncomingMessages(); bool ProcessOutgoingMessages(); - void OnFileCanReadWithoutBlocking(int fd); - void OnFileCanWriteWithoutBlocking(int fd); + // MessageLoopForIO::Watcher implementation. + virtual void OnFileCanReadWithoutBlocking(int fd); + virtual void OnFileCanWriteWithoutBlocking(int fd); Mode mode_; @@ -62,6 +63,9 @@ class Channel::ChannelImpl : public MessageLoopForIO::Watcher { int server_listen_pipe_; int pipe_; int client_pipe_; // The client end of our socketpair(). + + // The "name" of our pipe. On Windows this is the global identifier for + // the pipe. On POSIX it's used as a key in a local map of file descriptors. std::string pipe_name_; Listener* listener_; |