summaryrefslogtreecommitdiffstats
path: root/net/http/http_stream_factory.h
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-16 00:49:00 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-16 00:49:00 +0000
commit81cdfcd5d551d8d581952a27ae968803ad856a39 (patch)
tree6f3806fb275ea36dddd43bd9d6efff96a93a2c77 /net/http/http_stream_factory.h
parentd770c84f903bd2058e33c6635c553f22c455efd3 (diff)
downloadchromium_src-81cdfcd5d551d8d581952a27ae968803ad856a39.zip
chromium_src-81cdfcd5d551d8d581952a27ae968803ad856a39.tar.gz
chromium_src-81cdfcd5d551d8d581952a27ae968803ad856a39.tar.bz2
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
Diffstat (limited to 'net/http/http_stream_factory.h')
-rw-r--r--net/http/http_stream_factory.h30
1 files changed, 22 insertions, 8 deletions
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 <map>
#include <set>
#include <string>
@@ -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<HttpStreamFactory> {
+ 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<HttpStreamRequest*, CompletionCallback*> RequestCallbackMap;
+ RequestCallbackMap request_callback_map_;
std::set<std::string> tls_intolerant_servers_;
static const HostMappingRules* host_mapping_rules_;