| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/message_pump_libevent.h" | 5 #include <stdbool.h> |
| 6 | 6 #include <stddef.h> |
| 7 #include <errno.h> | 7 #include <sys/_structs.h> |
| 8 #include <fcntl.h> | 8 #include <sys/errno.h> |
| 9 #include <sys/fcntl.h> |
| 10 #include <unistd.h> |
| 11 #include <vector> |
| 9 | 12 |
| 10 #include "base/auto_reset.h" | 13 #include "base/auto_reset.h" |
| 11 #include "base/eintr_wrapper.h" | 14 #include "base/eintr_wrapper.h" |
| 12 #include "base/logging.h" | 15 #include "base/logging.h" |
| 13 #include "base/mac/scoped_nsautorelease_pool.h" | 16 #include "base/mac/scoped_nsautorelease_pool.h" |
| 17 #include "base/message_pump.h" |
| 18 #include "base/message_pump_libevent.h" |
| 14 #include "base/observer_list.h" | 19 #include "base/observer_list.h" |
| 15 #include "base/scoped_ptr.h" | 20 #include "base/scoped_ptr.h" |
| 16 #include "base/time.h" | 21 #include "base/time.h" |
| 17 #if defined(USE_SYSTEM_LIBEVENT) | 22 #if defined(USE_SYSTEM_LIBEVENT) |
| 18 #include <event.h> | 23 #include <event.h> |
| 19 #else | 24 #else |
| 20 #include "third_party/libevent/event.h" | 25 #include "third_party/libevent/event.h" |
| 21 #endif | 26 #endif |
| 22 | 27 |
| 23 // Lifecycle of struct event | 28 // Lifecycle of struct event |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 | 351 |
| 347 // Remove and discard the wakeup byte. | 352 // Remove and discard the wakeup byte. |
| 348 char buf; | 353 char buf; |
| 349 int nread = HANDLE_EINTR(read(socket, &buf, 1)); | 354 int nread = HANDLE_EINTR(read(socket, &buf, 1)); |
| 350 DCHECK_EQ(nread, 1); | 355 DCHECK_EQ(nread, 1); |
| 351 // Tell libevent to break out of inner loop. | 356 // Tell libevent to break out of inner loop. |
| 352 event_base_loopbreak(that->event_base_); | 357 event_base_loopbreak(that->event_base_); |
| 353 } | 358 } |
| 354 | 359 |
| 355 } // namespace base | 360 } // namespace base |
| OLD | NEW |