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_WIN_H_ | 5 #ifndef NET_SOCKET_TCP_SOCKET_WIN_H_ |
6 #define NET_SOCKET_TCP_SOCKET_WIN_H_ | 6 #define NET_SOCKET_TCP_SOCKET_WIN_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <winsock2.h> | 9 #include <winsock2.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 | 12 |
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/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/threading/non_thread_safe.h" | 16 #include "base/threading/non_thread_safe.h" |
17 #include "base/win/object_watcher.h" | 17 #include "base/win/object_watcher.h" |
18 #include "net/base/address_family.h" | 18 #include "net/base/address_family.h" |
19 #include "net/base/completion_callback.h" | 19 #include "net/base/completion_callback.h" |
20 #include "net/base/net_export.h" | 20 #include "net/base/net_export.h" |
21 #include "net/log/net_log.h" | 21 #include "net/log/net_log_with_source.h" |
22 #include "net/socket/socket_performance_watcher.h" | 22 #include "net/socket/socket_performance_watcher.h" |
23 | 23 |
24 namespace net { | 24 namespace net { |
25 | 25 |
26 class AddressList; | 26 class AddressList; |
27 class IOBuffer; | 27 class IOBuffer; |
28 class IPEndPoint; | 28 class IPEndPoint; |
| 29 class NetLog; |
| 30 struct NetLogSource; |
29 | 31 |
30 class NET_EXPORT TCPSocketWin : NON_EXPORTED_BASE(public base::NonThreadSafe), | 32 class NET_EXPORT TCPSocketWin : NON_EXPORTED_BASE(public base::NonThreadSafe), |
31 public base::win::ObjectWatcher::Delegate { | 33 public base::win::ObjectWatcher::Delegate { |
32 public: | 34 public: |
33 TCPSocketWin( | 35 TCPSocketWin( |
34 std::unique_ptr<SocketPerformanceWatcher> socket_performance_watcher, | 36 std::unique_ptr<SocketPerformanceWatcher> socket_performance_watcher, |
35 NetLog* net_log, | 37 NetLog* net_log, |
36 const NetLog::Source& source); | 38 const NetLogSource& source); |
37 ~TCPSocketWin() override; | 39 ~TCPSocketWin() override; |
38 | 40 |
39 int Open(AddressFamily family); | 41 int Open(AddressFamily family); |
40 | 42 |
41 // Both AdoptConnectedSocket and AdoptListenSocket take ownership of an | 43 // Both AdoptConnectedSocket and AdoptListenSocket take ownership of an |
42 // existing socket. AdoptConnectedSocket takes an already connected | 44 // existing socket. AdoptConnectedSocket takes an already connected |
43 // socket. AdoptListenSocket takes a socket that is intended to accept | 45 // socket. AdoptListenSocket takes a socket that is intended to accept |
44 // connection. In some sense, AdoptListenSocket is more similar to Open. | 46 // connection. In some sense, AdoptListenSocket is more similar to Open. |
45 int AdoptConnectedSocket(SOCKET socket, const IPEndPoint& peer_address); | 47 int AdoptConnectedSocket(SOCKET socket, const IPEndPoint& peer_address); |
46 int AdoptListenSocket(SOCKET socket); | 48 int AdoptListenSocket(SOCKET socket); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 bool logging_multiple_connect_attempts_; | 167 bool logging_multiple_connect_attempts_; |
166 | 168 |
167 NetLogWithSource net_log_; | 169 NetLogWithSource net_log_; |
168 | 170 |
169 DISALLOW_COPY_AND_ASSIGN(TCPSocketWin); | 171 DISALLOW_COPY_AND_ASSIGN(TCPSocketWin); |
170 }; | 172 }; |
171 | 173 |
172 } // namespace net | 174 } // namespace net |
173 | 175 |
174 #endif // NET_SOCKET_TCP_SOCKET_WIN_H_ | 176 #endif // NET_SOCKET_TCP_SOCKET_WIN_H_ |
OLD | NEW |