Chromium Code Reviews| Index: net/http/http_stream_factory_impl.h |
| diff --git a/net/http/http_stream_factory_impl.h b/net/http/http_stream_factory_impl.h |
| index 80e96ce8ab43d2707e5bac2d3ad8615f53a840af..d36751130ba752de0329557b915aeb158ef16084 100644 |
| --- a/net/http/http_stream_factory_impl.h |
| +++ b/net/http/http_stream_factory_impl.h |
| @@ -15,6 +15,7 @@ |
| #include "net/http/http_pipelined_host_pool.h" |
| #include "net/http/http_stream_factory.h" |
| #include "net/proxy/proxy_server.h" |
| +#include "net/socket/client_socket_pool_manager.h" |
| #include "net/socket/ssl_client_socket.h" |
| #include "net/spdy/spdy_session_key.h" |
| @@ -28,7 +29,9 @@ class NET_EXPORT_PRIVATE HttpStreamFactoryImpl : |
| public HttpStreamFactory, |
| public HttpPipelinedHostPool::Delegate { |
| public: |
| - explicit HttpStreamFactoryImpl(HttpNetworkSession* session); |
| + // RequestStream may only be called if |for_websockets| is false. |
| + // RequestWebSocketStream may only be called if |for_websockets| is true. |
| + HttpStreamFactoryImpl(HttpNetworkSession* session, bool for_websockets); |
| virtual ~HttpStreamFactoryImpl(); |
| // HttpStreamFactory interface |
| @@ -40,6 +43,15 @@ class NET_EXPORT_PRIVATE HttpStreamFactoryImpl : |
| HttpStreamRequest::Delegate* delegate, |
| const BoundNetLog& net_log) OVERRIDE; |
| + virtual HttpStreamRequest* RequestWebSocketStream( |
| + const HttpRequestInfo& info, |
| + RequestPriority priority, |
| + const SSLConfig& server_ssl_config, |
| + const SSLConfig& proxy_ssl_config, |
| + HttpStreamRequest::Delegate* delegate, |
| + WebSocketStreamBase::Factory* factory, |
| + const BoundNetLog& net_log) OVERRIDE; |
| + |
| virtual void PreconnectStreams(int num_streams, |
| const HttpRequestInfo& info, |
| RequestPriority priority, |
| @@ -52,6 +64,21 @@ class NET_EXPORT_PRIVATE HttpStreamFactoryImpl : |
| virtual void OnHttpPipelinedHostHasAdditionalCapacity( |
| HttpPipelinedHost* host) OVERRIDE; |
| + // For testing purpose |
|
mmenke
2013/05/28 21:22:37
nit: Add period. Also should be "purposes".
yhirano
2013/05/30 04:44:32
Deleted.
|
| + virtual int InitSocketHandleForHttpRequest( |
|
mmenke
2013/05/28 21:22:37
This should be protected.
yhirano
2013/05/30 04:44:32
Deleted.
|
| + const GURL& request_url, |
| + const HttpRequestInfo& request_info, |
| + RequestPriority request_priority, |
| + const ProxyInfo& proxy_info, |
| + bool force_spdy_over_ssl, |
| + bool want_spdy_over_npn, |
| + const SSLConfig& ssl_config_for_origin, |
| + const SSLConfig& ssl_config_for_proxy, |
| + const BoundNetLog& net_log, |
| + ClientSocketHandle* socket_handle, |
| + const OnHostResolutionCallback& resolution_callback, |
| + const CompletionCallback& callback); |
| + |
| private: |
| class Request; |
| class Job; |
| @@ -62,6 +89,15 @@ class NET_EXPORT_PRIVATE HttpStreamFactoryImpl : |
| typedef std::map<HttpPipelinedHost::Key, |
| RequestVector> HttpPipeliningRequestMap; |
| + HttpStreamRequest* RequestStreamInternal( |
| + const HttpRequestInfo& info, |
| + RequestPriority priority, |
| + const SSLConfig& server_ssl_config, |
| + const SSLConfig& proxy_ssl_config, |
| + HttpStreamRequest::Delegate* delegate, |
| + WebSocketStreamBase::Factory* factory, |
| + const BoundNetLog& net_log); |
| + |
| PortAlternateProtocolPair GetAlternateProtocolRequestFor( |
| const GURL& original_url, |
| GURL* alternate_url) const; |
| @@ -72,14 +108,14 @@ class NET_EXPORT_PRIVATE HttpStreamFactoryImpl : |
| // Called when a SpdySession is ready. It will find appropriate Requests and |
| // fulfill them. |direct| indicates whether or not |spdy_session| uses a |
| // proxy. |
| - void OnSpdySessionReady(scoped_refptr<SpdySession> spdy_session, |
| - bool direct, |
| - const SSLConfig& used_ssl_config, |
| - const ProxyInfo& used_proxy_info, |
| - bool was_npn_negotiated, |
| - NextProto protocol_negotiated, |
| - bool using_spdy, |
| - const BoundNetLog& net_log); |
| + void OnNewSpdySessionReady(scoped_refptr<SpdySession> spdy_session, |
| + bool direct, |
| + const SSLConfig& used_ssl_config, |
| + const ProxyInfo& used_proxy_info, |
| + bool was_npn_negotiated, |
| + NextProto protocol_negotiated, |
| + bool using_spdy, |
| + const BoundNetLog& net_log); |
| // Called when the Job detects that the endpoint indicated by the |
| // Alternate-Protocol does not work. Lets the factory update |
| @@ -124,6 +160,7 @@ class NET_EXPORT_PRIVATE HttpStreamFactoryImpl : |
| // deleted when the factory is destroyed. |
| std::set<const Job*> preconnect_job_set_; |
| + const bool for_websockets_; |
| DISALLOW_COPY_AND_ASSIGN(HttpStreamFactoryImpl); |
| }; |