OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_NQE_NETWORK_QUALITY_RTT_THROUGHPUT_ESTIMATES_OBSERVER_H_ |
| 6 #define NET_NQE_NETWORK_QUALITY_RTT_THROUGHPUT_ESTIMATES_OBSERVER_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" |
| 12 #include "base/time/time.h" |
| 13 #include "net/base/net_export.h" |
| 14 |
| 15 namespace net { |
| 16 |
| 17 // Observes changes in the network quality. |
| 18 class NET_EXPORT RTTAndThroughputEstimatesObserver { |
| 19 public: |
| 20 // Notifies the observer when estimated HTTP RTT, estimated transport RTT or |
| 21 // estimated downstream throughput is computed. NetworkQualityEstimator |
| 22 // computes the RTT and throughput estimates at regular intervals. |
| 23 // Additionally, when there is a change in the connection type of the |
| 24 // device, then the estimates are immediately computed. |
| 25 // |
| 26 // |http_rtt|, |transport_rtt| and |downstream_throughput_kbps| are the |
| 27 // computed estimates of the HTTP RTT, transport RTT and downstream |
| 28 // throughput (in kilobits per second), respectively. If an estimate of the |
| 29 // HTTP or transport RTT is unavailable, it will be set to |
| 30 // nqe::internal::InvalidRTT(). If the throughput estimate is unavailable, |
| 31 // it will be set to nqe::internal::kInvalidThroughput. |
| 32 virtual void OnRTTOrThroughputEstimatesComputed( |
| 33 base::TimeDelta http_rtt, |
| 34 base::TimeDelta transport_rtt, |
| 35 int32_t downstream_throughput_kbps) = 0; |
| 36 |
| 37 virtual ~RTTAndThroughputEstimatesObserver() {} |
| 38 |
| 39 protected: |
| 40 RTTAndThroughputEstimatesObserver() {} |
| 41 |
| 42 private: |
| 43 DISALLOW_COPY_AND_ASSIGN(RTTAndThroughputEstimatesObserver); |
| 44 }; |
| 45 |
| 46 } // namespace net |
| 47 |
| 48 #endif // NET_NQE_NETWORK_QUALITY_RTT_THROUGHPUT_ESTIMATES_OBSERVER_H_ |
OLD | NEW |