OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/message_pump_libevent.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/eintr_wrapper.h" | 12 #include "base/eintr_wrapper.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #if defined(OS_MACOSX) | |
15 #include "base/mac/scoped_nsautorelease_pool.h" | |
16 #endif | |
17 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
18 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
19 #include "base/time.h" | 16 #include "base/time.h" |
20 #if defined(USE_SYSTEM_LIBEVENT) | 17 #if defined(USE_SYSTEM_LIBEVENT) |
21 #include <event.h> | 18 #include <event.h> |
22 #else | 19 #else |
23 #include "third_party/libevent/event.h" | 20 #include "third_party/libevent/event.h" |
24 #endif | 21 #endif |
25 | 22 |
26 #if defined(OS_MACOSX) | 23 #if defined(OS_MACOSX) |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 // Remove and discard the wakeup byte. | 373 // Remove and discard the wakeup byte. |
377 char buf; | 374 char buf; |
378 int nread = HANDLE_EINTR(read(socket, &buf, 1)); | 375 int nread = HANDLE_EINTR(read(socket, &buf, 1)); |
379 DCHECK_EQ(nread, 1); | 376 DCHECK_EQ(nread, 1); |
380 that->processed_io_events_ = true; | 377 that->processed_io_events_ = true; |
381 // Tell libevent to break out of inner loop. | 378 // Tell libevent to break out of inner loop. |
382 event_base_loopbreak(that->event_base_); | 379 event_base_loopbreak(that->event_base_); |
383 } | 380 } |
384 | 381 |
385 } // namespace base | 382 } // namespace base |
OLD | NEW |