diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-12 19:09:47 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-12 19:09:47 +0000 |
commit | eb8c76326fb39a429dc8bda38da22a86bb6802b3 (patch) | |
tree | 2155abfd972894d6ca5bfdf11a8fed37da065d4c /base/message_loop.h | |
parent | b3d64d5c0d00415968935942b00d37704cd7507c (diff) | |
download | chromium_src-eb8c76326fb39a429dc8bda38da22a86bb6802b3.zip chromium_src-eb8c76326fb39a429dc8bda38da22a86bb6802b3.tar.gz chromium_src-eb8c76326fb39a429dc8bda38da22a86bb6802b3.tar.bz2 |
message_pump_libevent refactor:
* Unify WatchSocket & WatchFileHandle.
* Better encapsulate libevent.
* Fix a bug with blocking writes in ipc_posix.cc
Review URL: http://codereview.chromium.org/13757
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6911 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop.h')
-rw-r--r-- | base/message_loop.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/base/message_loop.h b/base/message_loop.h index 69db8c1..6cd0ef4 100644 --- a/base/message_loop.h +++ b/base/message_loop.h @@ -473,14 +473,21 @@ class MessageLoopForIO : public MessageLoop { #elif defined(OS_POSIX) typedef base::MessagePumpLibevent::Watcher Watcher; - typedef base::MessagePumpLibevent::FileWatcher FileWatcher; - - // Please see MessagePumpLibevent for definitions of these methods. - void WatchSocket(int socket, short interest_mask, - struct event* e, Watcher* watcher); - void WatchFileHandle(int fd, short interest_mask, event* e, FileWatcher*); - void UnwatchSocket(struct event* e); - void UnwatchFileHandle(event* e); + typedef base::MessagePumpLibevent::FileDescriptorWatcher + FileDescriptorWatcher; + + enum Mode { + WATCH_READ = base::MessagePumpLibevent::WATCH_READ, + WATCH_WRITE = base::MessagePumpLibevent::WATCH_WRITE, + WATCH_READ_WRITE = base::MessagePumpLibevent::WATCH_READ_WRITE + }; + + // Please see MessagePumpLibevent for definition. + bool WatchFileDescriptor(int fd, + bool persistent, + Mode mode, + FileDescriptorWatcher *controller, + Watcher *delegate); #endif // defined(OS_POSIX) }; |