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_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1437 request_headers_.Clear(); | 1437 request_headers_.Clear(); |
1438 response_ = HttpResponseInfo(); | 1438 response_ = HttpResponseInfo(); |
1439 establishing_tunnel_ = false; | 1439 establishing_tunnel_ = false; |
1440 } | 1440 } |
1441 | 1441 |
1442 void HttpNetworkTransaction::RecordSSLFallbackMetrics(int result) { | 1442 void HttpNetworkTransaction::RecordSSLFallbackMetrics(int result) { |
1443 if (result != OK && result != ERR_SSL_INAPPROPRIATE_FALLBACK) | 1443 if (result != OK && result != ERR_SSL_INAPPROPRIATE_FALLBACK) |
1444 return; | 1444 return; |
1445 | 1445 |
1446 const std::string& host = request_->url.host(); | 1446 const std::string& host = request_->url.host(); |
1447 bool is_google = EndsWith(host, "google.com", true) && | 1447 bool is_google = base::EndsWith(host, "google.com", true) && |
1448 (host.size() == 10 || host[host.size() - 11] == '.'); | 1448 (host.size() == 10 || host[host.size() - 11] == '.'); |
1449 if (is_google) { | 1449 if (is_google) { |
1450 // Some fraction of successful connections use the fallback, but only due to | 1450 // Some fraction of successful connections use the fallback, but only due to |
1451 // a spurious network failure. To estimate this fraction, compare handshakes | 1451 // a spurious network failure. To estimate this fraction, compare handshakes |
1452 // to Google servers which succeed against those that fail with an | 1452 // to Google servers which succeed against those that fail with an |
1453 // inappropriate_fallback alert. Google servers are known to implement | 1453 // inappropriate_fallback alert. Google servers are known to implement |
1454 // FALLBACK_SCSV, so a spurious network failure while connecting would | 1454 // FALLBACK_SCSV, so a spurious network failure while connecting would |
1455 // trigger the fallback, successfully connect, but fail with this alert. | 1455 // trigger the fallback, successfully connect, but fail with this alert. |
1456 UMA_HISTOGRAM_BOOLEAN("Net.GoogleConnectionInappropriateFallback", | 1456 UMA_HISTOGRAM_BOOLEAN("Net.GoogleConnectionInappropriateFallback", |
1457 result == ERR_SSL_INAPPROPRIATE_FALLBACK); | 1457 result == ERR_SSL_INAPPROPRIATE_FALLBACK); |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1653 DCHECK(stream_request_); | 1653 DCHECK(stream_request_); |
1654 | 1654 |
1655 // Since the transaction can restart with auth credentials, it may create a | 1655 // Since the transaction can restart with auth credentials, it may create a |
1656 // stream more than once. Accumulate all of the connection attempts across | 1656 // stream more than once. Accumulate all of the connection attempts across |
1657 // those streams by appending them to the vector: | 1657 // those streams by appending them to the vector: |
1658 for (const auto& attempt : stream_request_->connection_attempts()) | 1658 for (const auto& attempt : stream_request_->connection_attempts()) |
1659 connection_attempts_.push_back(attempt); | 1659 connection_attempts_.push_back(attempt); |
1660 } | 1660 } |
1661 | 1661 |
1662 } // namespace net | 1662 } // namespace net |
OLD | NEW |