Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Unified Diff: net/http/http_stream_factory_impl.h

Issue 14813024: Introduce RequestWebSocketStream into HttpStreamFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..d899a17fe5b00c93af9d1dc7183c430330636d36 100644
--- a/net/http/http_stream_factory_impl.h
+++ b/net/http/http_stream_factory_impl.h
@@ -28,7 +28,10 @@ class NET_EXPORT_PRIVATE HttpStreamFactoryImpl :
public HttpStreamFactory,
public HttpPipelinedHostPool::Delegate {
public:
- explicit HttpStreamFactoryImpl(HttpNetworkSession* session);
+ // You can call RequestStream if and only if |for_websocket| is false.
+ // You can call RequestWebSocketStream if and only if |for_websocket| is true.
mmenke 2013/05/24 14:53:22 nit: Some people feel that "you" shouldn't be use
yhirano 2013/05/27 09:21:32 Done.
+ explicit HttpStreamFactoryImpl(HttpNetworkSession* session,
+ bool for_websocket);
mmenke 2013/05/24 14:53:22 nit: Explicit not needed, since we have two argum
mmenke 2013/05/24 14:53:22 Think "for_websockets" may be a little clearer.
yhirano 2013/05/27 09:21:32 Done.
yhirano 2013/05/27 09:21:32 Done.
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,
@@ -62,6 +74,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 +93,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 +145,7 @@ class NET_EXPORT_PRIVATE HttpStreamFactoryImpl :
// deleted when the factory is destroyed.
std::set<const Job*> preconnect_job_set_;
+ const bool for_websocket_;
DISALLOW_COPY_AND_ASSIGN(HttpStreamFactoryImpl);
};

Powered by Google App Engine
This is Rietveld 408576698