| 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 4d32ffcf207320ddfbf65bf5787c98d33770be37..9419aa6142e92e71fbd53357048f942206e6951d 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_stream_spdy_job.h"
|
| #include "net/spdy/spdy_http_stream.h"
|
| #include "url/gurl.h"
|
|
|
| @@ -75,6 +76,29 @@ HttpStreamRequest* HttpStreamFactoryImpl::RequestWebSocketHandshakeStream(
|
| net_log);
|
| }
|
|
|
| +HttpStreamRequest* HttpStreamFactoryImpl::RequestBidirectionalStreamJob(
|
| + const HttpRequestInfo& request_info,
|
| + RequestPriority priority,
|
| + const SSLConfig& server_ssl_config,
|
| + const SSLConfig& proxy_ssl_config,
|
| + HttpStreamRequest::Delegate* delegate,
|
| + const BoundNetLog& net_log) {
|
| + DCHECK(!for_websockets_);
|
| + DCHECK(request_info.url.SchemeIs(url::kHttpsScheme));
|
| +
|
| + // TODO(xunjieli): Create QUIC's version of BidirectionalStreamJob.
|
| +
|
| + 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, net_log.net_log());
|
| + request->AttachJob(job);
|
| +
|
| + job->Start(request);
|
| + return request;
|
| +}
|
| +
|
| HttpStreamRequest* HttpStreamFactoryImpl::RequestStreamInternal(
|
| const HttpRequestInfo& request_info,
|
| RequestPriority priority,
|
| @@ -84,11 +108,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, Request::HTTP_STREAM);
|
| Job* job = new Job(this, session_, request_info, priority, server_ssl_config,
|
| proxy_ssl_config, net_log.net_log());
|
| request->AttachJob(job);
|
| @@ -259,12 +281,14 @@ void HttpStreamFactoryImpl::OnNewSpdySessionReady(
|
| // TODO(ricea): Restore this code path when WebSocket over SPDY
|
| // implementation is ready.
|
| NOTREACHED();
|
| + } else if (request->for_bidirectional()) {
|
| + request->OnBidirectionalStreamJobReady(
|
| + nullptr, used_ssl_config, used_proxy_info,
|
| + new BidirectionalStreamSpdyJob(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));
|
| }
|
| }
|
|
|