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/gtest_prod_util.h" | |
12 #include "base/macros.h" | |
13 | |
14 namespace net { | |
15 | |
16 // Observes changes in the network quality. | |
17 class NET_EXPORT RTTAndThroughputEstimatesObserver { | |
18 public: | |
19 // Notifies the observer when estimated HTTP RTT, estimated transport RTT or | |
20 // estimated downstream throughput is computed. NetworkQualityEstimator | |
21 // computes the RTT and throughput estimates at regular intervals. | |
22 // Additionally, when there is a change in the connection type of the | |
23 // device, then the estimates are immediately computed. The observer must | |
24 // register and unregister itself on the IO thread. All the observers would | |
RyanSturm
2017/06/05 21:21:02
same comment about IO thread.
tbansal1
2017/06/06 16:55:50
Done.
| |
25 // be notified on the IO thread. | |
26 // | |
27 // |http_rtt|, |transport_rtt| and |downstream_throughput_kbps| are the | |
28 // computed estimates of the HTTP RTT, transport RTT and downstream | |
29 // throughput (in kilobits per second), respectively. If an estimate of the | |
30 // HTTP or transport RTT is unavailable, it will be set to | |
31 // nqe::internal::InvalidRTT(). If the throughput estimate is unavailable, | |
32 // it will be set to nqe::internal::kInvalidThroughput. | |
33 virtual void OnRTTOrThroughputEstimatesComputed( | |
34 base::TimeDelta http_rtt, | |
35 base::TimeDelta transport_rtt, | |
36 int32_t downstream_throughput_kbps) = 0; | |
37 | |
38 virtual ~RTTAndThroughputEstimatesObserver() {} | |
39 | |
40 protected: | |
41 RTTAndThroughputEstimatesObserver() {} | |
42 | |
43 private: | |
44 DISALLOW_COPY_AND_ASSIGN(RTTAndThroughputEstimatesObserver); | |
45 }; | |
46 | |
47 } // namespace net | |
48 | |
49 #endif // NET_NQE_NETWORK_QUALITY_RTT_THROUGHPUT_ESTIMATES_OBSERVER_H_ | |
OLD | NEW |