Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / net / socket / mock_client_socket_pool_manager.cc
blob0496adb9636b7d46b54feae78a44dd595df42903
1 // Copyright (c) 2012 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.
5 #include "net/socket/mock_client_socket_pool_manager.h"
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"
12 namespace net {
14 MockClientSocketPoolManager::MockClientSocketPoolManager() {}
15 MockClientSocketPoolManager::~MockClientSocketPoolManager() {}
17 void MockClientSocketPoolManager::SetTransportSocketPool(
18 TransportClientSocketPool* pool) {
19 transport_socket_pool_.reset(pool);
22 void MockClientSocketPoolManager::SetSSLSocketPool(
23 SSLClientSocketPool* pool) {
24 ssl_socket_pool_.reset(pool);
27 void MockClientSocketPoolManager::SetSocketPoolForSOCKSProxy(
28 const HostPortPair& socks_proxy,
29 SOCKSClientSocketPool* pool) {
30 socks_socket_pools_[socks_proxy] = pool;
33 void MockClientSocketPoolManager::SetSocketPoolForHTTPProxy(
34 const HostPortPair& http_proxy,
35 HttpProxyClientSocketPool* pool) {
36 http_proxy_socket_pools_[http_proxy] = pool;
39 void MockClientSocketPoolManager::SetSocketPoolForSSLWithProxy(
40 const HostPortPair& proxy_server,
41 SSLClientSocketPool* pool) {
42 ssl_socket_pools_for_proxies_[proxy_server] = pool;
45 void MockClientSocketPoolManager::FlushSocketPoolsWithError(int error) {
46 NOTIMPLEMENTED();
49 void MockClientSocketPoolManager::CloseIdleSockets() {
50 NOTIMPLEMENTED();
53 TransportClientSocketPool*
54 MockClientSocketPoolManager::GetTransportSocketPool() {
55 return transport_socket_pool_.get();
58 SSLClientSocketPool* MockClientSocketPoolManager::GetSSLSocketPool() {
59 return ssl_socket_pool_.get();
62 SOCKSClientSocketPool* MockClientSocketPoolManager::GetSocketPoolForSOCKSProxy(
63 const HostPortPair& socks_proxy) {
64 SOCKSSocketPoolMap::const_iterator it = socks_socket_pools_.find(socks_proxy);
65 if (it != socks_socket_pools_.end())
66 return it->second;
67 return NULL;
70 HttpProxyClientSocketPool*
71 MockClientSocketPoolManager::GetSocketPoolForHTTPProxy(
72 const HostPortPair& http_proxy) {
73 HTTPProxySocketPoolMap::const_iterator it =
74 http_proxy_socket_pools_.find(http_proxy);
75 if (it != http_proxy_socket_pools_.end())
76 return it->second;
77 return NULL;
80 SSLClientSocketPool* MockClientSocketPoolManager::GetSocketPoolForSSLWithProxy(
81 const HostPortPair& proxy_server) {
82 SSLSocketPoolMap::const_iterator it =
83 ssl_socket_pools_for_proxies_.find(proxy_server);
84 if (it != ssl_socket_pools_for_proxies_.end())
85 return it->second;
86 return NULL;
89 base::Value* MockClientSocketPoolManager::SocketPoolInfoToValue() const {
90 NOTIMPLEMENTED();
91 return NULL;
94 } // namespace net