| 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 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1469 ssl_info_.cert_status); | 1469 ssl_info_.cert_status); |
| 1470 | 1470 |
| 1471 int load_flags = request_info_.load_flags; | 1471 int load_flags = request_info_.load_flags; |
| 1472 if (session_->params().ignore_certificate_errors) | 1472 if (session_->params().ignore_certificate_errors) |
| 1473 load_flags |= LOAD_IGNORE_ALL_CERT_ERRORS; | 1473 load_flags |= LOAD_IGNORE_ALL_CERT_ERRORS; |
| 1474 if (ssl_socket->IgnoreCertError(error, load_flags)) | 1474 if (ssl_socket->IgnoreCertError(error, load_flags)) |
| 1475 return OK; | 1475 return OK; |
| 1476 return error; | 1476 return error; |
| 1477 } | 1477 } |
| 1478 | 1478 |
| 1479 void HttpStreamFactoryImpl::Job::ReportJobSucceededForRequest() { | |
| 1480 if (using_existing_quic_session_) { | |
| 1481 // If an existing session was used, then no TCP connection was | |
| 1482 // started. | |
| 1483 HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_NO_RACE); | |
| 1484 } else if (IsSpdyAlternative() || IsQuicAlternative()) { | |
| 1485 // This Job was the alternative Job, and hence won the race. | |
| 1486 HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_WON_RACE); | |
| 1487 } else { | |
| 1488 // This Job was the normal Job, and hence the alternative Job lost the race. | |
| 1489 HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_LOST_RACE); | |
| 1490 } | |
| 1491 } | |
| 1492 | |
| 1493 ClientSocketPoolManager::SocketGroupType | 1479 ClientSocketPoolManager::SocketGroupType |
| 1494 HttpStreamFactoryImpl::Job::GetSocketGroup() const { | 1480 HttpStreamFactoryImpl::Job::GetSocketGroup() const { |
| 1495 std::string scheme = origin_url_.scheme(); | 1481 std::string scheme = origin_url_.scheme(); |
| 1496 if (scheme == url::kHttpsScheme || scheme == url::kWssScheme) | 1482 if (scheme == url::kHttpsScheme || scheme == url::kWssScheme) |
| 1497 return ClientSocketPoolManager::SSL_GROUP; | 1483 return ClientSocketPoolManager::SSL_GROUP; |
| 1498 | 1484 |
| 1499 if (scheme == url::kFtpScheme) | 1485 if (scheme == url::kFtpScheme) |
| 1500 return ClientSocketPoolManager::FTP_GROUP; | 1486 return ClientSocketPoolManager::FTP_GROUP; |
| 1501 | 1487 |
| 1502 return ClientSocketPoolManager::NORMAL_GROUP; | 1488 return ClientSocketPoolManager::NORMAL_GROUP; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1514 | 1500 |
| 1515 ConnectionAttempts socket_attempts = connection_->connection_attempts(); | 1501 ConnectionAttempts socket_attempts = connection_->connection_attempts(); |
| 1516 if (connection_->socket()) { | 1502 if (connection_->socket()) { |
| 1517 connection_->socket()->GetConnectionAttempts(&socket_attempts); | 1503 connection_->socket()->GetConnectionAttempts(&socket_attempts); |
| 1518 } | 1504 } |
| 1519 | 1505 |
| 1520 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); | 1506 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); |
| 1521 } | 1507 } |
| 1522 | 1508 |
| 1523 } // namespace net | 1509 } // namespace net |
| OLD | NEW |