| 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 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1476 load_flags |= LOAD_IGNORE_ALL_CERT_ERRORS; | 1476 load_flags |= LOAD_IGNORE_ALL_CERT_ERRORS; |
| 1477 if (ssl_socket->IgnoreCertError(error, load_flags)) | 1477 if (ssl_socket->IgnoreCertError(error, load_flags)) |
| 1478 return OK; | 1478 return OK; |
| 1479 return error; | 1479 return error; |
| 1480 } | 1480 } |
| 1481 | 1481 |
| 1482 void HttpStreamFactoryImpl::Job::SwitchToSpdyMode() { | 1482 void HttpStreamFactoryImpl::Job::SwitchToSpdyMode() { |
| 1483 using_spdy_ = true; | 1483 using_spdy_ = true; |
| 1484 } | 1484 } |
| 1485 | 1485 |
| 1486 void HttpStreamFactoryImpl::Job::ReportJobSucceededForRequest() { | |
| 1487 if (using_existing_quic_session_) { | |
| 1488 // If an existing session was used, then no TCP connection was | |
| 1489 // started. | |
| 1490 HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_NO_RACE); | |
| 1491 } else if (IsSpdyAlternative() || IsQuicAlternative()) { | |
| 1492 // This Job was the alternative Job, and hence won the race. | |
| 1493 HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_WON_RACE); | |
| 1494 } else { | |
| 1495 // This Job was the normal Job, and hence the alternative Job lost the race. | |
| 1496 HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_LOST_RACE); | |
| 1497 } | |
| 1498 } | |
| 1499 | |
| 1500 ClientSocketPoolManager::SocketGroupType | 1486 ClientSocketPoolManager::SocketGroupType |
| 1501 HttpStreamFactoryImpl::Job::GetSocketGroup() const { | 1487 HttpStreamFactoryImpl::Job::GetSocketGroup() const { |
| 1502 std::string scheme = origin_url_.scheme(); | 1488 std::string scheme = origin_url_.scheme(); |
| 1503 if (scheme == "https" || scheme == "wss" || IsSpdyAlternative()) | 1489 if (scheme == "https" || scheme == "wss" || IsSpdyAlternative()) |
| 1504 return ClientSocketPoolManager::SSL_GROUP; | 1490 return ClientSocketPoolManager::SSL_GROUP; |
| 1505 | 1491 |
| 1506 if (scheme == "ftp") | 1492 if (scheme == "ftp") |
| 1507 return ClientSocketPoolManager::FTP_GROUP; | 1493 return ClientSocketPoolManager::FTP_GROUP; |
| 1508 | 1494 |
| 1509 return ClientSocketPoolManager::NORMAL_GROUP; | 1495 return ClientSocketPoolManager::NORMAL_GROUP; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1521 | 1507 |
| 1522 ConnectionAttempts socket_attempts = connection_->connection_attempts(); | 1508 ConnectionAttempts socket_attempts = connection_->connection_attempts(); |
| 1523 if (connection_->socket()) { | 1509 if (connection_->socket()) { |
| 1524 connection_->socket()->GetConnectionAttempts(&socket_attempts); | 1510 connection_->socket()->GetConnectionAttempts(&socket_attempts); |
| 1525 } | 1511 } |
| 1526 | 1512 |
| 1527 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); | 1513 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); |
| 1528 } | 1514 } |
| 1529 | 1515 |
| 1530 } // namespace net | 1516 } // namespace net |
| OLD | NEW |