| 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_SOCKS_CLIENT_SOCKET_POOL_H_ | 5 #ifndef NET_SOCKET_SOCKS_CLIENT_SOCKET_POOL_H_ |
| 6 #define NET_SOCKET_SOCKS_CLIENT_SOCKET_POOL_H_ | 6 #define NET_SOCKET_SOCKS_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/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "net/base/host_port_pair.h" | 16 #include "net/base/host_port_pair.h" |
| 17 #include "net/base/host_resolver.h" | 17 #include "net/base/host_resolver.h" |
| 18 #include "net/socket/client_socket_pool_base.h" | 18 #include "net/socket/client_socket_pool_base.h" |
| 19 #include "net/socket/client_socket_pool_histograms.h" | 19 #include "net/socket/client_socket_pool_histograms.h" |
| 20 #include "net/socket/client_socket_pool.h" | 20 #include "net/socket/client_socket_pool.h" |
| 21 | 21 |
| 22 namespace net { | 22 namespace net { |
| 23 | 23 |
| 24 class ConnectJobFactory; | 24 class ConnectJobFactory; |
| 25 class TransportClientSocketPool; | 25 class TransportClientSocketPool; |
| 26 class TransportSocketParams; | 26 class TransportSocketParams; |
| 27 | 27 |
| 28 class NET_TEST SOCKSSocketParams : public base::RefCounted<SOCKSSocketParams> { | 28 class NET_EXPORT_PRIVATE SOCKSSocketParams |
| 29 : public base::RefCounted<SOCKSSocketParams> { |
| 29 public: | 30 public: |
| 30 SOCKSSocketParams(const scoped_refptr<TransportSocketParams>& proxy_server, | 31 SOCKSSocketParams(const scoped_refptr<TransportSocketParams>& proxy_server, |
| 31 bool socks_v5, const HostPortPair& host_port_pair, | 32 bool socks_v5, const HostPortPair& host_port_pair, |
| 32 RequestPriority priority, const GURL& referrer); | 33 RequestPriority priority, const GURL& referrer); |
| 33 | 34 |
| 34 const scoped_refptr<TransportSocketParams>& transport_params() const { | 35 const scoped_refptr<TransportSocketParams>& transport_params() const { |
| 35 return transport_params_; | 36 return transport_params_; |
| 36 } | 37 } |
| 37 const HostResolver::RequestInfo& destination() const { return destination_; } | 38 const HostResolver::RequestInfo& destination() const { return destination_; } |
| 38 bool is_socks_v5() const { return socks_v5_; } | 39 bool is_socks_v5() const { return socks_v5_; } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 HostResolver* const resolver_; | 98 HostResolver* const resolver_; |
| 98 | 99 |
| 99 State next_state_; | 100 State next_state_; |
| 100 CompletionCallbackImpl<SOCKSConnectJob> callback_; | 101 CompletionCallbackImpl<SOCKSConnectJob> callback_; |
| 101 scoped_ptr<ClientSocketHandle> transport_socket_handle_; | 102 scoped_ptr<ClientSocketHandle> transport_socket_handle_; |
| 102 scoped_ptr<StreamSocket> socket_; | 103 scoped_ptr<StreamSocket> socket_; |
| 103 | 104 |
| 104 DISALLOW_COPY_AND_ASSIGN(SOCKSConnectJob); | 105 DISALLOW_COPY_AND_ASSIGN(SOCKSConnectJob); |
| 105 }; | 106 }; |
| 106 | 107 |
| 107 class NET_TEST SOCKSClientSocketPool : public ClientSocketPool { | 108 class NET_EXPORT_PRIVATE SOCKSClientSocketPool : public ClientSocketPool { |
| 108 public: | 109 public: |
| 109 SOCKSClientSocketPool( | 110 SOCKSClientSocketPool( |
| 110 int max_sockets, | 111 int max_sockets, |
| 111 int max_sockets_per_group, | 112 int max_sockets_per_group, |
| 112 ClientSocketPoolHistograms* histograms, | 113 ClientSocketPoolHistograms* histograms, |
| 113 HostResolver* host_resolver, | 114 HostResolver* host_resolver, |
| 114 TransportClientSocketPool* transport_pool, | 115 TransportClientSocketPool* transport_pool, |
| 115 NetLog* net_log); | 116 NetLog* net_log); |
| 116 | 117 |
| 117 virtual ~SOCKSClientSocketPool(); | 118 virtual ~SOCKSClientSocketPool(); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 PoolBase base_; | 191 PoolBase base_; |
| 191 | 192 |
| 192 DISALLOW_COPY_AND_ASSIGN(SOCKSClientSocketPool); | 193 DISALLOW_COPY_AND_ASSIGN(SOCKSClientSocketPool); |
| 193 }; | 194 }; |
| 194 | 195 |
| 195 REGISTER_SOCKET_PARAMS_FOR_POOL(SOCKSClientSocketPool, SOCKSSocketParams); | 196 REGISTER_SOCKET_PARAMS_FOR_POOL(SOCKSClientSocketPool, SOCKSSocketParams); |
| 196 | 197 |
| 197 } // namespace net | 198 } // namespace net |
| 198 | 199 |
| 199 #endif // NET_SOCKET_SOCKS_CLIENT_SOCKET_POOL_H_ | 200 #endif // NET_SOCKET_SOCKS_CLIENT_SOCKET_POOL_H_ |
| OLD | NEW |