OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/nqe/network_quality_estimator.h" | 5 #include "net/nqe/network_quality_estimator.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <limits> | 9 #include <limits> |
10 #include <utility> | 10 #include <utility> |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 // Set to 1420 milliseconds, which corresponds to 50th percentile of | 530 // Set to 1420 milliseconds, which corresponds to 50th percentile of |
531 // 2G | 531 // 2G |
532 // HTTP RTT observations on Android. | 532 // HTTP RTT observations on Android. |
533 base::TimeDelta::FromMilliseconds(1420), | 533 base::TimeDelta::FromMilliseconds(1420), |
534 // Set to 1280 milliseconds, which corresponds to 50th percentile of | 534 // Set to 1280 milliseconds, which corresponds to 50th percentile of |
535 // 2G | 535 // 2G |
536 // transport RTT observations on Android. | 536 // transport RTT observations on Android. |
537 base::TimeDelta::FromMilliseconds(1280), | 537 base::TimeDelta::FromMilliseconds(1280), |
538 nqe::internal::kInvalidThroughput); | 538 nqe::internal::kInvalidThroughput); |
539 | 539 |
| 540 default_effective_connection_type_thresholds_[EFFECTIVE_CONNECTION_TYPE_3G] = |
| 541 nqe::internal::NetworkQuality( |
| 542 // Set to 273 milliseconds, which corresponds to 50th percentile of |
| 543 // 3G HTTP RTT observations on Android. |
| 544 base::TimeDelta::FromMilliseconds(273), |
| 545 // Set to 204 milliseconds, which corresponds to 50th percentile of |
| 546 // 3G transport RTT observations on Android. |
| 547 base::TimeDelta::FromMilliseconds(204), |
| 548 nqe::internal::kInvalidThroughput); |
| 549 |
540 for (size_t i = 0; i < EFFECTIVE_CONNECTION_TYPE_LAST; ++i) { | 550 for (size_t i = 0; i < EFFECTIVE_CONNECTION_TYPE_LAST; ++i) { |
541 EffectiveConnectionType effective_connection_type = | 551 EffectiveConnectionType effective_connection_type = |
542 static_cast<EffectiveConnectionType>(i); | 552 static_cast<EffectiveConnectionType>(i); |
543 DCHECK_EQ(nqe::internal::InvalidRTT(), | 553 DCHECK_EQ(nqe::internal::InvalidRTT(), |
544 connection_thresholds_[i].http_rtt()); | 554 connection_thresholds_[i].http_rtt()); |
545 DCHECK_EQ(nqe::internal::InvalidRTT(), | 555 DCHECK_EQ(nqe::internal::InvalidRTT(), |
546 connection_thresholds_[i].transport_rtt()); | 556 connection_thresholds_[i].transport_rtt()); |
547 DCHECK_EQ(nqe::internal::kInvalidThroughput, | 557 DCHECK_EQ(nqe::internal::kInvalidThroughput, |
548 connection_thresholds_[i].downstream_throughput_kbps()); | 558 connection_thresholds_[i].downstream_throughput_kbps()); |
549 if (effective_connection_type == EFFECTIVE_CONNECTION_TYPE_UNKNOWN) | 559 if (effective_connection_type == EFFECTIVE_CONNECTION_TYPE_UNKNOWN) |
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1711 if (effective_connection_type_ != EFFECTIVE_CONNECTION_TYPE_UNKNOWN) { | 1721 if (effective_connection_type_ != EFFECTIVE_CONNECTION_TYPE_UNKNOWN) { |
1712 network_quality_store_->Add( | 1722 network_quality_store_->Add( |
1713 current_network_id_, | 1723 current_network_id_, |
1714 nqe::internal::CachedNetworkQuality( | 1724 nqe::internal::CachedNetworkQuality( |
1715 tick_clock_->NowTicks(), estimated_quality_at_last_main_frame_, | 1725 tick_clock_->NowTicks(), estimated_quality_at_last_main_frame_, |
1716 effective_connection_type_)); | 1726 effective_connection_type_)); |
1717 } | 1727 } |
1718 } | 1728 } |
1719 | 1729 |
1720 } // namespace net | 1730 } // namespace net |
OLD | NEW |