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 #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 |
| 99 void RemoveLayeredPool(LayeredPool* layered_pool); |
| 100 |
95 // Returns true when Init() has completed successfully. | 101 // Returns true when Init() has completed successfully. |
96 bool is_initialized() const { return is_initialized_; } | 102 bool is_initialized() const { return is_initialized_; } |
97 | 103 |
98 // Returns the time tick when Init() was called. | 104 // Returns the time tick when Init() was called. |
99 base::TimeTicks init_time() const { return init_time_; } | 105 base::TimeTicks init_time() const { return init_time_; } |
100 | 106 |
101 // Returns the time between Init() and when is_initialized() becomes true. | 107 // Returns the time between Init() and when is_initialized() becomes true. |
102 base::TimeDelta setup_time() const { return setup_time_; } | 108 base::TimeDelta setup_time() const { return setup_time_; } |
103 | 109 |
104 // Used by ClientSocketPool to initialize the ClientSocketHandle. | 110 // 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 | 163 // Resets the state of the ClientSocketHandle. |cancel| indicates whether or |
158 // not to try to cancel the request with the ClientSocketPool. Does not | 164 // not to try to cancel the request with the ClientSocketPool. Does not |
159 // reset the supplemental error state. | 165 // reset the supplemental error state. |
160 void ResetInternal(bool cancel); | 166 void ResetInternal(bool cancel); |
161 | 167 |
162 // Resets the supplemental error state. | 168 // Resets the supplemental error state. |
163 void ResetErrorState(); | 169 void ResetErrorState(); |
164 | 170 |
165 bool is_initialized_; | 171 bool is_initialized_; |
166 ClientSocketPool* pool_; | 172 ClientSocketPool* pool_; |
| 173 LayeredPool* layered_pool_; |
167 scoped_ptr<StreamSocket> socket_; | 174 scoped_ptr<StreamSocket> socket_; |
168 std::string group_name_; | 175 std::string group_name_; |
169 bool is_reused_; | 176 bool is_reused_; |
170 CompletionCallback callback_; | 177 CompletionCallback callback_; |
171 CompletionCallback user_callback_; | 178 CompletionCallback user_callback_; |
172 base::TimeDelta idle_time_; | 179 base::TimeDelta idle_time_; |
173 int pool_id_; // See ClientSocketPool::ReleaseSocket() for an explanation. | 180 int pool_id_; // See ClientSocketPool::ReleaseSocket() for an explanation. |
174 bool is_ssl_error_; | 181 bool is_ssl_error_; |
175 HttpResponseInfo ssl_error_response_info_; | 182 HttpResponseInfo ssl_error_response_info_; |
176 scoped_ptr<ClientSocketHandle> pending_http_proxy_connection_; | 183 scoped_ptr<ClientSocketHandle> pending_http_proxy_connection_; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 user_callback_ = callback; | 215 user_callback_ = callback; |
209 } else { | 216 } else { |
210 HandleInitCompletion(rv); | 217 HandleInitCompletion(rv); |
211 } | 218 } |
212 return rv; | 219 return rv; |
213 } | 220 } |
214 | 221 |
215 } // namespace net | 222 } // namespace net |
216 | 223 |
217 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ | 224 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ |
OLD | NEW |