Slow start pipelining.
We need to wait for an HTTP/1.1 keep-alive response before we try to pipeline. Notably, this fixes wordpress.com and techcrunch.com.
Remember which hosts clearly support, or don't support pipelining. If pipelining is supported, skip the slow start. If it's not, fall back to HttpBasicStreams.
A site is judged not to support pipelining if we see an old HTTP version or encounter a socket error. A site does support pipelining if it successfully handles 3 requests. There's obviously room for improvement here, but this is a
start.
Related changes:
- In the spirit of CHECK() failing. Use CHECK(false) instead of NOTREACHED().
- HttpPipelinedHost is now an interface with a corresponding Impl. This is to help unit test HttpPipelinedHostPool.
BUG=None
TEST=net_unittests
Review URL: http://codereview.chromium.org/8586015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112557 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/net/http/http_stream_factory_impl.h b/net/http/http_stream_factory_impl.h
index ce1a04eb..8f13f3fc 100644
--- a/net/http/http_stream_factory_impl.h
+++ b/net/http/http_stream_factory_impl.h
@@ -21,12 +21,14 @@
class HttpPipelinedHost;
class SpdySession;
-class NET_EXPORT_PRIVATE HttpStreamFactoryImpl : public HttpStreamFactory {
+class NET_EXPORT_PRIVATE HttpStreamFactoryImpl :
+ public HttpStreamFactory,
+ public HttpPipelinedHostPool::Delegate {
public:
explicit HttpStreamFactoryImpl(HttpNetworkSession* session);
virtual ~HttpStreamFactoryImpl();
- // HttpStreamFactory Interface
+ // HttpStreamFactory interface
virtual HttpStreamRequest* RequestStream(
const HttpRequestInfo& info,
const SSLConfig& server_ssl_config,
@@ -42,10 +44,9 @@
virtual void AddTLSIntolerantServer(const HostPortPair& server) OVERRIDE;
virtual bool IsTLSIntolerantServer(const HostPortPair& server) const OVERRIDE;
- // Called when a HttpPipelinedHost has new capacity. Attempts to allocate any
- // pending pipeline-capable requests to pipelines.
+ // HttpPipelinedHostPool::Delegate interface
virtual void OnHttpPipelinedHostHasAdditionalCapacity(
- const HostPortPair& origin);
+ const HostPortPair& origin) OVERRIDE;
private:
class Request;