| 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_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ | 5 #ifndef NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ |
| 6 #define NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ | 6 #define NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // a standard net error code will be returned. | 149 // a standard net error code will be returned. |
| 150 virtual int ConnectInternal() OVERRIDE; | 150 virtual int ConnectInternal() OVERRIDE; |
| 151 | 151 |
| 152 scoped_refptr<HttpProxySocketParams> params_; | 152 scoped_refptr<HttpProxySocketParams> params_; |
| 153 TransportClientSocketPool* const transport_pool_; | 153 TransportClientSocketPool* const transport_pool_; |
| 154 SSLClientSocketPool* const ssl_pool_; | 154 SSLClientSocketPool* const ssl_pool_; |
| 155 HostResolver* const resolver_; | 155 HostResolver* const resolver_; |
| 156 | 156 |
| 157 State next_state_; | 157 State next_state_; |
| 158 CompletionCallback callback_; | 158 CompletionCallback callback_; |
| 159 OldCompletionCallbackImpl<HttpProxyConnectJob> callback_old_; | |
| 160 scoped_ptr<ClientSocketHandle> transport_socket_handle_; | 159 scoped_ptr<ClientSocketHandle> transport_socket_handle_; |
| 161 scoped_ptr<ProxyClientSocket> transport_socket_; | 160 scoped_ptr<ProxyClientSocket> transport_socket_; |
| 162 bool using_spdy_; | 161 bool using_spdy_; |
| 163 | 162 |
| 164 HttpResponseInfo error_response_info_; | 163 HttpResponseInfo error_response_info_; |
| 165 | 164 |
| 166 scoped_refptr<SpdyStream> spdy_stream_; | 165 scoped_refptr<SpdyStream> spdy_stream_; |
| 167 | 166 |
| 168 DISALLOW_COPY_AND_ASSIGN(HttpProxyConnectJob); | 167 DISALLOW_COPY_AND_ASSIGN(HttpProxyConnectJob); |
| 169 }; | 168 }; |
| 170 | 169 |
| 171 class NET_EXPORT_PRIVATE HttpProxyClientSocketPool | 170 class NET_EXPORT_PRIVATE HttpProxyClientSocketPool |
| 172 : public ClientSocketPool, public LayeredPool { | 171 : public ClientSocketPool, |
| 172 public LayeredPool { |
| 173 public: | 173 public: |
| 174 HttpProxyClientSocketPool( | 174 HttpProxyClientSocketPool( |
| 175 int max_sockets, | 175 int max_sockets, |
| 176 int max_sockets_per_group, | 176 int max_sockets_per_group, |
| 177 ClientSocketPoolHistograms* histograms, | 177 ClientSocketPoolHistograms* histograms, |
| 178 HostResolver* host_resolver, | 178 HostResolver* host_resolver, |
| 179 TransportClientSocketPool* transport_pool, | 179 TransportClientSocketPool* transport_pool, |
| 180 SSLClientSocketPool* ssl_pool, | 180 SSLClientSocketPool* ssl_pool, |
| 181 NetLog* net_log); | 181 NetLog* net_log); |
| 182 | 182 |
| 183 virtual ~HttpProxyClientSocketPool(); | 183 virtual ~HttpProxyClientSocketPool(); |
| 184 | 184 |
| 185 // ClientSocketPool methods: | 185 // ClientSocketPool implementation. |
| 186 virtual int RequestSocket(const std::string& group_name, | 186 virtual int RequestSocket(const std::string& group_name, |
| 187 const void* connect_params, | 187 const void* connect_params, |
| 188 RequestPriority priority, | 188 RequestPriority priority, |
| 189 ClientSocketHandle* handle, | 189 ClientSocketHandle* handle, |
| 190 OldCompletionCallback* callback, | 190 const CompletionCallback& callback, |
| 191 const BoundNetLog& net_log) OVERRIDE; | 191 const BoundNetLog& net_log) OVERRIDE; |
| 192 | 192 |
| 193 virtual void RequestSockets(const std::string& group_name, | 193 virtual void RequestSockets(const std::string& group_name, |
| 194 const void* params, | 194 const void* params, |
| 195 int num_sockets, | 195 int num_sockets, |
| 196 const BoundNetLog& net_log) OVERRIDE; | 196 const BoundNetLog& net_log) OVERRIDE; |
| 197 | 197 |
| 198 virtual void CancelRequest(const std::string& group_name, | 198 virtual void CancelRequest(const std::string& group_name, |
| 199 ClientSocketHandle* handle) OVERRIDE; | 199 ClientSocketHandle* handle) OVERRIDE; |
| 200 | 200 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 223 | 223 |
| 224 virtual base::DictionaryValue* GetInfoAsValue( | 224 virtual base::DictionaryValue* GetInfoAsValue( |
| 225 const std::string& name, | 225 const std::string& name, |
| 226 const std::string& type, | 226 const std::string& type, |
| 227 bool include_nested_pools) const OVERRIDE; | 227 bool include_nested_pools) const OVERRIDE; |
| 228 | 228 |
| 229 virtual base::TimeDelta ConnectionTimeout() const OVERRIDE; | 229 virtual base::TimeDelta ConnectionTimeout() const OVERRIDE; |
| 230 | 230 |
| 231 virtual ClientSocketPoolHistograms* histograms() const OVERRIDE; | 231 virtual ClientSocketPoolHistograms* histograms() const OVERRIDE; |
| 232 | 232 |
| 233 // LayeredPool methods: | 233 // LayeredPool implementation. |
| 234 virtual bool CloseOneIdleConnection() OVERRIDE; | 234 virtual bool CloseOneIdleConnection() OVERRIDE; |
| 235 | 235 |
| 236 private: | 236 private: |
| 237 typedef ClientSocketPoolBase<HttpProxySocketParams> PoolBase; | 237 typedef ClientSocketPoolBase<HttpProxySocketParams> PoolBase; |
| 238 | 238 |
| 239 class HttpProxyConnectJobFactory : public PoolBase::ConnectJobFactory { | 239 class HttpProxyConnectJobFactory : public PoolBase::ConnectJobFactory { |
| 240 public: | 240 public: |
| 241 HttpProxyConnectJobFactory( | 241 HttpProxyConnectJobFactory( |
| 242 TransportClientSocketPool* transport_pool, | 242 TransportClientSocketPool* transport_pool, |
| 243 SSLClientSocketPool* ssl_pool, | 243 SSLClientSocketPool* ssl_pool, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 270 | 270 |
| 271 DISALLOW_COPY_AND_ASSIGN(HttpProxyClientSocketPool); | 271 DISALLOW_COPY_AND_ASSIGN(HttpProxyClientSocketPool); |
| 272 }; | 272 }; |
| 273 | 273 |
| 274 REGISTER_SOCKET_PARAMS_FOR_POOL(HttpProxyClientSocketPool, | 274 REGISTER_SOCKET_PARAMS_FOR_POOL(HttpProxyClientSocketPool, |
| 275 HttpProxySocketParams); | 275 HttpProxySocketParams); |
| 276 | 276 |
| 277 } // namespace net | 277 } // namespace net |
| 278 | 278 |
| 279 #endif // NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ | 279 #endif // NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ |
| OLD | NEW |