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 #ifndef NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ | 5 #ifndef NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ |
6 #define NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ | 6 #define NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/threading/non_thread_safe.h" | 12 #include "base/threading/non_thread_safe.h" |
13 #include "net/base/address_list.h" | 13 #include "net/base/address_list.h" |
14 #include "net/base/completion_callback.h" | 14 #include "net/base/completion_callback.h" |
15 #include "net/base/net_log.h" | 15 #include "net/base/net_log.h" |
16 #include "net/socket/stream_socket.h" | 16 #include "net/socket/stream_socket.h" |
17 | 17 |
18 struct event; // From libevent | 18 struct event; // From libevent |
19 | 19 |
20 namespace net { | 20 namespace net { |
21 | 21 |
22 class BoundNetLog; | 22 class BoundNetLog; |
23 | 23 |
24 // A client socket that uses TCP as the transport layer. | 24 // A client socket that uses TCP as the transport layer. |
25 class TCPClientSocketLibevent : public StreamSocket, base::NonThreadSafe { | 25 class NET_TEST TCPClientSocketLibevent : public StreamSocket, |
26 base::NonThreadSafe { | |
wtc
2011/06/24 16:36:26
Should we also add 'public' to base::NonThreadSafe
| |
26 public: | 27 public: |
27 // The IP address(es) and port number to connect to. The TCP socket will try | 28 // The IP address(es) and port number to connect to. The TCP socket will try |
28 // each IP address in the list until it succeeds in establishing a | 29 // each IP address in the list until it succeeds in establishing a |
29 // connection. | 30 // connection. |
30 TCPClientSocketLibevent(const AddressList& addresses, | 31 TCPClientSocketLibevent(const AddressList& addresses, |
31 net::NetLog* net_log, | 32 net::NetLog* net_log, |
32 const net::NetLog::Source& source); | 33 const net::NetLog::Source& source); |
33 | 34 |
34 virtual ~TCPClientSocketLibevent(); | 35 virtual ~TCPClientSocketLibevent(); |
35 | 36 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
196 | 197 |
197 // True when TCP FastOpen is in use and we have done the connect. | 198 // True when TCP FastOpen is in use and we have done the connect. |
198 bool tcp_fastopen_connected_; | 199 bool tcp_fastopen_connected_; |
199 | 200 |
200 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); | 201 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); |
201 }; | 202 }; |
202 | 203 |
203 } // namespace net | 204 } // namespace net |
204 | 205 |
205 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ | 206 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ |
OLD | NEW |