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

Side by Side Diff: base/message_loop/message_pump_libevent.cc

Issue 1531573008: move libevent into base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix shim path Created 5 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 unified diff | Download patch
« no previous file with comments | « base/base_nacl.gyp ('k') | base/message_loop/message_pump_libevent_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_loop/message_pump_libevent.h" 5 #include "base/message_loop/message_pump_libevent.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <unistd.h> 8 #include <unistd.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/files/file_util.h" 12 #include "base/files/file_util.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/observer_list.h" 15 #include "base/observer_list.h"
16 #include "base/posix/eintr_wrapper.h" 16 #include "base/posix/eintr_wrapper.h"
17 #include "base/third_party/libevent/event.h"
17 #include "base/time/time.h" 18 #include "base/time/time.h"
18 #include "base/trace_event/trace_event.h" 19 #include "base/trace_event/trace_event.h"
19 #include "third_party/libevent/event.h"
20 20
21 #if defined(OS_MACOSX) 21 #if defined(OS_MACOSX)
22 #include "base/mac/scoped_nsautorelease_pool.h" 22 #include "base/mac/scoped_nsautorelease_pool.h"
23 #endif 23 #endif
24 24
25 // Lifecycle of struct event 25 // Lifecycle of struct event
26 // Libevent uses two main data structures: 26 // Libevent uses two main data structures:
27 // struct event_base (of which there is one per message pump), and 27 // struct event_base (of which there is one per message pump), and
28 // struct event (of which there is roughly one per socket). 28 // struct event (of which there is roughly one per socket).
29 // The socket's struct event is created in 29 // The socket's struct event is created in
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 // Remove and discard the wakeup byte. 373 // Remove and discard the wakeup byte.
374 char buf; 374 char buf;
375 int nread = HANDLE_EINTR(read(socket, &buf, 1)); 375 int nread = HANDLE_EINTR(read(socket, &buf, 1));
376 DCHECK_EQ(nread, 1); 376 DCHECK_EQ(nread, 1);
377 that->processed_io_events_ = true; 377 that->processed_io_events_ = true;
378 // Tell libevent to break out of inner loop. 378 // Tell libevent to break out of inner loop.
379 event_base_loopbreak(that->event_base_); 379 event_base_loopbreak(that->event_base_);
380 } 380 }
381 381
382 } // namespace base 382 } // namespace base
OLDNEW
« no previous file with comments | « base/base_nacl.gyp ('k') | base/message_loop/message_pump_libevent_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698