OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "net/socket/mock_client_socket_pool_manager.h" | |
6 | |
7 #include "net/http/http_proxy_client_socket_pool.h" | |
8 #include "net/socket/socks_client_socket_pool.h" | |
9 #include "net/socket/ssl_client_socket_pool.h" | |
10 #include "net/socket/transport_client_socket_pool.h" | |
11 | |
12 namespace net { | |
13 | |
14 MockClientSocketPoolManager::MockClientSocketPoolManager() {} | |
15 MockClientSocketPoolManager::~MockClientSocketPoolManager() {} | |
16 | |
17 void MockClientSocketPoolManager::SetTransportSocketPool( | |
18 TransportClientSocketPool* pool) { | |
19 transport_socket_pool_.reset(pool); | |
20 } | |
21 | |
22 void MockClientSocketPoolManager::SetSSLSocketPool( | |
23 SSLClientSocketPool* pool) { | |
24 ssl_socket_pool_.reset(pool); | |
25 } | |
26 | |
27 void MockClientSocketPoolManager::SetSocketPoolForSOCKSProxy( | |
28 const HostPortPair& socks_proxy, | |
29 SOCKSClientSocketPool* pool) { | |
30 socks_socket_pools_[socks_proxy] = pool; | |
31 } | |
32 | |
33 void MockClientSocketPoolManager::SetSocketPoolForHTTPProxy( | |
34 const HostPortPair& http_proxy, | |
35 HttpProxyClientSocketPool* pool) { | |
36 http_proxy_socket_pools_[http_proxy] = pool; | |
37 } | |
38 | |
39 void MockClientSocketPoolManager::SetSocketPoolForSSLWithProxy( | |
40 const HostPortPair& proxy_server, | |
41 SSLClientSocketPool* pool) { | |
42 ssl_socket_pools_for_proxies_[proxy_server] = pool; | |
43 } | |
44 | |
45 void MockClientSocketPoolManager::FlushSocketPools() {} | |
mmenke
2011/11/16 16:12:03
NOTREACHED() or NOTIMPLEMENTED(), maybe? The same
willchan no longer on Chromium
2011/11/16 17:26:06
Done.
| |
46 | |
47 void MockClientSocketPoolManager::CloseIdleSockets() {} | |
48 | |
49 TransportClientSocketPool* | |
50 MockClientSocketPoolManager::GetTransportSocketPool() { | |
51 return transport_socket_pool_.get(); | |
52 } | |
53 | |
54 SSLClientSocketPool* MockClientSocketPoolManager::GetSSLSocketPool() { | |
55 return ssl_socket_pool_.get(); | |
56 } | |
57 | |
58 SOCKSClientSocketPool* MockClientSocketPoolManager::GetSocketPoolForSOCKSProxy( | |
59 const HostPortPair& socks_proxy) { | |
60 SOCKSSocketPoolMap::const_iterator it = socks_socket_pools_.find(socks_proxy); | |
61 if (it != socks_socket_pools_.end()) | |
62 return it->second; | |
63 return NULL; | |
64 } | |
65 | |
66 HttpProxyClientSocketPool* | |
67 MockClientSocketPoolManager::GetSocketPoolForHTTPProxy( | |
68 const HostPortPair& http_proxy) { | |
69 HTTPProxySocketPoolMap::const_iterator it = | |
70 http_proxy_socket_pools_.find(http_proxy); | |
71 if (it != http_proxy_socket_pools_.end()) | |
72 return it->second; | |
73 return NULL; | |
74 } | |
75 | |
76 SSLClientSocketPool* MockClientSocketPoolManager::GetSocketPoolForSSLWithProxy( | |
77 const HostPortPair& proxy_server) { | |
78 SSLSocketPoolMap::const_iterator it = | |
79 ssl_socket_pools_for_proxies_.find(proxy_server); | |
80 if (it != ssl_socket_pools_for_proxies_.end()) | |
81 return it->second; | |
82 return NULL; | |
83 } | |
84 | |
85 Value* MockClientSocketPoolManager::SocketPoolInfoToValue() const { | |
86 return NULL; | |
87 } | |
88 | |
89 } // namespace net | |
OLD | NEW |