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