Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Side by Side Diff: net/base/network_quality_estimator.cc

Issue 1376473003: Notify NQE of TCP RTT values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed bengr comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(),
mmenke 2016/02/23 21:28:39 Drive-by comment (More on pre-existing stuff) call
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) {
925 FOR_EACH_OBSERVER( 931 FOR_EACH_OBSERVER(
926 ThroughputObserver, throughput_observer_list_, 932 ThroughputObserver, throughput_observer_list_,
927 OnThroughputObservation(observation.value, observation.timestamp, 933 OnThroughputObservation(observation.value, observation.timestamp,
928 observation.source)); 934 observation.source));
929 } 935 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698