From 81cdfcd5d551d8d581952a27ae968803ad856a39 Mon Sep 17 00:00:00 2001 From: "willchan@chromium.org" Date: Sat, 16 Oct 2010 00:49:00 +0000 Subject: Plumb up the preconnect logic from pools to StreamFactory. BUG=54450 TEST=none Review URL: http://codereview.chromium.org/3750009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62827 0039d316-1c4b-4281-b951-d872f2087c98 --- net/http/http_stream_factory.h | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'net/http/http_stream_factory.h') diff --git a/net/http/http_stream_factory.h b/net/http/http_stream_factory.h index b9f5586..b619add 100644 --- a/net/http/http_stream_factory.h +++ b/net/http/http_stream_factory.h @@ -5,6 +5,7 @@ #ifndef NET_HTTP_HTTP_STREAM_FACTORY_H_ #define NET_HTTP_HTTP_STREAM_FACTORY_H_ +#include #include #include @@ -14,6 +15,7 @@ #include "net/base/ssl_config_service.h" #include "net/http/http_auth.h" #include "net/http/http_auth_controller.h" +#include "net/http/http_stream_request.h" #include "net/http/stream_factory.h" #include "net/proxy/proxy_service.h" #include "net/socket/client_socket_handle.h" @@ -22,9 +24,10 @@ namespace net { class HttpNetworkSession; struct HttpRequestInfo; +class HttpStreamRequest; class HttpStreamFactory : public StreamFactory, - public base::RefCounted { + public HttpStreamRequest::PreconnectDelegate { public: HttpStreamFactory(); virtual ~HttpStreamFactory(); @@ -37,17 +40,26 @@ class HttpStreamFactory : public StreamFactory, StreamRequest::Delegate* delegate, const BoundNetLog& net_log); - // TLS Intolerant Server API + virtual int PreconnectStreams(int num_streams, + const HttpRequestInfo* info, + SSLConfig* ssl_config, + ProxyInfo* proxy_info, + HttpNetworkSession* session, + const BoundNetLog& net_log, + CompletionCallback* callback); + void AddTLSIntolerantServer(const GURL& url); bool IsTLSIntolerantServer(const GURL& url); - // Alternate Protocol API - void ProcessAlternateProtocol(HttpAlternateProtocols* alternate_protocols, - const std::string& alternate_protocol_str, - const HostPortPair& http_host_port_pair); + virtual void ProcessAlternateProtocol( + HttpAlternateProtocols* alternate_protocols, + const std::string& alternate_protocol_str, + const HostPortPair& http_host_port_pair); + + virtual GURL ApplyHostMappingRules(const GURL& url, HostPortPair* endpoint); - // Host Mapping Rules API - GURL ApplyHostMappingRules(const GURL& url, HostPortPair* endpoint); + // HttpStreamRequest::PreconnectDelegate API + virtual void OnPreconnectsComplete(HttpStreamRequest* request, int result); // Static settings @@ -98,6 +110,8 @@ class HttpStreamFactory : public StreamFactory, static void SetHostMappingRules(const std::string& rules); private: + typedef std::map RequestCallbackMap; + RequestCallbackMap request_callback_map_; std::set tls_intolerant_servers_; static const HostMappingRules* host_mapping_rules_; -- cgit v1.1