OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // | 85 // |
86 // NOTE: To prevent the socket from being kept alive, be sure to call its | 86 // NOTE: To prevent the socket from being kept alive, be sure to call its |
87 // Disconnect method. This will result in the ClientSocketPool deleting the | 87 // Disconnect method. This will result in the ClientSocketPool deleting the |
88 // StreamSocket. | 88 // StreamSocket. |
89 void Reset(); | 89 void Reset(); |
90 | 90 |
91 // Used after Init() is called, but before the ClientSocketPool has | 91 // Used after Init() is called, but before the ClientSocketPool has |
92 // initialized the ClientSocketHandle. | 92 // initialized the ClientSocketHandle. |
93 LoadState GetLoadState() const; | 93 LoadState GetLoadState() const; |
94 | 94 |
| 95 bool IsPoolStalled() const; |
| 96 |
| 97 void AddLayeredPool(LayeredPool* layered_pool); |
| 98 |
95 // Returns true when Init() has completed successfully. | 99 // Returns true when Init() has completed successfully. |
96 bool is_initialized() const { return is_initialized_; } | 100 bool is_initialized() const { return is_initialized_; } |
97 | 101 |
98 // Returns the time tick when Init() was called. | 102 // Returns the time tick when Init() was called. |
99 base::TimeTicks init_time() const { return init_time_; } | 103 base::TimeTicks init_time() const { return init_time_; } |
100 | 104 |
101 // Returns the time between Init() and when is_initialized() becomes true. | 105 // Returns the time between Init() and when is_initialized() becomes true. |
102 base::TimeDelta setup_time() const { return setup_time_; } | 106 base::TimeDelta setup_time() const { return setup_time_; } |
103 | 107 |
104 // Used by ClientSocketPool to initialize the ClientSocketHandle. | 108 // Used by ClientSocketPool to initialize the ClientSocketHandle. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 // Resets the state of the ClientSocketHandle. |cancel| indicates whether or | 161 // Resets the state of the ClientSocketHandle. |cancel| indicates whether or |
158 // not to try to cancel the request with the ClientSocketPool. Does not | 162 // not to try to cancel the request with the ClientSocketPool. Does not |
159 // reset the supplemental error state. | 163 // reset the supplemental error state. |
160 void ResetInternal(bool cancel); | 164 void ResetInternal(bool cancel); |
161 | 165 |
162 // Resets the supplemental error state. | 166 // Resets the supplemental error state. |
163 void ResetErrorState(); | 167 void ResetErrorState(); |
164 | 168 |
165 bool is_initialized_; | 169 bool is_initialized_; |
166 ClientSocketPool* pool_; | 170 ClientSocketPool* pool_; |
| 171 LayeredPool* layered_pool_; |
167 scoped_ptr<StreamSocket> socket_; | 172 scoped_ptr<StreamSocket> socket_; |
168 std::string group_name_; | 173 std::string group_name_; |
169 bool is_reused_; | 174 bool is_reused_; |
170 OldCompletionCallbackImpl<ClientSocketHandle> callback_; | 175 OldCompletionCallbackImpl<ClientSocketHandle> callback_; |
171 OldCompletionCallback* user_callback_; | 176 OldCompletionCallback* user_callback_; |
172 base::TimeDelta idle_time_; | 177 base::TimeDelta idle_time_; |
173 int pool_id_; // See ClientSocketPool::ReleaseSocket() for an explanation. | 178 int pool_id_; // See ClientSocketPool::ReleaseSocket() for an explanation. |
174 bool is_ssl_error_; | 179 bool is_ssl_error_; |
175 HttpResponseInfo ssl_error_response_info_; | 180 HttpResponseInfo ssl_error_response_info_; |
176 scoped_ptr<ClientSocketHandle> pending_http_proxy_connection_; | 181 scoped_ptr<ClientSocketHandle> pending_http_proxy_connection_; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 user_callback_ = callback; | 213 user_callback_ = callback; |
209 } else { | 214 } else { |
210 HandleInitCompletion(rv); | 215 HandleInitCompletion(rv); |
211 } | 216 } |
212 return rv; | 217 return rv; |
213 } | 218 } |
214 | 219 |
215 } // namespace net | 220 } // namespace net |
216 | 221 |
217 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ | 222 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ |
OLD | NEW |