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

Unified Diff: net/http/http_stream_factory_impl.cc

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: Pass through priority and netlog 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.cc
diff --git a/net/http/http_stream_factory_impl.cc b/net/http/http_stream_factory_impl.cc
index 2a8664e51a6458ed9d087582066a943a03552c27..7f56c942868eb31d94e063b3be5270b70584fe3c 100644
--- a/net/http/http_stream_factory_impl.cc
+++ b/net/http/http_stream_factory_impl.cc
@@ -14,6 +14,7 @@
#include "net/http/http_stream_factory_impl_job.h"
#include "net/http/http_stream_factory_impl_request.h"
#include "net/log/net_log.h"
+#include "net/spdy/bidirectional_spdy_stream.h"
#include "net/spdy/spdy_http_stream.h"
#include "url/gurl.h"
@@ -75,6 +76,24 @@ HttpStreamRequest* HttpStreamFactoryImpl::RequestWebSocketHandshakeStream(
net_log);
}
+HttpStreamRequest* HttpStreamFactoryImpl::RequestBidirectionalStream(
+ const HttpRequestInfo& request_info,
+ RequestPriority priority,
+ const SSLConfig& server_ssl_config,
+ const SSLConfig& proxy_ssl_config,
+ HttpStreamRequest::Delegate* delegate,
+ const BoundNetLog& net_log) {
mmenke 2015/10/08 19:31:53 DCHECK the scheme is HTTPS?
xunjieli 2015/10/19 21:07:46 Done.
+ DCHECK(!for_websockets_);
+ Request* request = new Request(request_info.url, this, delegate, nullptr,
+ net_log, true /** for_bidirectional */);
mmenke 2015/10/08 19:31:53 I'm no HTTP2 expert, but it's my understanding tha
xunjieli 2015/10/19 21:07:46 Acknowledged. Here we don't use RequestStreamInter
+ Job* job = new Job(this, session_, request_info, priority, server_ssl_config,
+ proxy_ssl_config, net_log.net_log());
+ request->AttachJob(job);
+
+ job->Start(request);
+ return request;
+}
+
HttpStreamRequest* HttpStreamFactoryImpl::RequestStreamInternal(
const HttpRequestInfo& request_info,
RequestPriority priority,
@@ -84,11 +103,9 @@ HttpStreamRequest* HttpStreamFactoryImpl::RequestStreamInternal(
WebSocketHandshakeStreamBase::CreateHelper*
websocket_handshake_stream_create_helper,
const BoundNetLog& net_log) {
- Request* request = new Request(request_info.url,
- this,
- delegate,
+ Request* request = new Request(request_info.url, this, delegate,
websocket_handshake_stream_create_helper,
- net_log);
+ net_log, false /** for_bidirectional */);
Job* job = new Job(this, session_, request_info, priority, server_ssl_config,
proxy_ssl_config, net_log.net_log());
request->AttachJob(job);
@@ -260,12 +277,16 @@ void HttpStreamFactoryImpl::OnNewSpdySessionReady(
// TODO(ricea): Restore this code path when WebSocket over SPDY
// implementation is ready.
NOTREACHED();
+ } else if (request->for_bidirectional()) {
+ // TODO(xunjieli): Enable creation of QUIC's version of
+ // BidirectionalStream.
mmenke 2015/10/08 19:31:53 This seems the wrong place for this comment. Mayb
xunjieli 2015/10/19 21:07:46 Done.
+ request->OnBidirectionalStreamReady(
+ nullptr, used_ssl_config, used_proxy_info,
+ new BidirectionalSpdyStream(spdy_session));
} else {
bool use_relative_url = direct || request->url().SchemeIs("https");
request->OnStreamReady(
- NULL,
- used_ssl_config,
- used_proxy_info,
+ nullptr, used_ssl_config, used_proxy_info,
new SpdyHttpStream(spdy_session, use_relative_url));
}
}

Powered by Google App Engine
This is Rietveld 408576698