| 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 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 905 NotifyObserversOfRTT(RttObservation(rtt, base::TimeTicks::Now(), TCP)); | 905 NotifyObserversOfRTT(RttObservation(rtt, base::TimeTicks::Now(), TCP)); |
| 906 return; | 906 return; |
| 907 case PROTOCOL_QUIC: | 907 case PROTOCOL_QUIC: |
| 908 NotifyObserversOfRTT(RttObservation(rtt, base::TimeTicks::Now(), QUIC)); | 908 NotifyObserversOfRTT(RttObservation(rtt, base::TimeTicks::Now(), QUIC)); |
| 909 return; | 909 return; |
| 910 default: | 910 default: |
| 911 NOTREACHED(); | 911 NOTREACHED(); |
| 912 } | 912 } |
| 913 } | 913 } |
| 914 | 914 |
| 915 void NetworkQualityEstimator::OnWatcherReset() { |
| 916 DCHECK(thread_checker_.CalledOnValidThread()); |
| 917 // Nothing needs to be done for RTT observations since NetworkQualityEstimator |
| 918 // does not maintain any watcher-specific state. |
| 919 } |
| 920 |
| 915 void NetworkQualityEstimator::NotifyObserversOfRTT( | 921 void NetworkQualityEstimator::NotifyObserversOfRTT( |
| 916 const RttObservation& observation) { | 922 const RttObservation& observation) { |
| 917 FOR_EACH_OBSERVER( | 923 FOR_EACH_OBSERVER( |
| 918 RTTObserver, rtt_observer_list_, | 924 RTTObserver, rtt_observer_list_, |
| 919 OnRTTObservation(observation.value.InMilliseconds(), | 925 OnRTTObservation(observation.value.InMilliseconds(), |
| 920 observation.timestamp, observation.source)); | 926 observation.timestamp, observation.source)); |
| 921 } | 927 } |
| 922 | 928 |
| 923 void NetworkQualityEstimator::NotifyObserversOfThroughput( | 929 void NetworkQualityEstimator::NotifyObserversOfThroughput( |
| 924 const ThroughputObservation& observation) { | 930 const ThroughputObservation& observation) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 | 974 |
| 969 NetworkQualityEstimator::NetworkQuality& | 975 NetworkQualityEstimator::NetworkQuality& |
| 970 NetworkQualityEstimator::NetworkQuality:: | 976 NetworkQualityEstimator::NetworkQuality:: |
| 971 operator=(const NetworkQuality& other) { | 977 operator=(const NetworkQuality& other) { |
| 972 rtt_ = other.rtt_; | 978 rtt_ = other.rtt_; |
| 973 downstream_throughput_kbps_ = other.downstream_throughput_kbps_; | 979 downstream_throughput_kbps_ = other.downstream_throughput_kbps_; |
| 974 return *this; | 980 return *this; |
| 975 } | 981 } |
| 976 | 982 |
| 977 } // namespace net | 983 } // namespace net |
| OLD | NEW |