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

Unified Diff: net/http/http_stream_factory_impl_job.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_job.h
diff --git a/net/http/http_stream_factory_impl_job.h b/net/http/http_stream_factory_impl_job.h
index 81b812a60833e0aab87eed5d1acdcc1a0ac1329e..b6d55239f6c452a5edf1fbe44686d7bd637a6c2e 100644
--- a/net/http/http_stream_factory_impl_job.h
+++ b/net/http/http_stream_factory_impl_job.h
@@ -86,6 +86,7 @@ class HttpStreamFactoryImpl::Job {
NextProto protocol_negotiated() const;
bool using_spdy() const;
const BoundNetLog& net_log() const { return net_log_; }
+ bool for_bidirectional() const { return for_bidirectional_; }
const SSLConfig& server_ssl_config() const;
const SSLConfig& proxy_ssl_config() const;
@@ -194,6 +195,7 @@ class HttpStreamFactoryImpl::Job {
};
void OnStreamReadyCallback();
+ void OnBidirectionalStreamReadyCallback();
void OnWebSocketHandshakeStreamReadyCallback();
// This callback function is called when a new SPDY session is created.
void OnNewSpdySessionReadyCallback();
@@ -228,9 +230,11 @@ class HttpStreamFactoryImpl::Job {
int DoRestartTunnelAuth();
int DoRestartTunnelAuthComplete(int result);
- // Creates a SpdyHttpStream from the given values and sets to |stream_|. Does
+ // Creates a SpdyHttpStream or a BidirectionalStream from the given values
+ // and sets to |stream_| or |bidirectional_stream_| respectively. Does
// nothing if |stream_factory_| is for WebSockets.
- int SetSpdyHttpStream(base::WeakPtr<SpdySession> session, bool direct);
+ int SetSpdyHttpStreamOrBidirectionalStream(base::WeakPtr<SpdySession> session,
+ bool direct);
// Returns to STATE_INIT_CONNECTION and resets some state.
void ReturnToStateInitConnection(bool close_connection);
@@ -368,6 +372,7 @@ class HttpStreamFactoryImpl::Job {
scoped_ptr<HttpStream> stream_;
scoped_ptr<WebSocketHandshakeStreamBase> websocket_stream_;
+ scoped_ptr<BidirectionalStream> bidirectional_stream_;
// True if we negotiated NPN.
bool was_npn_negotiated_;
@@ -393,6 +398,9 @@ class HttpStreamFactoryImpl::Job {
JobStatus job_status_;
JobStatus other_job_status_;
+ // True if BidirectionalStream is requested.
+ bool for_bidirectional_;
+
base::WeakPtrFactory<Job> ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(Job);

Powered by Google App Engine
This is Rietveld 408576698