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 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 // Other state (i.e. |using_ssl_|) suggests that |connection_| will have an | 982 // Other state (i.e. |using_ssl_|) suggests that |connection_| will have an |
983 // SSL socket, but there was an error before that could happen. This | 983 // SSL socket, but there was an error before that could happen. This |
984 // puts the in progress HttpProxy socket into |connection_| in order to | 984 // puts the in progress HttpProxy socket into |connection_| in order to |
985 // complete the auth (or read the response body). The tunnel restart code | 985 // complete the auth (or read the response body). The tunnel restart code |
986 // is careful to remove it before returning control to the rest of this | 986 // is careful to remove it before returning control to the rest of this |
987 // class. | 987 // class. |
988 connection_.reset(connection_->release_pending_http_proxy_connection()); | 988 connection_.reset(connection_->release_pending_http_proxy_connection()); |
989 return result; | 989 return result; |
990 } | 990 } |
991 | 991 |
992 if (using_quic_) { | |
993 if (result < 0) | |
994 return result; | |
995 stream_ = quic_request_.ReleaseStream(); | |
996 next_state_ = STATE_NONE; | |
997 return OK; | |
998 } | |
999 | |
1000 if (!ssl_started && result < 0 && original_url_.get()) { | 992 if (!ssl_started && result < 0 && original_url_.get()) { |
1001 job_status_ = STATUS_BROKEN; | 993 job_status_ = STATUS_BROKEN; |
1002 MaybeMarkAlternateProtocolBroken(); | 994 MaybeMarkAlternateProtocolBroken(); |
1003 return result; | 995 return result; |
1004 } | 996 } |
1005 | 997 |
| 998 if (using_quic_) { |
| 999 if (result < 0) { |
| 1000 job_status_ = STATUS_BROKEN; |
| 1001 MaybeMarkAlternateProtocolBroken(); |
| 1002 return result; |
| 1003 } |
| 1004 stream_ = quic_request_.ReleaseStream(); |
| 1005 next_state_ = STATE_NONE; |
| 1006 return OK; |
| 1007 } |
| 1008 |
1006 if (result < 0 && !ssl_started) | 1009 if (result < 0 && !ssl_started) |
1007 return ReconsiderProxyAfterError(result); | 1010 return ReconsiderProxyAfterError(result); |
1008 establishing_tunnel_ = false; | 1011 establishing_tunnel_ = false; |
1009 | 1012 |
1010 if (connection_->socket()) { | 1013 if (connection_->socket()) { |
1011 LogHttpConnectedMetrics(*connection_); | 1014 LogHttpConnectedMetrics(*connection_); |
1012 | 1015 |
1013 // We officially have a new connection. Record the type. | 1016 // We officially have a new connection. Record the type. |
1014 if (!connection_->is_reused()) { | 1017 if (!connection_->is_reused()) { |
1015 ConnectionType type = using_spdy_ ? CONNECTION_SPDY : CONNECTION_HTTP; | 1018 ConnectionType type = using_spdy_ ? CONNECTION_SPDY : CONNECTION_HTTP; |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1520 if (job_status_ == STATUS_BROKEN && other_job_status_ == STATUS_SUCCEEDED) { | 1523 if (job_status_ == STATUS_BROKEN && other_job_status_ == STATUS_SUCCEEDED) { |
1521 HistogramBrokenAlternateProtocolLocation( | 1524 HistogramBrokenAlternateProtocolLocation( |
1522 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_ALT); | 1525 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_ALT); |
1523 session_->http_server_properties()->SetBrokenAlternateProtocol( | 1526 session_->http_server_properties()->SetBrokenAlternateProtocol( |
1524 HostPortPair::FromURL(*original_url_)); | 1527 HostPortPair::FromURL(*original_url_)); |
1525 } | 1528 } |
1526 return; | 1529 return; |
1527 } | 1530 } |
1528 | 1531 |
1529 if (job_status_ == STATUS_SUCCEEDED && other_job_status_ == STATUS_BROKEN) { | 1532 if (job_status_ == STATUS_SUCCEEDED && other_job_status_ == STATUS_BROKEN) { |
1530 HistogramBrokenAlternateProtocolLocation( | 1533 HistogramBrokenAlternateProtocolLocation( |
1531 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_MAIN); | 1534 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_MAIN); |
1532 session_->http_server_properties()->SetBrokenAlternateProtocol( | 1535 session_->http_server_properties()->SetBrokenAlternateProtocol( |
1533 HostPortPair::FromURL(request_info_.url)); | 1536 HostPortPair::FromURL(request_info_.url)); |
1534 } | 1537 } |
1535 } | 1538 } |
1536 | 1539 |
1537 } // namespace net | 1540 } // namespace net |
OLD | NEW |