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

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

Issue 1942893002: Split NQE to multiple files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 7 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
« no previous file with comments | « net/nqe/cached_network_quality.cc ('k') | net/nqe/network_quality.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 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_H_
6 #define NET_NQE_NETWORK_QUALITY_H_
7
8 #include <stdint.h>
9
10 #include "base/gtest_prod_util.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 namespace nqe {
18
19 namespace internal {
20
21 // Returns the RTT value to be used when the valid RTT is unavailable. Readers
22 // should discard RTT if it is set to the value returned by |InvalidRTT()|.
23 NET_EXPORT_PRIVATE base::TimeDelta InvalidRTT();
24
25 // Throughput is set to |kInvalidThroughput| if a valid value is
26 // unavailable. Readers should discard throughput value if it is set to
27 // |kInvalidThroughput|.
28 const int32_t kInvalidThroughput = 0;
29
30 // NetworkQuality is used to cache the quality of a network connection.
31 class NET_EXPORT_PRIVATE NetworkQuality {
32 public:
33 NetworkQuality();
34 // |rtt| is the estimate of the round trip time.
35 // |downstream_throughput_kbps| is the estimate of the downstream
36 // throughput in kilobits per second.
37 NetworkQuality(const base::TimeDelta& rtt,
38 int32_t downstream_throughput_kbps);
39 NetworkQuality(const NetworkQuality& other);
40 ~NetworkQuality();
41
42 NetworkQuality& operator=(const NetworkQuality& other);
43
44 // Returns the estimate of the round trip time at the HTTP layer.
45 const base::TimeDelta& rtt() const { return rtt_; }
46
47 // Returns the estimate of the downstream throughput in Kbps (Kilobits per
48 // second).
49 int32_t downstream_throughput_kbps() const {
50 return downstream_throughput_kbps_;
51 }
52
53 private:
54 // Estimated round trip time at the HTTP layer.
55 base::TimeDelta rtt_;
56
57 // Estimated downstream throughput in kilobits per second.
58 int32_t downstream_throughput_kbps_;
59 };
60
61 } // namespace internal
62
63 } // namespace nqe
64
65 } // namespace net
66
67 #endif // NET_NQE_NETWORK_QUALITY_H_
OLDNEW
« no previous file with comments | « net/nqe/cached_network_quality.cc ('k') | net/nqe/network_quality.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698