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

Side by Side Diff: net/nqe/network_quality_estimator.h

Issue 2487883002: NQE: Use cached estimates (Closed)
Patch Set: Rebased, ryansturm comments Created 4 years 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 #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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 const base::TimeTicks& start_time, 482 const base::TimeTicks& start_time,
483 int percentile) const; 483 int percentile) const;
484 int32_t GetDownlinkThroughputKbpsEstimateInternal( 484 int32_t GetDownlinkThroughputKbpsEstimateInternal(
485 const base::TimeTicks& start_time, 485 const base::TimeTicks& start_time,
486 int percentile) const; 486 int percentile) const;
487 487
488 // Returns the current network ID checking by calling the platform APIs. 488 // Returns the current network ID checking by calling the platform APIs.
489 // Virtualized for testing. 489 // Virtualized for testing.
490 virtual nqe::internal::NetworkID GetCurrentNetworkID() const; 490 virtual nqe::internal::NetworkID GetCurrentNetworkID() const;
491 491
492 // Notifies RTT observers of |observation|. May also trigger recomputation
493 // of effective connection type.
492 void NotifyObserversOfRTT(const RttObservation& observation); 494 void NotifyObserversOfRTT(const RttObservation& observation);
493 495
496 // Notifies throughput observers of |observation|. May also trigger
497 // recomputation of effective connection type.
494 void NotifyObserversOfThroughput(const ThroughputObservation& observation); 498 void NotifyObserversOfThroughput(const ThroughputObservation& observation);
495 499
496 // Returns true only if the |request| can be used for RTT estimation. 500 // Returns true only if the |request| can be used for RTT estimation.
497 bool RequestProvidesRTTObservation(const URLRequest& request) const; 501 bool RequestProvidesRTTObservation(const URLRequest& request) const;
498 502
499 // Recomputes effective connection type, if it was computed more than the 503 // Recomputes effective connection type, if it was computed more than the
500 // specified duration ago, or if there has been a connection change recently. 504 // specified duration ago, or if there has been a connection change recently.
501 void MaybeComputeEffectiveConnectionType(); 505 void MaybeComputeEffectiveConnectionType();
502 506
503 // Notifies observers of a change in effective connection type. 507 // Notifies observers of a change in effective connection type.
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 base::ThreadChecker thread_checker_; 730 base::ThreadChecker thread_checker_;
727 731
728 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; 732 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_;
729 733
730 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); 734 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator);
731 }; 735 };
732 736
733 } // namespace net 737 } // namespace net
734 738
735 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ 739 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698