Chromium Code Reviews| 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 962f513dc20af36ad4f58b4218d2bf8341a9be8e..6fccecf3db77213d48ceb76d4750ef07f487c1b2 100644 |
| --- a/net/http/http_stream_factory_impl.cc |
| +++ b/net/http/http_stream_factory_impl.cc |
| @@ -54,12 +54,8 @@ HttpStreamRequest* HttpStreamFactoryImpl::RequestStream( |
| HttpStreamRequest::Delegate* delegate, |
| const BoundNetLog& net_log) { |
| DCHECK(!for_websockets_); |
| - return RequestStreamInternal(request_info, |
| - priority, |
| - server_ssl_config, |
| - proxy_ssl_config, |
| - delegate, |
| - NULL, |
| + return RequestStreamInternal(request_info, priority, server_ssl_config, |
| + proxy_ssl_config, delegate, nullptr, false, |
|
Ryan Hamilton
2016/02/27 00:21:14
"false" is not super readable here ("what is false
xunjieli
2016/02/29 15:21:37
Done.
|
| net_log); |
| } |
| @@ -73,12 +69,8 @@ HttpStreamRequest* HttpStreamFactoryImpl::RequestWebSocketHandshakeStream( |
| const BoundNetLog& net_log) { |
| DCHECK(for_websockets_); |
| DCHECK(create_helper); |
| - return RequestStreamInternal(request_info, |
| - priority, |
| - server_ssl_config, |
| - proxy_ssl_config, |
| - delegate, |
| - create_helper, |
| + return RequestStreamInternal(request_info, priority, server_ssl_config, |
| + proxy_ssl_config, delegate, create_helper, false, |
| net_log); |
| } |
| @@ -92,24 +84,9 @@ HttpStreamRequest* HttpStreamFactoryImpl::RequestBidirectionalStreamJob( |
| DCHECK(!for_websockets_); |
| DCHECK(request_info.url.SchemeIs(url::kHttpsScheme)); |
| -// TODO(xunjieli): Create QUIC's version of BidirectionalStreamJob. |
| -#if BUILDFLAG(ENABLE_BIDIRECTIONAL_STREAM) |
| - HostPortPair server = HostPortPair::FromURL(request_info.url); |
| - GURL origin_url = ApplyHostMappingRules(request_info.url, &server); |
| - Request* request = |
| - new Request(request_info.url, this, delegate, nullptr, net_log, |
| - Request::BIDIRECTIONAL_STREAM_SPDY_JOB); |
| - Job* job = new Job(this, session_, request_info, priority, server_ssl_config, |
| - proxy_ssl_config, server, origin_url, net_log.net_log()); |
| - request->AttachJob(job); |
| - |
| - job->Start(request); |
| - return request; |
| - |
| -#else |
| - DCHECK(false); |
| - return nullptr; |
| -#endif |
| + return RequestStreamInternal(request_info, priority, server_ssl_config, |
| + proxy_ssl_config, delegate, nullptr, |
| + /*for_bidirectional=*/true, net_log); |
| } |
| HttpStreamRequest* HttpStreamFactoryImpl::RequestStreamInternal( |
| @@ -120,10 +97,13 @@ HttpStreamRequest* HttpStreamFactoryImpl::RequestStreamInternal( |
| HttpStreamRequest::Delegate* delegate, |
| WebSocketHandshakeStreamBase::CreateHelper* |
| websocket_handshake_stream_create_helper, |
| + bool for_bidirectional, |
| const BoundNetLog& net_log) { |
| - Request* request = new Request(request_info.url, this, delegate, |
| - websocket_handshake_stream_create_helper, |
| - net_log, Request::HTTP_STREAM); |
| + Request* request = |
| + new Request(request_info.url, this, delegate, |
| + websocket_handshake_stream_create_helper, net_log, |
| + for_bidirectional ? Request::BIDIRECTIONAL_STREAM_SPDY_JOB |
| + : Request::HTTP_STREAM); |
|
Ryan Hamilton
2016/02/27 00:21:14
oh, since you already have an enum, just do that i
xunjieli
2016/02/29 15:21:37
Done. Great idea!
|
| HostPortPair server = HostPortPair::FromURL(request_info.url); |
| GURL origin_url = ApplyHostMappingRules(request_info.url, &server); |