| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 165 |
| 166 // Resets the supplemental error state. | 166 // Resets the supplemental error state. |
| 167 void ResetErrorState(); | 167 void ResetErrorState(); |
| 168 | 168 |
| 169 bool is_initialized_; | 169 bool is_initialized_; |
| 170 ClientSocketPool* pool_; | 170 ClientSocketPool* pool_; |
| 171 LayeredPool* layered_pool_; | 171 LayeredPool* layered_pool_; |
| 172 scoped_ptr<StreamSocket> socket_; | 172 scoped_ptr<StreamSocket> socket_; |
| 173 std::string group_name_; | 173 std::string group_name_; |
| 174 bool is_reused_; | 174 bool is_reused_; |
| 175 OldCompletionCallbackImpl<ClientSocketHandle> callback_; | 175 CompletionCallback callback_; |
| 176 CompletionCallback user_callback_; | 176 CompletionCallback user_callback_; |
| 177 base::TimeDelta idle_time_; | 177 base::TimeDelta idle_time_; |
| 178 int pool_id_; // See ClientSocketPool::ReleaseSocket() for an explanation. | 178 int pool_id_; // See ClientSocketPool::ReleaseSocket() for an explanation. |
| 179 bool is_ssl_error_; | 179 bool is_ssl_error_; |
| 180 HttpResponseInfo ssl_error_response_info_; | 180 HttpResponseInfo ssl_error_response_info_; |
| 181 scoped_ptr<ClientSocketHandle> pending_http_proxy_connection_; | 181 scoped_ptr<ClientSocketHandle> pending_http_proxy_connection_; |
| 182 base::TimeTicks init_time_; | 182 base::TimeTicks init_time_; |
| 183 base::TimeDelta setup_time_; | 183 base::TimeDelta setup_time_; |
| 184 | 184 |
| 185 NetLog::Source requesting_source_; | 185 NetLog::Source requesting_source_; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 201 // Note that this will result in a compile error if the SocketParams has not | 201 // Note that this will result in a compile error if the SocketParams has not |
| 202 // been registered for the PoolType via REGISTER_SOCKET_PARAMS_FOR_POOL | 202 // been registered for the PoolType via REGISTER_SOCKET_PARAMS_FOR_POOL |
| 203 // (defined in client_socket_pool.h). | 203 // (defined in client_socket_pool.h). |
| 204 CheckIsValidSocketParamsForPool<PoolType, SocketParams>(); | 204 CheckIsValidSocketParamsForPool<PoolType, SocketParams>(); |
| 205 ResetInternal(true); | 205 ResetInternal(true); |
| 206 ResetErrorState(); | 206 ResetErrorState(); |
| 207 pool_ = pool; | 207 pool_ = pool; |
| 208 group_name_ = group_name; | 208 group_name_ = group_name; |
| 209 init_time_ = base::TimeTicks::Now(); | 209 init_time_ = base::TimeTicks::Now(); |
| 210 int rv = pool_->RequestSocket( | 210 int rv = pool_->RequestSocket( |
| 211 group_name, &socket_params, priority, this, &callback_, net_log); | 211 group_name, &socket_params, priority, this, callback_, net_log); |
| 212 if (rv == ERR_IO_PENDING) { | 212 if (rv == ERR_IO_PENDING) { |
| 213 user_callback_ = callback; | 213 user_callback_ = callback; |
| 214 } else { | 214 } else { |
| 215 HandleInitCompletion(rv); | 215 HandleInitCompletion(rv); |
| 216 } | 216 } |
| 217 return rv; | 217 return rv; |
| 218 } | 218 } |
| 219 | 219 |
| 220 } // namespace net | 220 } // namespace net |
| 221 | 221 |
| 222 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ | 222 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ |
| OLD | NEW |