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

Side by Side Diff: net/tools/epoll_server/epoll_server.cc

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « net/third_party/nss/ssl/sslver.c ('k') | net/tools/flip_server/acceptor_thread.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "net/tools/epoll_server/epoll_server.h" 5 #include "net/tools/epoll_server/epoll_server.h"
6 6
7 #include <unistd.h> // For read, pipe, close and write. 7 #include <unistd.h> // For read, pipe, close and write.
8 #include <stdlib.h> // for abort 8 #include <stdlib.h> // for abort
9 #include <errno.h> // for errno and strerror_r 9 #include <errno.h> // for errno and strerror_r
10 #include <algorithm> 10 #include <algorithm>
11 #include <utility> 11 #include <utility>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/timer/timer.h" 15 #include "base/time/time.h"
16 16
17 // Design notes: An efficient implementation of ready list has the following 17 // Design notes: An efficient implementation of ready list has the following
18 // desirable properties: 18 // desirable properties:
19 // 19 //
20 // A. O(1) insertion into/removal from the list in any location. 20 // A. O(1) insertion into/removal from the list in any location.
21 // B. Once the callback is found by hash lookup using the fd, the lookup of 21 // B. Once the callback is found by hash lookup using the fd, the lookup of
22 // corresponding entry in the list is O(1). 22 // corresponding entry in the list is O(1).
23 // C. Safe insertion into/removal from the list during list iteration. (The 23 // C. Safe insertion into/removal from the list during list iteration. (The
24 // ready list's purpose is to enable completely event driven I/O model. 24 // ready list's purpose is to enable completely event driven I/O model.
25 // Thus, all the interesting bits happen in the callback. It is critical 25 // Thus, all the interesting bits happen in the callback. It is critical
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 811
812 // If the alarm was registered, unregister it. 812 // If the alarm was registered, unregister it.
813 void EpollAlarm::UnregisterIfRegistered() { 813 void EpollAlarm::UnregisterIfRegistered() {
814 if (!registered_) { 814 if (!registered_) {
815 return; 815 return;
816 } 816 }
817 eps_->UnregisterAlarm(token_); 817 eps_->UnregisterAlarm(token_);
818 } 818 }
819 819
820 } // namespace net 820 } // namespace net
OLDNEW
« no previous file with comments | « net/third_party/nss/ssl/sslver.c ('k') | net/tools/flip_server/acceptor_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698