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

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

Issue 2417643007: Expose RTT and throughput estimates from Cronet (Closed)
Patch Set: Removed annotation Created 4 years, 2 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/network_quality.h ('k') | net/nqe/network_quality_estimator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 #include "net/nqe/network_quality.h" 5 #include "net/nqe/network_quality.h"
6 6
7 namespace net { 7 namespace net {
8 namespace nqe { 8 namespace nqe {
9 namespace internal { 9 namespace internal {
10 10
11 base::TimeDelta InvalidRTT() { 11 base::TimeDelta InvalidRTT() {
12 return base::TimeDelta::Max(); 12 return base::TimeDelta::FromMilliseconds(INVALID_RTT_THROUGHPUT);
13 } 13 }
14 14
15 NetworkQuality::NetworkQuality() 15 NetworkQuality::NetworkQuality()
16 : NetworkQuality(InvalidRTT(), InvalidRTT(), kInvalidThroughput) {} 16 : NetworkQuality(InvalidRTT(), InvalidRTT(), kInvalidThroughput) {}
17 17
18 NetworkQuality::NetworkQuality(const base::TimeDelta& http_rtt, 18 NetworkQuality::NetworkQuality(const base::TimeDelta& http_rtt,
19 const base::TimeDelta& transport_rtt, 19 const base::TimeDelta& transport_rtt,
20 int32_t downstream_throughput_kbps) 20 int32_t downstream_throughput_kbps)
21 : http_rtt_(http_rtt), 21 : http_rtt_(http_rtt),
22 transport_rtt_(transport_rtt), 22 transport_rtt_(transport_rtt),
23 downstream_throughput_kbps_(downstream_throughput_kbps) { 23 downstream_throughput_kbps_(downstream_throughput_kbps) {
24 DCHECK_GE(downstream_throughput_kbps_, 0); 24 DCHECK_GE(downstream_throughput_kbps_, kInvalidThroughput);
25 } 25 }
26 26
27 NetworkQuality::NetworkQuality(const NetworkQuality& other) 27 NetworkQuality::NetworkQuality(const NetworkQuality& other)
28 : NetworkQuality(other.http_rtt_, 28 : NetworkQuality(other.http_rtt_,
29 other.transport_rtt_, 29 other.transport_rtt_,
30 other.downstream_throughput_kbps_) {} 30 other.downstream_throughput_kbps_) {}
31 31
32 NetworkQuality::~NetworkQuality() {} 32 NetworkQuality::~NetworkQuality() {}
33 33
34 NetworkQuality& NetworkQuality::operator=(const NetworkQuality& other) { 34 NetworkQuality& NetworkQuality::operator=(const NetworkQuality& other) {
(...skipping 16 matching lines...) Expand all
51 other.transport_rtt() == InvalidRTT() || 51 other.transport_rtt() == InvalidRTT() ||
52 transport_rtt() <= other.transport_rtt()) && 52 transport_rtt() <= other.transport_rtt()) &&
53 (downstream_throughput_kbps() == kInvalidThroughput || 53 (downstream_throughput_kbps() == kInvalidThroughput ||
54 other.downstream_throughput_kbps() == kInvalidThroughput || 54 other.downstream_throughput_kbps() == kInvalidThroughput ||
55 downstream_throughput_kbps() >= other.downstream_throughput_kbps()); 55 downstream_throughput_kbps() >= other.downstream_throughput_kbps());
56 } 56 }
57 57
58 } // namespace internal 58 } // namespace internal
59 } // namespace nqe 59 } // namespace nqe
60 } // namespace net 60 } // namespace net
OLDNEW
« no previous file with comments | « net/nqe/network_quality.h ('k') | net/nqe/network_quality_estimator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698