diff options
Diffstat (limited to 'net/http')
-rw-r--r-- | net/http/http_cache.cc | 4 | ||||
-rw-r--r-- | net/http/http_cache.h | 3 | ||||
-rw-r--r-- | net/http/http_network_layer.cc | 15 | ||||
-rw-r--r-- | net/http/http_network_layer.h | 8 | ||||
-rw-r--r-- | net/http/http_network_layer_unittest.cc | 6 | ||||
-rw-r--r-- | net/http/http_network_session.cc | 20 | ||||
-rw-r--r-- | net/http/http_network_session.h | 4 | ||||
-rw-r--r-- | net/http/http_network_transaction_unittest.cc | 9 |
8 files changed, 47 insertions, 22 deletions
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index 964d1b9..bffd97a 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -236,6 +236,7 @@ HttpCache::HttpCache(NetworkChangeNotifier* network_change_notifier, HostResolver* host_resolver, ProxyService* proxy_service, SSLConfigService* ssl_config_service, HttpAuthHandlerFactory* http_auth_handler_factory, + NetLog* net_log, BackendFactory* backend_factory) : backend_factory_(backend_factory), temp_backend_(NULL), @@ -243,7 +244,8 @@ HttpCache::HttpCache(NetworkChangeNotifier* network_change_notifier, mode_(NORMAL), network_layer_(HttpNetworkLayer::CreateFactory( network_change_notifier, host_resolver, proxy_service, - ssl_config_service, http_auth_handler_factory)), + ssl_config_service, http_auth_handler_factory, + net_log)), ALLOW_THIS_IN_INITIALIZER_LIST(task_factory_(this)), enable_range_support_(true) { } diff --git a/net/http/http_cache.h b/net/http/http_cache.h index a55763b..79c2134 100644 --- a/net/http/http_cache.h +++ b/net/http/http_cache.h @@ -16,6 +16,7 @@ #include <list> #include <set> +#include <string> #include "base/basictypes.h" #include "base/file_path.h" @@ -43,6 +44,7 @@ class HttpNetworkSession; struct HttpRequestInfo; class HttpResponseInfo; class IOBuffer; +class NetLog; class NetworkChangeNotifier; class ProxyService; class SSLConfigService; @@ -114,6 +116,7 @@ class HttpCache : public HttpTransactionFactory, HostResolver* host_resolver, ProxyService* proxy_service, SSLConfigService* ssl_config_service, HttpAuthHandlerFactory* http_auth_handler_factory, + NetLog* net_log, BackendFactory* backend_factory); // The disk cache is initialized lazily (by CreateTransaction) in this case. diff --git a/net/http/http_network_layer.cc b/net/http/http_network_layer.cc index 87422d4..f661fde 100644 --- a/net/http/http_network_layer.cc +++ b/net/http/http_network_layer.cc @@ -25,13 +25,15 @@ HttpTransactionFactory* HttpNetworkLayer::CreateFactory( HostResolver* host_resolver, ProxyService* proxy_service, SSLConfigService* ssl_config_service, - HttpAuthHandlerFactory* http_auth_handler_factory) { + HttpAuthHandlerFactory* http_auth_handler_factory, + NetLog* net_log) { DCHECK(proxy_service); return new HttpNetworkLayer(ClientSocketFactory::GetDefaultFactory(), network_change_notifier, host_resolver, proxy_service, ssl_config_service, - http_auth_handler_factory); + http_auth_handler_factory, + net_log); } // static @@ -51,7 +53,8 @@ HttpNetworkLayer::HttpNetworkLayer( HostResolver* host_resolver, ProxyService* proxy_service, SSLConfigService* ssl_config_service, - HttpAuthHandlerFactory* http_auth_handler_factory) + HttpAuthHandlerFactory* http_auth_handler_factory, + NetLog* net_log) : socket_factory_(socket_factory), network_change_notifier_(network_change_notifier), host_resolver_(host_resolver), @@ -60,6 +63,7 @@ HttpNetworkLayer::HttpNetworkLayer( session_(NULL), spdy_session_pool_(NULL), http_auth_handler_factory_(http_auth_handler_factory), + net_log_(net_log), suspended_(false) { DCHECK(proxy_service_); DCHECK(ssl_config_service_.get()); @@ -72,6 +76,7 @@ HttpNetworkLayer::HttpNetworkLayer(HttpNetworkSession* session) session_(session), spdy_session_pool_(session->spdy_session_pool()), http_auth_handler_factory_(NULL), + net_log_(NULL), suspended_(false) { DCHECK(session_.get()); } @@ -108,13 +113,15 @@ HttpNetworkSession* HttpNetworkLayer::GetSession() { session_ = new HttpNetworkSession( network_change_notifier_, host_resolver_, proxy_service_, socket_factory_, ssl_config_service_, spdy_pool, - http_auth_handler_factory_); + http_auth_handler_factory_, + net_log_); // These were just temps for lazy-initializing HttpNetworkSession. network_change_notifier_ = NULL; host_resolver_ = NULL; proxy_service_ = NULL; socket_factory_ = NULL; http_auth_handler_factory_ = NULL; + net_log_ = NULL; } return session_; } diff --git a/net/http/http_network_layer.h b/net/http/http_network_layer.h index 2d4130d..a045798 100644 --- a/net/http/http_network_layer.h +++ b/net/http/http_network_layer.h @@ -17,6 +17,7 @@ class ClientSocketFactory; class HostResolver; class HttpAuthHandlerFactory; class HttpNetworkSession; +class NetLog; class NetworkChangeNotifier; class ProxyInfo; class ProxyService; @@ -31,7 +32,8 @@ class HttpNetworkLayer : public HttpTransactionFactory { NetworkChangeNotifier* network_change_notifier, HostResolver* host_resolver, ProxyService* proxy_service, SSLConfigService* ssl_config_service, - HttpAuthHandlerFactory* http_auth_handler_factory); + HttpAuthHandlerFactory* http_auth_handler_factory, + NetLog* net_log); // Construct a HttpNetworkLayer with an existing HttpNetworkSession which // contains a valid ProxyService. explicit HttpNetworkLayer(HttpNetworkSession* session); @@ -44,7 +46,8 @@ class HttpNetworkLayer : public HttpTransactionFactory { HostResolver* host_resolver, ProxyService* proxy_service, SSLConfigService* ssl_config_service, - HttpAuthHandlerFactory* http_auth_handler_factory); + HttpAuthHandlerFactory* http_auth_handler_factory, + NetLog* net_log); // Create a transaction factory that instantiate a network layer over an // existing network session. Network session contains some valuable // information (e.g. authentication data) that we want to share across @@ -85,6 +88,7 @@ class HttpNetworkLayer : public HttpTransactionFactory { scoped_refptr<SpdySessionPool> spdy_session_pool_; HttpAuthHandlerFactory* http_auth_handler_factory_; + NetLog* net_log_; bool suspended_; static bool force_spdy_; diff --git a/net/http/http_network_layer_unittest.cc b/net/http/http_network_layer_unittest.cc index 697fe98..780ab68 100644 --- a/net/http/http_network_layer_unittest.cc +++ b/net/http/http_network_layer_unittest.cc @@ -18,7 +18,7 @@ class HttpNetworkLayerTest : public PlatformTest { TEST_F(HttpNetworkLayerTest, CreateAndDestroy) { net::HttpNetworkLayer factory( NULL, NULL, new net::MockHostResolver, net::ProxyService::CreateNull(), - new net::SSLConfigServiceDefaults, NULL); + new net::SSLConfigServiceDefaults, NULL, NULL); scoped_ptr<net::HttpTransaction> trans; int rv = factory.CreateTransaction(&trans); @@ -29,7 +29,7 @@ TEST_F(HttpNetworkLayerTest, CreateAndDestroy) { TEST_F(HttpNetworkLayerTest, Suspend) { net::HttpNetworkLayer factory( NULL, NULL, new net::MockHostResolver, net::ProxyService::CreateNull(), - new net::SSLConfigServiceDefaults, NULL); + new net::SSLConfigServiceDefaults, NULL, NULL); scoped_ptr<net::HttpTransaction> trans; int rv = factory.CreateTransaction(&trans); @@ -71,7 +71,7 @@ TEST_F(HttpNetworkLayerTest, GET) { new net::MockHostResolver, net::ProxyService::CreateNull(), new net::SSLConfigServiceDefaults, - NULL); + NULL, NULL); TestCompletionCallback callback; diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc index dddb223..4301a76 100644 --- a/net/http/http_network_session.cc +++ b/net/http/http_network_session.cc @@ -42,7 +42,8 @@ HttpNetworkSession::HttpNetworkSession( ClientSocketFactory* client_socket_factory, SSLConfigService* ssl_config_service, SpdySessionPool* spdy_session_pool, - HttpAuthHandlerFactory* http_auth_handler_factory) + HttpAuthHandlerFactory* http_auth_handler_factory, + NetLog* net_log) : network_change_notifier_(network_change_notifier), // TODO(vandebo) when we've completely converted to pools, the base TCP // pool name should get changed to TCP instead of Transport. @@ -53,13 +54,15 @@ HttpNetworkSession::HttpNetworkSession( socks_pool_histograms_(new ClientSocketPoolHistograms("SOCK")), tcp_socket_pool_(new TCPClientSocketPool( g_max_sockets, g_max_sockets_per_group, tcp_pool_histograms_, - host_resolver, client_socket_factory, network_change_notifier_)), + host_resolver, client_socket_factory, network_change_notifier_, + net_log)), socket_factory_(client_socket_factory), host_resolver_(host_resolver), proxy_service_(proxy_service), ssl_config_service_(ssl_config_service), spdy_session_pool_(spdy_session_pool), - http_auth_handler_factory_(http_auth_handler_factory) { + http_auth_handler_factory_(http_auth_handler_factory), + net_log_(net_log) { DCHECK(proxy_service); DCHECK(ssl_config_service); } @@ -81,7 +84,8 @@ HttpNetworkSession::GetSocketPoolForHTTPProxy(const HostPortPair& http_proxy) { new TCPClientSocketPool( g_max_sockets_per_proxy_server, g_max_sockets_per_group, http_proxy_pool_histograms_, host_resolver_, socket_factory_, - network_change_notifier_))); + network_change_notifier_, + net_log_))); return ret.first->second; } @@ -104,8 +108,9 @@ HttpNetworkSession::GetSocketPoolForSOCKSProxy( g_max_sockets_per_group, tcp_for_socks_pool_histograms_, host_resolver_, socket_factory_, - network_change_notifier_), - network_change_notifier_))); + network_change_notifier_, + net_log_), + network_change_notifier_, net_log_))); return ret.first->second; } @@ -144,7 +149,8 @@ void HttpNetworkSession::ReplaceTCPSocketPool() { tcp_pool_histograms_, host_resolver_, socket_factory_, - network_change_notifier_); + network_change_notifier_, + net_log_); } } // namespace net diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h index 5495c4b..64d302d 100644 --- a/net/http/http_network_session.h +++ b/net/http/http_network_session.h @@ -38,7 +38,8 @@ class HttpNetworkSession : public base::RefCounted<HttpNetworkSession> { ClientSocketFactory* client_socket_factory, SSLConfigService* ssl_config_service, SpdySessionPool* spdy_session_pool, - HttpAuthHandlerFactory* http_auth_handler_factory); + HttpAuthHandlerFactory* http_auth_handler_factory, + NetLog* net_log); HttpAuthCache* auth_cache() { return &auth_cache_; } SSLClientAuthCache* ssl_client_auth_cache() { @@ -123,6 +124,7 @@ class HttpNetworkSession : public base::RefCounted<HttpNetworkSession> { scoped_refptr<SSLConfigService> ssl_config_service_; scoped_refptr<SpdySessionPool> spdy_session_pool_; HttpAuthHandlerFactory* http_auth_handler_factory_; + NetLog* net_log_; SpdySettingsStorage spdy_settings_; }; diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index 79d176f..f0c111a 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc @@ -114,7 +114,8 @@ HttpNetworkSession* CreateSession(SessionDependencies* session_deps) { &session_deps->socket_factory, session_deps->ssl_config_service, session_deps->spdy_session_pool, - session_deps->http_auth_handler_factory.get()); + session_deps->http_auth_handler_factory.get(), + NULL); } class HttpNetworkTransactionTest : public PlatformTest { @@ -237,9 +238,9 @@ std::string MockGetHostName() { template<typename EmulatedClientSocketPool> class CaptureGroupNameSocketPool : public EmulatedClientSocketPool { public: - CaptureGroupNameSocketPool(HttpNetworkSession* session) + explicit CaptureGroupNameSocketPool(HttpNetworkSession* session) : EmulatedClientSocketPool(0, 0, NULL, session->host_resolver(), NULL, - NULL) {} + NULL, NULL) {} const std::string last_group_name_received() const { return last_group_name_; } @@ -5589,7 +5590,7 @@ TEST_F(HttpNetworkTransactionTest, ResolveCanonicalName) { class TLSDecompressionFailureSocketDataProvider : public SocketDataProvider { public: - TLSDecompressionFailureSocketDataProvider(bool fail_all) + explicit TLSDecompressionFailureSocketDataProvider(bool fail_all) : fail_all_(fail_all) { } |