diff options
author | Kristian Monsen <kristianm@google.com> | 2011-05-24 16:24:13 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2011-05-25 14:13:32 +0100 |
commit | 3f50c38dc070f4bb515c1b64450dae14f316474e (patch) | |
tree | 29f309f9534e05c47244eedb438fc612578d133b /base/message_pump_libevent.h | |
parent | e23bef148f7be2bdf9c3cb2cd3aa5ceebf1190fb (diff) | |
download | external_chromium-3f50c38dc070f4bb515c1b64450dae14f316474e.zip external_chromium-3f50c38dc070f4bb515c1b64450dae14f316474e.tar.gz external_chromium-3f50c38dc070f4bb515c1b64450dae14f316474e.tar.bz2 |
Merge Chromium at r10.0.634.0: Initial merge by git.
Change-Id: Iac2af492818d119bcc2562eb5fdabf5ab0b6df9c
Diffstat (limited to 'base/message_pump_libevent.h')
-rw-r--r-- | base/message_pump_libevent.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/base/message_pump_libevent.h b/base/message_pump_libevent.h index d8d000d..2ade511 100644 --- a/base/message_pump_libevent.h +++ b/base/message_pump_libevent.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -86,15 +86,15 @@ class MessagePumpLibevent : public MessagePump { DISALLOW_COPY_AND_ASSIGN(FileDescriptorWatcher); }; - MessagePumpLibevent(); - virtual ~MessagePumpLibevent(); - enum Mode { WATCH_READ = 1 << 0, WATCH_WRITE = 1 << 1, WATCH_READ_WRITE = WATCH_READ | WATCH_WRITE }; + MessagePumpLibevent(); + virtual ~MessagePumpLibevent(); + // Have the current thread's message loop watch for a a situation in which // reading/writing to the FD can be performed without blocking. // Callers must provide a preallocated FileDescriptorWatcher object which @@ -128,6 +128,14 @@ class MessagePumpLibevent : public MessagePump { // Risky part of constructor. Returns true on success. bool Init(); + // Called by libevent to tell us a registered FD can be read/written to. + static void OnLibeventNotification(int fd, short flags, + void* context); + + // Unix pipe used to implement ScheduleWork() + // ... callback; called by libevent inside Run() when pipe is ready to read + static void OnWakeup(int socket, short flags, void* context); + // This flag is set to false when Run should return. bool keep_running_; @@ -141,13 +149,6 @@ class MessagePumpLibevent : public MessagePump { // readiness callbacks when a socket is ready for I/O. event_base* event_base_; - // Called by libevent to tell us a registered FD can be read/written to. - static void OnLibeventNotification(int fd, short flags, - void* context); - - // Unix pipe used to implement ScheduleWork() - // ... callback; called by libevent inside Run() when pipe is ready to read - static void OnWakeup(int socket, short flags, void* context); // ... write end; ScheduleWork() writes a single byte to it int wakeup_pipe_in_; // ... read end; OnWakeup reads it and then breaks Run() out of its sleep |