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

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: Address Comments Created 5 years, 2 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_request.h
diff --git a/net/http/http_stream_factory_impl_request.h b/net/http/http_stream_factory_impl_request.h
index e65dac88e45600f7e1bf1d529079276284f296e8..caba122f150cb4d7af9d297d20573a78a6baf9ee 100644
--- a/net/http/http_stream_factory_impl_request.h
+++ b/net/http/http_stream_factory_impl_request.h
@@ -23,12 +23,16 @@ class SpdySession;
class HttpStreamFactoryImpl::Request : public HttpStreamRequest {
public:
+ // |for_bidirectional| should only be true if requesting for a
+ // net::BidirectionalStream.
Request(const GURL& url,
HttpStreamFactoryImpl* factory,
HttpStreamRequest::Delegate* delegate,
WebSocketHandshakeStreamBase::CreateHelper*
websocket_handshake_stream_create_helper,
- const BoundNetLog& net_log);
+ const BoundNetLog& net_log,
+ bool for_bidirectional);
+
~Request() override;
// The GURL from the HttpRequestInfo the started the Request.
@@ -57,10 +61,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| is null when |for_bidirectional| is false.
+ void OnNewSpdySessionReady(
+ Job* job,
+ scoped_ptr<HttpStream> stream,
+ scoped_ptr<BidirectionalStream> bidirectional_stream,
+ 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.
@@ -78,6 +86,11 @@ class HttpStreamFactoryImpl::Request : public HttpStreamRequest {
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
HttpStream* stream);
+ void OnBidirectionalStreamReady(Job* job,
+ const SSLConfig& used_ssl_config,
+ const ProxyInfo& used_proxy_info,
+ BidirectionalStream* stream);
+
void OnWebSocketHandshakeStreamReady(Job* job,
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
@@ -114,6 +127,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_|.
@@ -147,6 +161,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