Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4514)

Unified Diff: chrome/common/ipc_channel_posix.h

Issue 14068: Reverting 6911. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/message_pump_libevent.cc ('k') | chrome/common/ipc_channel_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/ipc_channel_posix.h
===================================================================
--- chrome/common/ipc_channel_posix.h (revision 6915)
+++ chrome/common/ipc_channel_posix.h (working copy)
@@ -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,20 +31,28 @@
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.
size_t message_send_bytes_written_;
« no previous file with comments | « base/message_pump_libevent.cc ('k') | chrome/common/ipc_channel_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698