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

Unified Diff: net/http/http_stream_factory_impl_request.h

Issue 1326503003: Added a net::BidirectionalStream to expose a bidirectional streaming interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self review Created 5 years 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_request.h
diff --git a/net/http/http_stream_factory_impl_request.h b/net/http/http_stream_factory_impl_request.h
index dfa9d2ebe194f153759ce6fec6e94ae7545f7954..9f53bd0e4fdabf98b48b83f401580683b27577e5 100644
--- a/net/http/http_stream_factory_impl_request.h
+++ b/net/http/http_stream_factory_impl_request.h
@@ -19,18 +19,27 @@
namespace net {
+class BidirectionalStreamJob;
class ClientSocketHandle;
class HttpStream;
class SpdySession;
class HttpStreamFactoryImpl::Request : public HttpStreamRequest {
public:
+ // Indicates which type of stream is requested.
+ enum StreamType {
+ BIDIRECTIONAL_STREAM_SPDY_JOB,
+ HTTP_STREAM,
+ };
+
Request(const GURL& url,
HttpStreamFactoryImpl* factory,
HttpStreamRequest::Delegate* delegate,
WebSocketHandshakeStreamBase::CreateHelper*
websocket_handshake_stream_create_helper,
- const BoundNetLog& net_log);
+ const BoundNetLog& net_log,
+ StreamType stream_type);
+
~Request() override;
// The GURL from the HttpRequestInfo the started the Request.
@@ -59,10 +68,14 @@ class HttpStreamFactoryImpl::Request : public HttpStreamRequest {
void RemoveRequestFromSpdySessionRequestMap();
// Called by an attached Job if it sets up a SpdySession.
- void OnNewSpdySessionReady(Job* job,
- scoped_ptr<HttpStream> stream,
- const base::WeakPtr<SpdySession>& spdy_session,
- bool direct);
+ // |stream| is null when |for_bidirectional| is true.
+ // |bidirectional_stream_spdy_job| is null when |for_bidirectional| is false.
+ void OnNewSpdySessionReady(
+ Job* job,
+ scoped_ptr<HttpStream> stream,
+ scoped_ptr<BidirectionalStreamJob> bidirectional_stream_spdy_job,
+ const base::WeakPtr<SpdySession>& spdy_session,
+ bool direct);
// Called by an attached Job to record connection attempts made by the socket
// layer for this stream request.
@@ -80,6 +93,11 @@ class HttpStreamFactoryImpl::Request : public HttpStreamRequest {
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
HttpStream* stream);
+ void OnBidirectionalStreamJobReady(Job* job,
+ const SSLConfig& used_ssl_config,
+ const ProxyInfo& used_proxy_info,
+ BidirectionalStreamJob* stream);
+
void OnWebSocketHandshakeStreamReady(Job* job,
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
@@ -116,6 +134,7 @@ class HttpStreamFactoryImpl::Request : public HttpStreamRequest {
NextProto protocol_negotiated() const override;
bool using_spdy() const override;
const ConnectionAttempts& connection_attempts() const override;
+ bool for_bidirectional() const { return for_bidirectional_; }
private:
// Used to bind |job| to the request and orphan all other jobs in |jobs_|.
@@ -149,6 +168,7 @@ class HttpStreamFactoryImpl::Request : public HttpStreamRequest {
bool using_spdy_;
ConnectionAttempts connection_attempts_;
+ const bool for_bidirectional_;
DISALLOW_COPY_AND_ASSIGN(Request);
};

Powered by Google App Engine
This is Rietveld 408576698