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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
160 case STATE_INIT_CONNECTION_COMPLETE: | 160 case STATE_INIT_CONNECTION_COMPLETE: |
161 case STATE_CREATE_STREAM_COMPLETE: | 161 case STATE_CREATE_STREAM_COMPLETE: |
162 return using_quic_ ? LOAD_STATE_CONNECTING : connection_->GetLoadState(); | 162 return using_quic_ ? LOAD_STATE_CONNECTING : connection_->GetLoadState(); |
163 default: | 163 default: |
164 return LOAD_STATE_IDLE; | 164 return LOAD_STATE_IDLE; |
165 } | 165 } |
166 } | 166 } |
167 | 167 |
168 void HttpStreamFactoryImpl::Job::MarkAsAlternate( | 168 void HttpStreamFactoryImpl::Job::MarkAsAlternate( |
169 const GURL& original_url, | 169 const GURL& original_url, |
170 AlternateProtocolInfo alternate) { | 170 AlternateProtocolInfo alternate) { |
Ryan Hamilton
2015/02/27 18:20:48
As discussed yesterday, this should probably take
Bence
2015/02/27 19:31:41
Acknowledged.
By the way, what guarantees that Jo
| |
171 DCHECK(!original_url_.get()); | 171 DCHECK(!original_url_.get()); |
172 original_url_.reset(new GURL(original_url)); | 172 original_url_.reset(new GURL(original_url)); |
173 alternate_protocol_ = alternate; | 173 alternate_protocol_ = alternate; |
174 if (alternate.protocol == QUIC) { | 174 if (alternate.protocol == QUIC) { |
175 DCHECK(session_->params().enable_quic); | 175 DCHECK(session_->params().enable_quic); |
176 using_quic_ = true; | 176 using_quic_ = true; |
177 } | 177 } |
178 } | 178 } |
179 | 179 |
180 void HttpStreamFactoryImpl::Job::WaitFor(Job* job) { | 180 void HttpStreamFactoryImpl::Job::WaitFor(Job* job) { |
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1520 void HttpStreamFactoryImpl::Job::MaybeMarkAlternateProtocolBroken() { | 1520 void HttpStreamFactoryImpl::Job::MaybeMarkAlternateProtocolBroken() { |
1521 if (job_status_ == STATUS_RUNNING || other_job_status_ == STATUS_RUNNING) | 1521 if (job_status_ == STATUS_RUNNING || other_job_status_ == STATUS_RUNNING) |
1522 return; | 1522 return; |
1523 | 1523 |
1524 bool is_alternate_protocol_job = original_url_.get() != NULL; | 1524 bool is_alternate_protocol_job = original_url_.get() != NULL; |
1525 if (is_alternate_protocol_job) { | 1525 if (is_alternate_protocol_job) { |
1526 if (job_status_ == STATUS_BROKEN && other_job_status_ == STATUS_SUCCEEDED) { | 1526 if (job_status_ == STATUS_BROKEN && other_job_status_ == STATUS_SUCCEEDED) { |
1527 HistogramBrokenAlternateProtocolLocation( | 1527 HistogramBrokenAlternateProtocolLocation( |
1528 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_ALT); | 1528 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_ALT); |
1529 session_->http_server_properties()->SetBrokenAlternateProtocol( | 1529 session_->http_server_properties()->SetBrokenAlternateProtocol( |
1530 HostPortPair::FromURL(*original_url_)); | 1530 HostPortPair::FromURL(*original_url_), alternate_protocol_); |
1531 } | 1531 } |
1532 return; | 1532 return; |
1533 } | 1533 } |
1534 | 1534 |
1535 if (job_status_ == STATUS_SUCCEEDED && other_job_status_ == STATUS_BROKEN) { | 1535 if (job_status_ == STATUS_SUCCEEDED && other_job_status_ == STATUS_BROKEN) { |
1536 HistogramBrokenAlternateProtocolLocation( | 1536 HistogramBrokenAlternateProtocolLocation( |
1537 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_MAIN); | 1537 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_MAIN); |
1538 session_->http_server_properties()->SetBrokenAlternateProtocol( | 1538 session_->http_server_properties()->SetBrokenAlternateProtocol( |
1539 HostPortPair::FromURL(request_info_.url)); | 1539 HostPortPair::FromURL(request_info_.url), |
1540 other_job_alternate_protocol_); | |
1540 } | 1541 } |
1541 } | 1542 } |
1542 | 1543 |
1543 } // namespace net | 1544 } // namespace net |
OLD | NEW |