OLD | NEW |
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 #ifndef NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ | 5 #ifndef NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ |
6 #define NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ | 6 #define NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 FAST_OPEN_NO_SYN_DATA_ACK, | 125 FAST_OPEN_NO_SYN_DATA_ACK, |
126 | 126 |
127 // An attempt to do a fast open failed (FAST_OPEN_SLOW_CONNECT_RETURN) | 127 // An attempt to do a fast open failed (FAST_OPEN_SLOW_CONNECT_RETURN) |
128 // and we later discovered that the server had nacked initial data. This | 128 // and we later discovered that the server had nacked initial data. This |
129 // is the expected case results for FAST_OPEN_SLOW_CONNECT_RETURN. | 129 // is the expected case results for FAST_OPEN_SLOW_CONNECT_RETURN. |
130 FAST_OPEN_NO_SYN_DATA_NACK, | 130 FAST_OPEN_NO_SYN_DATA_NACK, |
131 | 131 |
132 // An attempt to do a fast open failed (FAST_OPEN_SLOW_CONNECT_RETURN) | 132 // An attempt to do a fast open failed (FAST_OPEN_SLOW_CONNECT_RETURN) |
133 // and our later probe for ack/nack state failed. | 133 // and our later probe for ack/nack state failed. |
134 FAST_OPEN_NO_SYN_DATA_FAILED, | 134 FAST_OPEN_NO_SYN_DATA_FAILED, |
135 | |
136 FAST_OPEN_MAX_VALUE | 135 FAST_OPEN_MAX_VALUE |
137 }; | 136 }; |
138 | 137 |
139 // Watcher simply forwards notifications to Closure objects set via the | 138 // Watcher simply forwards notifications to Closure objects set via the |
140 // constructor. | 139 // constructor. |
141 class Watcher: public base::MessageLoopForIO::Watcher { | 140 class Watcher : public base::MessageLoopForIO::Watcher { |
142 public: | 141 public: |
143 Watcher(const base::Closure& read_ready_callback, | 142 Watcher(const base::Closure& read_ready_callback, |
144 const base::Closure& write_ready_callback); | 143 const base::Closure& write_ready_callback); |
145 virtual ~Watcher(); | 144 virtual ~Watcher(); |
146 | 145 |
147 // base::MessageLoopForIO::Watcher methods. | 146 // base::MessageLoopForIO::Watcher methods. |
148 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE; | 147 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE; |
149 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE; | 148 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE; |
150 | 149 |
151 private: | 150 private: |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 bool logging_multiple_connect_attempts_; | 225 bool logging_multiple_connect_attempts_; |
227 | 226 |
228 BoundNetLog net_log_; | 227 BoundNetLog net_log_; |
229 | 228 |
230 DISALLOW_COPY_AND_ASSIGN(TCPSocketLibevent); | 229 DISALLOW_COPY_AND_ASSIGN(TCPSocketLibevent); |
231 }; | 230 }; |
232 | 231 |
233 } // namespace net | 232 } // namespace net |
234 | 233 |
235 #endif // NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ | 234 #endif // NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ |
OLD | NEW |