Revert of Re-enabling webrtc Telemetry tests. (patchset #1 id:1 of https://codereview...
[chromium-blink-merge.git] / net / base / network_quality.h
blob8cb76d2a04951cd911cd651f31e1ccde1007e6dc
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
3 // found in the LICENSE file.
5 #ifndef NET_BASE_NETWORK_QUALITY_H_
6 #define NET_BASE_NETWORK_QUALITY_H_
8 #include <stdint.h>
10 #include "base/time/time.h"
11 #include "net/base/net_export.h"
13 namespace net {
15 // API that is used to report the network quality of a network connection as
16 // estimated by the NetworkQualityEstimator.
17 class NET_EXPORT_PRIVATE NetworkQuality {
18 public:
19 // Throughput is set to |kInvalidThroughput| if a valid value is unavailable.
20 // Readers should discard throughput value if it is set to
21 // |kInvalidThroughput|.
22 static const int32_t kInvalidThroughput;
24 NetworkQuality();
25 // |rtt| is the estimate of the round trip time.
26 // |downstream_throughput_kbps| is the estimate of the downstream throughput.
27 NetworkQuality(const base::TimeDelta& rtt,
28 int32_t downstream_throughput_kbps);
29 NetworkQuality(const NetworkQuality& other);
30 ~NetworkQuality();
32 NetworkQuality& operator=(const NetworkQuality& other);
34 // Returns the RTT value to be used when the valid RTT is unavailable. Readers
35 // should discard RTT if it is set to the value returned by |InvalidRTT()|.
36 static const base::TimeDelta InvalidRTT();
38 // Returns the estimate of the round trip time.
39 const base::TimeDelta& rtt() const { return rtt_; }
41 // Returns the estimate of the downstream throughput in Kbps (Kilo bits per
42 // second).
43 int32_t downstream_throughput_kbps() const {
44 return downstream_throughput_kbps_;
47 private:
48 // Estimated round trip time.
49 base::TimeDelta rtt_;
51 // Estimated downstream throughput in Kbps.
52 int32_t downstream_throughput_kbps_;
55 } // namespace net
57 #endif // NET_BASE_NETWORK_QUALITY_H_