| 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/thread_checker.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_with_source.h" | 21 #include "net/log/net_log_with_source.h" |
| 22 #include "net/socket/socket_descriptor.h" | 22 #include "net/socket/socket_descriptor.h" |
| 23 #include "net/socket/socket_performance_watcher.h" | 23 #include "net/socket/socket_performance_watcher.h" |
| 24 | 24 |
| 25 namespace net { | 25 namespace net { |
| 26 | 26 |
| 27 class AddressList; | 27 class AddressList; |
| 28 class IOBuffer; | 28 class IOBuffer; |
| 29 class IPEndPoint; | 29 class IPEndPoint; |
| 30 class NetLog; | 30 class NetLog; |
| 31 struct NetLogSource; | 31 struct NetLogSource; |
| 32 | 32 |
| 33 class NET_EXPORT TCPSocketWin : NON_EXPORTED_BASE(public base::NonThreadSafe), | 33 class NET_EXPORT TCPSocketWin : public base::win::ObjectWatcher::Delegate { |
| 34 public base::win::ObjectWatcher::Delegate { | |
| 35 public: | 34 public: |
| 36 TCPSocketWin( | 35 TCPSocketWin( |
| 37 std::unique_ptr<SocketPerformanceWatcher> socket_performance_watcher, | 36 std::unique_ptr<SocketPerformanceWatcher> socket_performance_watcher, |
| 38 NetLog* net_log, | 37 NetLog* net_log, |
| 39 const NetLogSource& source); | 38 const NetLogSource& source); |
| 40 ~TCPSocketWin() override; | 39 ~TCPSocketWin() override; |
| 41 | 40 |
| 42 int Open(AddressFamily family); | 41 int Open(AddressFamily family); |
| 43 | 42 |
| 44 // Takes ownership of |socket|, which is known to already be connected to the | 43 // Takes ownership of |socket|, which is known to already be connected to the |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 CompletionCallback write_callback_; | 178 CompletionCallback write_callback_; |
| 180 | 179 |
| 181 std::unique_ptr<IPEndPoint> peer_address_; | 180 std::unique_ptr<IPEndPoint> peer_address_; |
| 182 // The OS error that a connect attempt last completed with. | 181 // The OS error that a connect attempt last completed with. |
| 183 int connect_os_error_; | 182 int connect_os_error_; |
| 184 | 183 |
| 185 bool logging_multiple_connect_attempts_; | 184 bool logging_multiple_connect_attempts_; |
| 186 | 185 |
| 187 NetLogWithSource net_log_; | 186 NetLogWithSource net_log_; |
| 188 | 187 |
| 188 THREAD_CHECKER(thread_checker_); |
| 189 |
| 189 DISALLOW_COPY_AND_ASSIGN(TCPSocketWin); | 190 DISALLOW_COPY_AND_ASSIGN(TCPSocketWin); |
| 190 }; | 191 }; |
| 191 | 192 |
| 192 } // namespace net | 193 } // namespace net |
| 193 | 194 |
| 194 #endif // NET_SOCKET_TCP_SOCKET_WIN_H_ | 195 #endif // NET_SOCKET_TCP_SOCKET_WIN_H_ |
| OLD | NEW |