blob: 7cb9b5b62dbcefbcf6754b5e5d5abfb3768a136d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/socket/mock_client_socket_pool_manager.h"
#include "net/http/http_proxy_client_socket_pool.h"
#include "net/socket/socks_client_socket_pool.h"
#include "net/socket/ssl_client_socket_pool.h"
#include "net/socket/transport_client_socket_pool.h"
namespace net {
MockClientSocketPoolManager::MockClientSocketPoolManager() {}
MockClientSocketPoolManager::~MockClientSocketPoolManager() {}
void MockClientSocketPoolManager::SetTransportSocketPool(
TransportClientSocketPool* pool) {
transport_socket_pool_.reset(pool);
}
void MockClientSocketPoolManager::SetSSLSocketPool(
SSLClientSocketPool* pool) {
ssl_socket_pool_.reset(pool);
}
void MockClientSocketPoolManager::SetSocketPoolForSOCKSProxy(
const HostPortPair& socks_proxy,
SOCKSClientSocketPool* pool) {
socks_socket_pools_[socks_proxy] = pool;
}
void MockClientSocketPoolManager::SetSocketPoolForHTTPProxy(
const HostPortPair& http_proxy,
HttpProxyClientSocketPool* pool) {
http_proxy_socket_pools_[http_proxy] = pool;
}
void MockClientSocketPoolManager::SetSocketPoolForSSLWithProxy(
const HostPortPair& proxy_server,
SSLClientSocketPool* pool) {
ssl_socket_pools_for_proxies_[proxy_server] = pool;
}
void MockClientSocketPoolManager::FlushSocketPools() {
NOTIMPLEMENTED();
}
void MockClientSocketPoolManager::CloseIdleSockets() {
NOTIMPLEMENTED();
}
TransportClientSocketPool*
MockClientSocketPoolManager::GetTransportSocketPool() {
return transport_socket_pool_.get();
}
SSLClientSocketPool* MockClientSocketPoolManager::GetSSLSocketPool() {
return ssl_socket_pool_.get();
}
SOCKSClientSocketPool* MockClientSocketPoolManager::GetSocketPoolForSOCKSProxy(
const HostPortPair& socks_proxy) {
SOCKSSocketPoolMap::const_iterator it = socks_socket_pools_.find(socks_proxy);
if (it != socks_socket_pools_.end())
return it->second;
return NULL;
}
HttpProxyClientSocketPool*
MockClientSocketPoolManager::GetSocketPoolForHTTPProxy(
const HostPortPair& http_proxy) {
HTTPProxySocketPoolMap::const_iterator it =
http_proxy_socket_pools_.find(http_proxy);
if (it != http_proxy_socket_pools_.end())
return it->second;
return NULL;
}
SSLClientSocketPool* MockClientSocketPoolManager::GetSocketPoolForSSLWithProxy(
const HostPortPair& proxy_server) {
SSLSocketPoolMap::const_iterator it =
ssl_socket_pools_for_proxies_.find(proxy_server);
if (it != ssl_socket_pools_for_proxies_.end())
return it->second;
return NULL;
}
base::Value* MockClientSocketPoolManager::SocketPoolInfoToValue() const {
NOTIMPLEMENTED();
return NULL;
}
} // namespace net
|