summaryrefslogtreecommitdiffstats
path: root/net/http/http_network_session_peer.cc
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-11 20:44:42 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-11 20:44:42 +0000
commit5322a7f16a374a15fe69b3bb2621678aede48bca (patch)
tree56c8ee955ed32cd69f8b3395cb609dcdd504e58c /net/http/http_network_session_peer.cc
parent192a05f2e4d8f66d095227439d4dce7bb14b16b5 (diff)
downloadchromium_src-5322a7f16a374a15fe69b3bb2621678aede48bca.zip
chromium_src-5322a7f16a374a15fe69b3bb2621678aede48bca.tar.gz
chromium_src-5322a7f16a374a15fe69b3bb2621678aede48bca.tar.bz2
Continuing with the out-of-lining of test code.
BUG=none TEST=compiles Review URL: http://codereview.chromium.org/6485015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74660 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_network_session_peer.cc')
-rw-r--r--net/http/http_network_session_peer.cc69
1 files changed, 69 insertions, 0 deletions
diff --git a/net/http/http_network_session_peer.cc b/net/http/http_network_session_peer.cc
new file mode 100644
index 0000000..7bb342c
--- /dev/null
+++ b/net/http/http_network_session_peer.cc
@@ -0,0 +1,69 @@
+// Copyright (c) 2011 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/http/http_network_session_peer.h"
+
+#include "net/http/http_network_session.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/tcp_client_socket_pool.h"
+
+namespace net {
+
+HttpNetworkSessionPeer::HttpNetworkSessionPeer(
+ const scoped_refptr<HttpNetworkSession>& session)
+ : session_(session) {}
+
+HttpNetworkSessionPeer::~HttpNetworkSessionPeer() {}
+
+void HttpNetworkSessionPeer::SetTCPSocketPool(TCPClientSocketPool* pool) {
+ session_->socket_pool_manager_.tcp_socket_pool_.reset(pool);
+}
+
+void HttpNetworkSessionPeer::SetSocketPoolForSOCKSProxy(
+ const HostPortPair& socks_proxy,
+ SOCKSClientSocketPool* pool) {
+ ClientSocketPoolManager* socket_pool_manager =
+ &session_->socket_pool_manager_;
+
+ // Call through the public interface to force initialization of the
+ // wrapped socket pools.
+ delete socket_pool_manager->GetSocketPoolForSOCKSProxy(socks_proxy);
+ socket_pool_manager->socks_socket_pools_[socks_proxy] = pool;
+}
+
+void HttpNetworkSessionPeer::SetSocketPoolForHTTPProxy(
+ const HostPortPair& http_proxy,
+ HttpProxyClientSocketPool* pool) {
+ ClientSocketPoolManager* socket_pool_manager =
+ &session_->socket_pool_manager_;
+
+ // Call through the public interface to force initialization of the
+ // wrapped socket pools.
+ delete socket_pool_manager->GetSocketPoolForHTTPProxy(http_proxy);
+ socket_pool_manager->http_proxy_socket_pools_[http_proxy] = pool;
+}
+
+void HttpNetworkSessionPeer::SetSSLSocketPool(SSLClientSocketPool* pool) {
+ session_->socket_pool_manager_.ssl_socket_pool_.reset(pool);
+}
+
+void HttpNetworkSessionPeer::SetSocketPoolForSSLWithProxy(
+ const HostPortPair& proxy_host,
+ SSLClientSocketPool* pool) {
+ ClientSocketPoolManager* socket_pool_manager =
+ &session_->socket_pool_manager_;
+
+ // Call through the public interface to force initialization of the
+ // wrapped socket pools.
+ delete socket_pool_manager->GetSocketPoolForSSLWithProxy(proxy_host);
+ socket_pool_manager->ssl_socket_pools_for_proxies_[proxy_host] = pool;
+}
+
+void HttpNetworkSessionPeer::SetProxyService(ProxyService* proxy_service) {
+ session_->proxy_service_ = proxy_service;
+}
+
+} // namespace net