| OLD | NEW | 
|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" | 
| 12 #include "base/ref_counted.h" | 12 #include "base/ref_counted.h" | 
| 13 #include "base/scoped_ptr.h" | 13 #include "base/scoped_ptr.h" | 
| 14 #include "base/time.h" | 14 #include "base/time.h" | 
| 15 #include "net/base/host_port_pair.h" | 15 #include "net/base/host_port_pair.h" | 
| 16 #include "net/http/http_auth.h" | 16 #include "net/http/http_auth.h" | 
|  | 17 #include "net/http/http_response_info.h" | 
| 17 #include "net/socket/client_socket_pool_base.h" | 18 #include "net/socket/client_socket_pool_base.h" | 
| 18 #include "net/socket/client_socket_pool_histograms.h" | 19 #include "net/socket/client_socket_pool_histograms.h" | 
| 19 #include "net/socket/client_socket_pool.h" | 20 #include "net/socket/client_socket_pool.h" | 
| 20 | 21 | 
| 21 namespace net { | 22 namespace net { | 
| 22 | 23 | 
| 23 class HostResolver; | 24 class HostResolver; | 
| 24 class HttpAuthCache; | 25 class HttpAuthCache; | 
| 25 class HttpAuthHandlerFactory; | 26 class HttpAuthHandlerFactory; | 
| 26 class SSLClientSocketPool; | 27 class SSLClientSocketPool; | 
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 98                       TCPClientSocketPool* tcp_pool, | 99                       TCPClientSocketPool* tcp_pool, | 
| 99                       SSLClientSocketPool* ssl_pool, | 100                       SSLClientSocketPool* ssl_pool, | 
| 100                       HostResolver* host_resolver, | 101                       HostResolver* host_resolver, | 
| 101                       Delegate* delegate, | 102                       Delegate* delegate, | 
| 102                       NetLog* net_log); | 103                       NetLog* net_log); | 
| 103   virtual ~HttpProxyConnectJob(); | 104   virtual ~HttpProxyConnectJob(); | 
| 104 | 105 | 
| 105   // ConnectJob methods. | 106   // ConnectJob methods. | 
| 106   virtual LoadState GetLoadState() const; | 107   virtual LoadState GetLoadState() const; | 
| 107 | 108 | 
|  | 109   virtual void GetAdditionalErrorState(ClientSocketHandle* handle); | 
|  | 110 | 
| 108  private: | 111  private: | 
| 109   enum State { | 112   enum State { | 
| 110     STATE_TCP_CONNECT, | 113     STATE_TCP_CONNECT, | 
| 111     STATE_TCP_CONNECT_COMPLETE, | 114     STATE_TCP_CONNECT_COMPLETE, | 
| 112     STATE_SSL_CONNECT, | 115     STATE_SSL_CONNECT, | 
| 113     STATE_SSL_CONNECT_COMPLETE, | 116     STATE_SSL_CONNECT_COMPLETE, | 
| 114     STATE_HTTP_PROXY_CONNECT, | 117     STATE_HTTP_PROXY_CONNECT, | 
| 115     STATE_HTTP_PROXY_CONNECT_COMPLETE, | 118     STATE_HTTP_PROXY_CONNECT_COMPLETE, | 
| 116     STATE_SPDY_PROXY_CREATE_STREAM, | 119     STATE_SPDY_PROXY_CREATE_STREAM, | 
| 117     STATE_SPDY_PROXY_CREATE_STREAM_COMPLETE, | 120     STATE_SPDY_PROXY_CREATE_STREAM_COMPLETE, | 
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 150   TCPClientSocketPool* const tcp_pool_; | 153   TCPClientSocketPool* const tcp_pool_; | 
| 151   SSLClientSocketPool* const ssl_pool_; | 154   SSLClientSocketPool* const ssl_pool_; | 
| 152   HostResolver* const resolver_; | 155   HostResolver* const resolver_; | 
| 153 | 156 | 
| 154   State next_state_; | 157   State next_state_; | 
| 155   CompletionCallbackImpl<HttpProxyConnectJob> callback_; | 158   CompletionCallbackImpl<HttpProxyConnectJob> callback_; | 
| 156   scoped_ptr<ClientSocketHandle> transport_socket_handle_; | 159   scoped_ptr<ClientSocketHandle> transport_socket_handle_; | 
| 157   scoped_ptr<ClientSocket> transport_socket_; | 160   scoped_ptr<ClientSocket> transport_socket_; | 
| 158   bool using_spdy_; | 161   bool using_spdy_; | 
| 159 | 162 | 
|  | 163   HttpResponseInfo error_response_info_; | 
|  | 164 | 
| 160   scoped_refptr<SpdyStream> spdy_stream_; | 165   scoped_refptr<SpdyStream> spdy_stream_; | 
| 161 | 166 | 
| 162   DISALLOW_COPY_AND_ASSIGN(HttpProxyConnectJob); | 167   DISALLOW_COPY_AND_ASSIGN(HttpProxyConnectJob); | 
| 163 }; | 168 }; | 
| 164 | 169 | 
| 165 class HttpProxyClientSocketPool : public ClientSocketPool { | 170 class HttpProxyClientSocketPool : public ClientSocketPool { | 
| 166  public: | 171  public: | 
| 167   HttpProxyClientSocketPool( | 172   HttpProxyClientSocketPool( | 
| 168       int max_sockets, | 173       int max_sockets, | 
| 169       int max_sockets_per_group, | 174       int max_sockets_per_group, | 
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 254 | 259 | 
| 255   DISALLOW_COPY_AND_ASSIGN(HttpProxyClientSocketPool); | 260   DISALLOW_COPY_AND_ASSIGN(HttpProxyClientSocketPool); | 
| 256 }; | 261 }; | 
| 257 | 262 | 
| 258 REGISTER_SOCKET_PARAMS_FOR_POOL(HttpProxyClientSocketPool, | 263 REGISTER_SOCKET_PARAMS_FOR_POOL(HttpProxyClientSocketPool, | 
| 259                                 HttpProxySocketParams); | 264                                 HttpProxySocketParams); | 
| 260 | 265 | 
| 261 }  // namespace net | 266 }  // namespace net | 
| 262 | 267 | 
| 263 #endif  // NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ | 268 #endif  // NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ | 
| OLD | NEW | 
|---|