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 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // succeeds in establishing a connection. The corresponding log will have | 101 // succeeds in establishing a connection. The corresponding log will have |
102 // multiple NetLogEventType::TCP_CONNECT_ATTEMPT entries nested within a | 102 // multiple NetLogEventType::TCP_CONNECT_ATTEMPT entries nested within a |
103 // NetLogEventType::TCP_CONNECT. These methods set the start/end of | 103 // NetLogEventType::TCP_CONNECT. These methods set the start/end of |
104 // NetLogEventType::TCP_CONNECT. | 104 // NetLogEventType::TCP_CONNECT. |
105 // | 105 // |
106 // TODO(yzshen): Change logging format and let TCPClientSocket log the | 106 // TODO(yzshen): Change logging format and let TCPClientSocket log the |
107 // start/end of a series of connect attempts itself. | 107 // start/end of a series of connect attempts itself. |
108 void StartLoggingMultipleConnectAttempts(const AddressList& addresses); | 108 void StartLoggingMultipleConnectAttempts(const AddressList& addresses); |
109 void EndLoggingMultipleConnectAttempts(int net_error); | 109 void EndLoggingMultipleConnectAttempts(int net_error); |
110 | 110 |
111 const BoundNetLog& net_log() const { return net_log_; } | 111 const NetLogWithSource& net_log() const { return net_log_; } |
112 | 112 |
113 private: | 113 private: |
114 class Core; | 114 class Core; |
115 | 115 |
116 // base::ObjectWatcher::Delegate implementation. | 116 // base::ObjectWatcher::Delegate implementation. |
117 void OnObjectSignaled(HANDLE object) override; | 117 void OnObjectSignaled(HANDLE object) override; |
118 | 118 |
119 int AcceptInternal(std::unique_ptr<TCPSocketWin>* socket, | 119 int AcceptInternal(std::unique_ptr<TCPSocketWin>* socket, |
120 IPEndPoint* address); | 120 IPEndPoint* address); |
121 | 121 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 157 |
158 // External callback; called when write is complete. | 158 // External callback; called when write is complete. |
159 CompletionCallback write_callback_; | 159 CompletionCallback write_callback_; |
160 | 160 |
161 std::unique_ptr<IPEndPoint> peer_address_; | 161 std::unique_ptr<IPEndPoint> peer_address_; |
162 // The OS error that a connect attempt last completed with. | 162 // The OS error that a connect attempt last completed with. |
163 int connect_os_error_; | 163 int connect_os_error_; |
164 | 164 |
165 bool logging_multiple_connect_attempts_; | 165 bool logging_multiple_connect_attempts_; |
166 | 166 |
167 BoundNetLog net_log_; | 167 NetLogWithSource net_log_; |
168 | 168 |
169 DISALLOW_COPY_AND_ASSIGN(TCPSocketWin); | 169 DISALLOW_COPY_AND_ASSIGN(TCPSocketWin); |
170 }; | 170 }; |
171 | 171 |
172 } // namespace net | 172 } // namespace net |
173 | 173 |
174 #endif // NET_SOCKET_TCP_SOCKET_WIN_H_ | 174 #endif // NET_SOCKET_TCP_SOCKET_WIN_H_ |
OLD | NEW |