OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CLIENT_SOCKET_HANDLE_H_ | 5 #ifndef NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ |
6 #define NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ | 6 #define NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 #include "net/base/completion_callback.h" | 15 #include "net/base/completion_callback.h" |
16 #include "net/base/ip_endpoint.h" | 16 #include "net/base/ip_endpoint.h" |
17 #include "net/base/load_states.h" | 17 #include "net/base/load_states.h" |
18 #include "net/base/load_timing_info.h" | 18 #include "net/base/load_timing_info.h" |
19 #include "net/base/net_errors.h" | 19 #include "net/base/net_errors.h" |
20 #include "net/base/net_export.h" | 20 #include "net/base/net_export.h" |
21 #include "net/base/request_priority.h" | 21 #include "net/base/request_priority.h" |
22 #include "net/http/http_response_info.h" | 22 #include "net/http/http_response_info.h" |
23 #include "net/log/net_log.h" | 23 #include "net/log/net_log_source.h" |
| 24 #include "net/log/net_log_with_source.h" |
24 #include "net/socket/client_socket_pool.h" | 25 #include "net/socket/client_socket_pool.h" |
25 #include "net/socket/connection_attempts.h" | 26 #include "net/socket/connection_attempts.h" |
26 #include "net/socket/stream_socket.h" | 27 #include "net/socket/stream_socket.h" |
27 | 28 |
28 namespace net { | 29 namespace net { |
29 | 30 |
30 // A container for a StreamSocket. | 31 // A container for a StreamSocket. |
31 // | 32 // |
32 // The handle's |group_name| uniquely identifies the origin and type of the | 33 // The handle's |group_name| uniquely identifies the origin and type of the |
33 // connection. It is used by the ClientSocketPool to group similar connected | 34 // connection. It is used by the ClientSocketPool to group similar connected |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 CompletionCallback user_callback_; | 213 CompletionCallback user_callback_; |
213 base::TimeDelta idle_time_; | 214 base::TimeDelta idle_time_; |
214 int pool_id_; // See ClientSocketPool::ReleaseSocket() for an explanation. | 215 int pool_id_; // See ClientSocketPool::ReleaseSocket() for an explanation. |
215 bool is_ssl_error_; | 216 bool is_ssl_error_; |
216 HttpResponseInfo ssl_error_response_info_; | 217 HttpResponseInfo ssl_error_response_info_; |
217 std::unique_ptr<ClientSocketHandle> pending_http_proxy_connection_; | 218 std::unique_ptr<ClientSocketHandle> pending_http_proxy_connection_; |
218 std::vector<ConnectionAttempt> connection_attempts_; | 219 std::vector<ConnectionAttempt> connection_attempts_; |
219 base::TimeTicks init_time_; | 220 base::TimeTicks init_time_; |
220 base::TimeDelta setup_time_; | 221 base::TimeDelta setup_time_; |
221 | 222 |
222 NetLog::Source requesting_source_; | 223 NetLogSource requesting_source_; |
223 | 224 |
224 // Timing information is set when a connection is successfully established. | 225 // Timing information is set when a connection is successfully established. |
225 LoadTimingInfo::ConnectTiming connect_timing_; | 226 LoadTimingInfo::ConnectTiming connect_timing_; |
226 | 227 |
227 DISALLOW_COPY_AND_ASSIGN(ClientSocketHandle); | 228 DISALLOW_COPY_AND_ASSIGN(ClientSocketHandle); |
228 }; | 229 }; |
229 | 230 |
230 // Template function implementation: | 231 // Template function implementation: |
231 template <typename PoolType> | 232 template <typename PoolType> |
232 int ClientSocketHandle::Init( | 233 int ClientSocketHandle::Init( |
(...skipping 18 matching lines...) Expand all Loading... |
251 user_callback_ = callback; | 252 user_callback_ = callback; |
252 } else { | 253 } else { |
253 HandleInitCompletion(rv); | 254 HandleInitCompletion(rv); |
254 } | 255 } |
255 return rv; | 256 return rv; |
256 } | 257 } |
257 | 258 |
258 } // namespace net | 259 } // namespace net |
259 | 260 |
260 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ | 261 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ |
OLD | NEW |