| 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 #ifndef NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ | 5 #ifndef NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ |
| 6 #define NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ | 6 #define NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 public ExternalEstimateProvider::UpdatedEstimateDelegate { | 57 public ExternalEstimateProvider::UpdatedEstimateDelegate { |
| 58 public: | 58 public: |
| 59 // EffectiveConnectionType is the connection type whose typical performance is | 59 // EffectiveConnectionType is the connection type whose typical performance is |
| 60 // most similar to the measured performance of the network in use. In many | 60 // most similar to the measured performance of the network in use. In many |
| 61 // cases, the "effective" connection type and the actual type of connection in | 61 // cases, the "effective" connection type and the actual type of connection in |
| 62 // use are the same, but often a network connection performs significantly | 62 // use are the same, but often a network connection performs significantly |
| 63 // different, usually worse, from its expected capabilities. | 63 // different, usually worse, from its expected capabilities. |
| 64 // EffectiveConnectionType of a network is independent of if the current | 64 // EffectiveConnectionType of a network is independent of if the current |
| 65 // connection is metered or not. For example, an unmetered slow connection may | 65 // connection is metered or not. For example, an unmetered slow connection may |
| 66 // have EFFECTIVE_CONNECTION_TYPE_SLOW_2G as its effective connection type. | 66 // have EFFECTIVE_CONNECTION_TYPE_SLOW_2G as its effective connection type. |
| 67 // An invalid Java prefix is specified to prevent the Java class generator |
| 68 // from automatically stripping off the common prefix |
| 69 // ("EFFECTIVE_CONNECTION_TYPE_"). |
| 70 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net |
| 71 // GENERATED_JAVA_PREFIX_TO_STRIP: PREFIX_NOT_PRESENT_ |
| 67 enum EffectiveConnectionType { | 72 enum EffectiveConnectionType { |
| 68 // The connection types should be in increasing order of quality. | 73 // The connection types should be in increasing order of quality. |
| 69 EFFECTIVE_CONNECTION_TYPE_UNKNOWN = 0, | 74 EFFECTIVE_CONNECTION_TYPE_UNKNOWN = 0, |
| 70 EFFECTIVE_CONNECTION_TYPE_OFFLINE, | 75 EFFECTIVE_CONNECTION_TYPE_OFFLINE, |
| 71 EFFECTIVE_CONNECTION_TYPE_SLOW_2G, | 76 EFFECTIVE_CONNECTION_TYPE_SLOW_2G, |
| 72 EFFECTIVE_CONNECTION_TYPE_2G, | 77 EFFECTIVE_CONNECTION_TYPE_2G, |
| 73 EFFECTIVE_CONNECTION_TYPE_3G, | 78 EFFECTIVE_CONNECTION_TYPE_3G, |
| 74 EFFECTIVE_CONNECTION_TYPE_4G, | 79 EFFECTIVE_CONNECTION_TYPE_4G, |
| 75 EFFECTIVE_CONNECTION_TYPE_BROADBAND, | 80 EFFECTIVE_CONNECTION_TYPE_BROADBAND, |
| 76 EFFECTIVE_CONNECTION_TYPE_LAST, | 81 EFFECTIVE_CONNECTION_TYPE_LAST, |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 | 594 |
| 590 // Buffer that holds RTT observations sorted by timestamp. | 595 // Buffer that holds RTT observations sorted by timestamp. |
| 591 RttObservationBuffer rtt_observations_; | 596 RttObservationBuffer rtt_observations_; |
| 592 | 597 |
| 593 // Default network quality observations obtained from the network quality | 598 // Default network quality observations obtained from the network quality |
| 594 // estimator field trial parameters. The observations are indexed by | 599 // estimator field trial parameters. The observations are indexed by |
| 595 // ConnectionType. | 600 // ConnectionType. |
| 596 nqe::internal::NetworkQuality | 601 nqe::internal::NetworkQuality |
| 597 default_observations_[NetworkChangeNotifier::CONNECTION_LAST + 1]; | 602 default_observations_[NetworkChangeNotifier::CONNECTION_LAST + 1]; |
| 598 | 603 |
| 604 // Default thresholds for different effective connection types. The default |
| 605 // values are used if thresholds are unavailable from the variation params. |
| 606 nqe::internal::NetworkQuality |
| 607 default_connection_thresholds_[EFFECTIVE_CONNECTION_TYPE_LAST]; |
| 608 |
| 599 // Thresholds for different effective connection types obtained from field | 609 // Thresholds for different effective connection types obtained from field |
| 600 // trial variation params. These thresholds encode how different connection | 610 // trial variation params. These thresholds encode how different connection |
| 601 // types behave in general. In future, complex encodings (e.g., curve | 611 // types behave in general. In future, complex encodings (e.g., curve |
| 602 // fitting) may be used. | 612 // fitting) may be used. |
| 603 nqe::internal::NetworkQuality | 613 nqe::internal::NetworkQuality |
| 604 connection_thresholds_[EFFECTIVE_CONNECTION_TYPE_LAST]; | 614 connection_thresholds_[EFFECTIVE_CONNECTION_TYPE_LAST]; |
| 605 | 615 |
| 606 // Latest time when the headers for a main frame request were received. | 616 // Latest time when the headers for a main frame request were received. |
| 607 base::TimeTicks last_main_frame_request_; | 617 base::TimeTicks last_main_frame_request_; |
| 608 | 618 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 base::ThreadChecker thread_checker_; | 655 base::ThreadChecker thread_checker_; |
| 646 | 656 |
| 647 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; | 657 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; |
| 648 | 658 |
| 649 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); | 659 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); |
| 650 }; | 660 }; |
| 651 | 661 |
| 652 } // namespace net | 662 } // namespace net |
| 653 | 663 |
| 654 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ | 664 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ |
| OLD | NEW |