| 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/base/network_quality_estimator.h" | 5 #include "net/base/network_quality_estimator.h" |
| 6 | 6 |
| 7 #include <float.h> | 7 #include <float.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 NetworkQualityEstimator::NetworkID network_id( | 619 NetworkQualityEstimator::NetworkID network_id( |
| 620 NetworkChangeNotifier::GetConnectionType(), std::string()); | 620 NetworkChangeNotifier::GetConnectionType(), std::string()); |
| 621 | 621 |
| 622 switch (network_id.type) { | 622 switch (network_id.type) { |
| 623 case NetworkChangeNotifier::ConnectionType::CONNECTION_UNKNOWN: | 623 case NetworkChangeNotifier::ConnectionType::CONNECTION_UNKNOWN: |
| 624 case NetworkChangeNotifier::ConnectionType::CONNECTION_NONE: | 624 case NetworkChangeNotifier::ConnectionType::CONNECTION_NONE: |
| 625 case NetworkChangeNotifier::ConnectionType::CONNECTION_BLUETOOTH: | 625 case NetworkChangeNotifier::ConnectionType::CONNECTION_BLUETOOTH: |
| 626 case NetworkChangeNotifier::ConnectionType::CONNECTION_ETHERNET: | 626 case NetworkChangeNotifier::ConnectionType::CONNECTION_ETHERNET: |
| 627 break; | 627 break; |
| 628 case NetworkChangeNotifier::ConnectionType::CONNECTION_WIFI: | 628 case NetworkChangeNotifier::ConnectionType::CONNECTION_WIFI: |
| 629 #if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) | 629 #if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \ |
| 630 defined(OS_WIN) |
| 630 network_id.id = GetWifiSSID(); | 631 network_id.id = GetWifiSSID(); |
| 631 #endif | 632 #endif |
| 632 break; | 633 break; |
| 633 case NetworkChangeNotifier::ConnectionType::CONNECTION_2G: | 634 case NetworkChangeNotifier::ConnectionType::CONNECTION_2G: |
| 634 case NetworkChangeNotifier::ConnectionType::CONNECTION_3G: | 635 case NetworkChangeNotifier::ConnectionType::CONNECTION_3G: |
| 635 case NetworkChangeNotifier::ConnectionType::CONNECTION_4G: | 636 case NetworkChangeNotifier::ConnectionType::CONNECTION_4G: |
| 636 #if defined(OS_ANDROID) | 637 #if defined(OS_ANDROID) |
| 637 network_id.id = android::GetTelephonyNetworkOperator(); | 638 network_id.id = android::GetTelephonyNetworkOperator(); |
| 638 #endif | 639 #endif |
| 639 break; | 640 break; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 | 728 |
| 728 NetworkQualityEstimator::CachedNetworkQuality::~CachedNetworkQuality() { | 729 NetworkQualityEstimator::CachedNetworkQuality::~CachedNetworkQuality() { |
| 729 } | 730 } |
| 730 | 731 |
| 731 bool NetworkQualityEstimator::CachedNetworkQuality::OlderThan( | 732 bool NetworkQualityEstimator::CachedNetworkQuality::OlderThan( |
| 732 const CachedNetworkQuality& cached_network_quality) const { | 733 const CachedNetworkQuality& cached_network_quality) const { |
| 733 return last_update_time_ < cached_network_quality.last_update_time_; | 734 return last_update_time_ < cached_network_quality.last_update_time_; |
| 734 } | 735 } |
| 735 | 736 |
| 736 } // namespace net | 737 } // namespace net |
| OLD | NEW |