OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/http/http_stream_factory_impl_job.h" | 5 #include "net/http/http_stream_factory_impl_job.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 spdy_session_key, net_log_); | 783 spdy_session_key, net_log_); |
784 if (spdy_session && CanUseExistingSpdySession()) { | 784 if (spdy_session && CanUseExistingSpdySession()) { |
785 // If we're preconnecting, but we already have a SpdySession, we don't | 785 // If we're preconnecting, but we already have a SpdySession, we don't |
786 // actually need to preconnect any sockets, so we're done. | 786 // actually need to preconnect any sockets, so we're done. |
787 if (IsPreconnecting()) | 787 if (IsPreconnecting()) |
788 return OK; | 788 return OK; |
789 using_spdy_ = true; | 789 using_spdy_ = true; |
790 next_state_ = STATE_CREATE_STREAM; | 790 next_state_ = STATE_CREATE_STREAM; |
791 existing_spdy_session_ = spdy_session; | 791 existing_spdy_session_ = spdy_session; |
792 return OK; | 792 return OK; |
793 } else if (request_ && (using_ssl_ || ShouldForceSpdyWithoutSSL())) { | 793 } else if (request_ && !request_->HasSpdySessionKey() && |
| 794 (using_ssl_ || ShouldForceSpdyWithoutSSL())) { |
794 // Update the spdy session key for the request that launched this job. | 795 // Update the spdy session key for the request that launched this job. |
795 request_->SetSpdySessionKey(spdy_session_key); | 796 request_->SetSpdySessionKey(spdy_session_key); |
796 } | 797 } |
797 | 798 |
798 // OK, there's no available SPDY session. Let |waiting_job_| resume if it's | 799 // OK, there's no available SPDY session. Let |waiting_job_| resume if it's |
799 // paused. | 800 // paused. |
800 | 801 |
801 if (waiting_job_) { | 802 if (waiting_job_) { |
802 waiting_job_->Resume(this); | 803 waiting_job_->Resume(this); |
803 waiting_job_ = NULL; | 804 waiting_job_ = NULL; |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1472 | 1473 |
1473 if (job_status_ == STATUS_SUCCEEDED && other_job_status_ == STATUS_BROKEN) { | 1474 if (job_status_ == STATUS_SUCCEEDED && other_job_status_ == STATUS_BROKEN) { |
1474 HistogramBrokenAlternateProtocolLocation( | 1475 HistogramBrokenAlternateProtocolLocation( |
1475 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_MAIN); | 1476 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_MAIN); |
1476 session_->http_server_properties()->SetBrokenAlternateProtocol( | 1477 session_->http_server_properties()->SetBrokenAlternateProtocol( |
1477 HostPortPair::FromURL(request_info_.url)); | 1478 HostPortPair::FromURL(request_info_.url)); |
1478 } | 1479 } |
1479 } | 1480 } |
1480 | 1481 |
1481 } // namespace net | 1482 } // namespace net |
OLD | NEW |