diff options
author | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-12 19:55:17 +0000 |
---|---|---|
committer | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-12 19:55:17 +0000 |
commit | 900342a3e34354312a2ce854196e95fa8a0c07c4 (patch) | |
tree | 8d73bce7518e4077c805053cb553ef11b3b1949d /chrome/common/ipc_channel_posix.h | |
parent | ab844167875b2003cb44081c6b64c0097df30b48 (diff) | |
download | chromium_src-900342a3e34354312a2ce854196e95fa8a0c07c4.zip chromium_src-900342a3e34354312a2ce854196e95fa8a0c07c4.tar.gz chromium_src-900342a3e34354312a2ce854196e95fa8a0c07c4.tar.bz2 |
Reverting 6911.
Review URL: http://codereview.chromium.org/14068
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6916 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/ipc_channel_posix.h')
-rw-r--r-- | chrome/common/ipc_channel_posix.h | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/chrome/common/ipc_channel_posix.h b/chrome/common/ipc_channel_posix.h index 9b34494..b2849dc 100644 --- a/chrome/common/ipc_channel_posix.h +++ b/chrome/common/ipc_channel_posix.h @@ -11,10 +11,11 @@ #include <string> #include "base/message_loop.h" +#include "third_party/libevent/event.h" namespace IPC { -class Channel::ChannelImpl : public MessageLoopForIO::Watcher { +class Channel::ChannelImpl : public MessageLoopForIO::FileWatcher { public: // Mirror methods of Channel, see ipc_channel.h for description. ChannelImpl(const std::wstring& channel_id, Mode mode, Listener* listener); @@ -30,19 +31,27 @@ class Channel::ChannelImpl : public MessageLoopForIO::Watcher { bool ProcessIncomingMessages(); bool ProcessOutgoingMessages(); - void OnFileCanReadWithoutBlocking(int fd); - void OnFileCanWriteWithoutBlocking(int fd); + void OnFileReadReady(int fd); + void OnFileWriteReady(int fd); Mode mode_; - // After accepting one client connection on our server socket we want to - // stop listening. - MessageLoopForIO::FileDescriptorWatcher server_listen_connection_watcher_; - MessageLoopForIO::FileDescriptorWatcher read_watcher_; - MessageLoopForIO::FileDescriptorWatcher write_watcher_; + // Wrapper for Libevent event. + // TODO(playmobil): MessageLoopForIO needs to better encapsulate libevent. + struct EventHolder { + EventHolder() : is_active(false) {} + ~EventHolder() {} - // Are we currently blocked waiting for a write to complete. - bool is_blocked_on_write_; + bool is_active; + + // libevent's set functions set all the needed members of this struct, so no + // need to initialize before use. + struct event event; + }; + + EventHolder *server_listen_connection_event_; + EventHolder *read_event_; + EventHolder *write_event_; // If sending a message blocks then we use this variable // to keep track of where we are. |