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_POSIX_H_ | 5 #ifndef NET_SOCKET_TCP_SOCKET_POSIX_H_ |
6 #define NET_SOCKET_TCP_SOCKET_POSIX_H_ | 6 #define NET_SOCKET_TCP_SOCKET_POSIX_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "net/base/address_family.h" | 16 #include "net/base/address_family.h" |
17 #include "net/base/completion_callback.h" | 17 #include "net/base/completion_callback.h" |
18 #include "net/base/net_export.h" | 18 #include "net/base/net_export.h" |
19 #include "net/log/net_log.h" | 19 #include "net/log/net_log_with_source.h" |
20 #include "net/socket/socket_performance_watcher.h" | 20 #include "net/socket/socket_performance_watcher.h" |
21 | 21 |
22 namespace base { | 22 namespace base { |
23 class TickClock; | 23 class TickClock; |
24 } | 24 } |
25 | 25 |
26 namespace net { | 26 namespace net { |
27 | 27 |
28 class AddressList; | 28 class AddressList; |
29 class IOBuffer; | 29 class IOBuffer; |
30 class IPEndPoint; | 30 class IPEndPoint; |
31 class SocketPosix; | 31 class SocketPosix; |
| 32 class NetLog; |
| 33 struct NetLogSource; |
32 | 34 |
33 class NET_EXPORT TCPSocketPosix { | 35 class NET_EXPORT TCPSocketPosix { |
34 public: | 36 public: |
35 // |socket_performance_watcher| is notified of the performance metrics related | 37 // |socket_performance_watcher| is notified of the performance metrics related |
36 // to this socket. |socket_performance_watcher| may be null. | 38 // to this socket. |socket_performance_watcher| may be null. |
37 TCPSocketPosix( | 39 TCPSocketPosix( |
38 std::unique_ptr<SocketPerformanceWatcher> socket_performance_watcher, | 40 std::unique_ptr<SocketPerformanceWatcher> socket_performance_watcher, |
39 NetLog* net_log, | 41 NetLog* net_log, |
40 const NetLog::Source& source); | 42 const NetLogSource& source); |
41 virtual ~TCPSocketPosix(); | 43 virtual ~TCPSocketPosix(); |
42 | 44 |
43 int Open(AddressFamily family); | 45 int Open(AddressFamily family); |
44 // Takes ownership of |socket_fd|. | 46 // Takes ownership of |socket_fd|. |
45 int AdoptConnectedSocket(int socket_fd, const IPEndPoint& peer_address); | 47 int AdoptConnectedSocket(int socket_fd, const IPEndPoint& peer_address); |
46 | 48 |
47 int Bind(const IPEndPoint& address); | 49 int Bind(const IPEndPoint& address); |
48 | 50 |
49 int Listen(int backlog); | 51 int Listen(int backlog); |
50 int Accept(std::unique_ptr<TCPSocketPosix>* socket, | 52 int Accept(std::unique_ptr<TCPSocketPosix>* socket, |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 bool logging_multiple_connect_attempts_; | 249 bool logging_multiple_connect_attempts_; |
248 | 250 |
249 NetLogWithSource net_log_; | 251 NetLogWithSource net_log_; |
250 | 252 |
251 DISALLOW_COPY_AND_ASSIGN(TCPSocketPosix); | 253 DISALLOW_COPY_AND_ASSIGN(TCPSocketPosix); |
252 }; | 254 }; |
253 | 255 |
254 } // namespace net | 256 } // namespace net |
255 | 257 |
256 #endif // NET_SOCKET_TCP_SOCKET_POSIX_H_ | 258 #endif // NET_SOCKET_TCP_SOCKET_POSIX_H_ |
OLD | NEW |