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 a8a94189d4eeefc9737659370bca94449a723ca2..29db19c59d76601433be7d3d89316c576ad220bf 100644 |
--- a/net/http/http_stream_factory_impl.cc |
+++ b/net/http/http_stream_factory_impl.cc |
@@ -89,8 +89,9 @@ HttpStreamRequest* HttpStreamFactoryImpl::RequestStreamInternal( |
delegate, |
websocket_handshake_stream_create_helper, |
net_log); |
+ // Default constructed AlternativeService for non-alternative Job. |
Job* job = new Job(this, session_, request_info, priority, server_ssl_config, |
- proxy_ssl_config, net_log.net_log()); |
+ proxy_ssl_config, AlternativeService(), net_log.net_log()); |
request->AttachJob(job); |
AlternativeService alternative_service = |
@@ -99,22 +100,21 @@ HttpStreamRequest* HttpStreamFactoryImpl::RequestStreamInternal( |
// Never share connection with other jobs for FTP requests. |
DCHECK(!request_info.url.SchemeIs("ftp")); |
- Job* alternate_job = |
+ Job* alternative_job = |
new Job(this, session_, request_info, priority, server_ssl_config, |
- proxy_ssl_config, net_log.net_log()); |
- request->AttachJob(alternate_job); |
- alternate_job->MarkAsAlternate(alternative_service); |
+ proxy_ssl_config, alternative_service, net_log.net_log()); |
+ request->AttachJob(alternative_job); |
- job->WaitFor(alternate_job); |
+ job->WaitFor(alternative_job); |
// Make sure to wait until we call WaitFor(), before starting |
- // |alternate_job|, otherwise |alternate_job| will not notify |job| |
+ // |alternative_job|, otherwise |alternative_job| will not notify |job| |
// appropriately. |
- alternate_job->Start(request); |
+ alternative_job->Start(request); |
} |
- // Even if |alternate_job| has already finished, it won't have notified the |
- // request yet, since we defer that to the next iteration of the MessageLoop, |
- // so starting |job| is always safe. |
+ // Even if |alternative_job| has already finished, it will not have notified |
+ // the request yet, since we defer that to the next iteration of the |
+ // MessageLoop, so starting |job| is always safe. |
job->Start(request); |
return request; |
} |
@@ -128,11 +128,9 @@ void HttpStreamFactoryImpl::PreconnectStreams( |
DCHECK(!for_websockets_); |
AlternativeService alternative_service = |
GetAlternativeServiceFor(request_info.url); |
- Job* job = new Job(this, session_, request_info, priority, server_ssl_config, |
- proxy_ssl_config, session_->net_log()); |
- if (alternative_service.protocol != UNINITIALIZED_ALTERNATE_PROTOCOL) { |
- job->MarkAsAlternate(alternative_service); |
- } |
+ Job* job = |
+ new Job(this, session_, request_info, priority, server_ssl_config, |
+ proxy_ssl_config, alternative_service, session_->net_log()); |
preconnect_job_set_.insert(job); |
job->Preconnect(num_streams); |
} |