diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-30 23:51:24 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-30 23:51:24 +0000 |
commit | 84ea2d04c0f80098e6361f5eb783c6e6ec8ce2f1 (patch) | |
tree | d5450ecf0f33e4a1cf654043fc9087e72f708f34 /net/http | |
parent | 3be6c69d07727f429c108a0c649bbbfb20403a47 (diff) | |
download | chromium_src-84ea2d04c0f80098e6361f5eb783c6e6ec8ce2f1.zip chromium_src-84ea2d04c0f80098e6361f5eb783c6e6ec8ce2f1.tar.gz chromium_src-84ea2d04c0f80098e6361f5eb783c6e6ec8ce2f1.tar.bz2 |
net: Add NET_API to more code to enable building
a shared net library on Linux, and update base and
crypto API definitions.
BUG=76997
TEST=none
Review URL: http://codereview.chromium.org/7240021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91234 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r-- | net/http/http_auth_gssapi_posix.h | 9 | ||||
-rw-r--r-- | net/http/http_auth_handler_ntlm.h | 4 | ||||
-rw-r--r-- | net/http/http_network_session.cc | 28 | ||||
-rw-r--r-- | net/http/http_network_session.h | 27 |
4 files changed, 41 insertions, 27 deletions
diff --git a/net/http/http_auth_gssapi_posix.h b/net/http/http_auth_gssapi_posix.h index 9b1d0ed..5777190 100644 --- a/net/http/http_auth_gssapi_posix.h +++ b/net/http/http_auth_gssapi_posix.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// 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. @@ -11,6 +11,7 @@ #include "base/gtest_prod_util.h" #include "base/native_library.h" #include "base/string16.h" +#include "net/base/net_api.h" #include "net/http/http_auth.h" #define GSS_USE_FUNCTION_POINTERS @@ -26,7 +27,7 @@ extern gss_OID CHROME_GSS_KRB5_MECH_OID_DESC; // library. The default implementation attempts to load one of the standard // GSSAPI library implementations, then simply passes the arguments on to // that implementation. -class GSSAPILibrary { +class NET_TEST GSSAPILibrary { public: virtual ~GSSAPILibrary() {} @@ -98,7 +99,7 @@ class GSSAPILibrary { }; // GSSAPISharedLibrary class is defined here so that unit tests can access it. -class GSSAPISharedLibrary : public GSSAPILibrary { +class NET_TEST GSSAPISharedLibrary : public GSSAPILibrary { public: // If |gssapi_library_name| is empty, hard-coded default library names are // used. @@ -213,7 +214,7 @@ class ScopedSecurityContext { // TODO(ahendrickson): Share code with HttpAuthSSPI. -class HttpAuthGSSAPI { +class NET_TEST HttpAuthGSSAPI { public: HttpAuthGSSAPI(GSSAPILibrary* library, const std::string& scheme, diff --git a/net/http/http_auth_handler_ntlm.h b/net/http/http_auth_handler_ntlm.h index c5050af..92322f3 100644 --- a/net/http/http_auth_handler_ntlm.h +++ b/net/http/http_auth_handler_ntlm.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// 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. @@ -35,7 +35,7 @@ namespace net { class URLSecurityManager; // Code for handling HTTP NTLM authentication. -class HttpAuthHandlerNTLM : public HttpAuthHandler { +class NET_TEST HttpAuthHandlerNTLM : public HttpAuthHandler { public: class Factory : public HttpAuthHandlerFactory { public: diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc index d13ec97..27d5cb9 100644 --- a/net/http/http_network_session.cc +++ b/net/http/http_network_session.cc @@ -63,8 +63,36 @@ void HttpNetworkSession::RemoveResponseDrainer( response_drainers_.erase(drainer); } +SOCKSClientSocketPool* HttpNetworkSession::GetSocketPoolForSOCKSProxy( + const HostPortPair& socks_proxy) { + return socket_pool_manager_.GetSocketPoolForSOCKSProxy(socks_proxy); +} + +HttpProxyClientSocketPool* HttpNetworkSession::GetSocketPoolForHTTPProxy( + const HostPortPair& http_proxy) { + return socket_pool_manager_.GetSocketPoolForHTTPProxy(http_proxy); +} + +SSLClientSocketPool* HttpNetworkSession::GetSocketPoolForSSLWithProxy( + const HostPortPair& proxy_server) { + return socket_pool_manager_.GetSocketPoolForSSLWithProxy(proxy_server); +} + +Value* HttpNetworkSession::SocketPoolInfoToValue() const { + return socket_pool_manager_.SocketPoolInfoToValue(); +} + Value* HttpNetworkSession::SpdySessionPoolInfoToValue() const { return spdy_session_pool_.SpdySessionPoolInfoToValue(); } +void HttpNetworkSession::CloseAllConnections() { + socket_pool_manager_.FlushSocketPools(); + spdy_session_pool_.CloseCurrentSessions(); +} + +void HttpNetworkSession::CloseIdleConnections() { + socket_pool_manager_.CloseIdleSockets(); +} + } // namespace net diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h index b92b033..7d5b67f 100644 --- a/net/http/http_network_session.h +++ b/net/http/http_network_session.h @@ -98,19 +98,13 @@ class NET_API HttpNetworkSession } SOCKSClientSocketPool* GetSocketPoolForSOCKSProxy( - const HostPortPair& socks_proxy) { - return socket_pool_manager_.GetSocketPoolForSOCKSProxy(socks_proxy); - } + const HostPortPair& socks_proxy); HttpProxyClientSocketPool* GetSocketPoolForHTTPProxy( - const HostPortPair& http_proxy) { - return socket_pool_manager_.GetSocketPoolForHTTPProxy(http_proxy); - } + const HostPortPair& http_proxy); SSLClientSocketPool* GetSocketPoolForSSLWithProxy( - const HostPortPair& proxy_server) { - return socket_pool_manager_.GetSocketPoolForSSLWithProxy(proxy_server); - } + const HostPortPair& proxy_server); CertVerifier* cert_verifier() { return cert_verifier_; } ProxyService* proxy_service() { return proxy_service_; } @@ -133,23 +127,14 @@ class NET_API HttpNetworkSession // Creates a Value summary of the state of the socket pools. The caller is // responsible for deleting the returned value. - Value* SocketPoolInfoToValue() const { - return socket_pool_manager_.SocketPoolInfoToValue(); - } + Value* SocketPoolInfoToValue() const; // Creates a Value summary of the state of the SPDY sessions. The caller is // responsible for deleting the returned value. Value* SpdySessionPoolInfoToValue() const; - void CloseAllConnections() { - socket_pool_manager_.FlushSocketPools(); - spdy_session_pool_.CloseCurrentSessions(); - } - - void CloseIdleConnections() { - socket_pool_manager_.CloseIdleSockets(); - } - + void CloseAllConnections(); + void CloseIdleConnections(); private: friend class base::RefCounted<HttpNetworkSession>; |