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

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

Issue 2932993002: Determine proxy connection timeout based on current network quality (Closed)
Patch Set: mmenke comments Created 3 years, 6 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
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 #ifndef NET_NQE_NETWORK_QUALITY_ESTIMATOR_TEST_UTIL_H_ 5 #ifndef NET_NQE_NETWORK_QUALITY_ESTIMATOR_TEST_UTIL_H_
6 #define NET_NQE_NETWORK_QUALITY_ESTIMATOR_TEST_UTIL_H_ 6 #define NET_NQE_NETWORK_QUALITY_ESTIMATOR_TEST_UTIL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
11 #include <utility>
11 #include <vector> 12 #include <vector>
12 13
13 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
14 #include "base/macros.h" 15 #include "base/macros.h"
15 #include "base/optional.h" 16 #include "base/optional.h"
16 #include "base/time/time.h" 17 #include "base/time/time.h"
17 #include "net/base/network_change_notifier.h" 18 #include "net/base/network_change_notifier.h"
18 #include "net/log/net_log.h" 19 #include "net/log/net_log.h"
19 #include "net/log/test_net_log.h" 20 #include "net/log/test_net_log.h"
20 #include "net/nqe/effective_connection_type.h" 21 #include "net/nqe/effective_connection_type.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 DCHECK(!effective_connection_type_ && !recent_effective_connection_type_); 149 DCHECK(!effective_connection_type_ && !recent_effective_connection_type_);
149 start_time_null_transport_rtt_ = transport_rtt; 150 start_time_null_transport_rtt_ = transport_rtt;
150 } 151 }
151 152
152 void set_recent_transport_rtt(const base::TimeDelta& recent_transport_rtt) { 153 void set_recent_transport_rtt(const base::TimeDelta& recent_transport_rtt) {
153 // Callers should not set effective connection type along with the 154 // Callers should not set effective connection type along with the
154 // lower-layer metrics. 155 // lower-layer metrics.
155 DCHECK(!effective_connection_type_ && !recent_effective_connection_type_); 156 DCHECK(!effective_connection_type_ && !recent_effective_connection_type_);
156 recent_transport_rtt_ = recent_transport_rtt; 157 recent_transport_rtt_ = recent_transport_rtt;
157 } 158 }
159
160 base::Optional<base::TimeDelta> GetTransportRTT() const override;
161
158 // Returns the recent transport RTT that was set using 162 // Returns the recent transport RTT that was set using
159 // |set_recent_transport_rtt|. If the recent transport RTT has not been set, 163 // |set_recent_transport_rtt|. If the recent transport RTT has not been set,
160 // then the base implementation is called. 164 // then the base implementation is called.
161 bool GetRecentTransportRTT(const base::TimeTicks& start_time, 165 bool GetRecentTransportRTT(const base::TimeTicks& start_time,
162 base::TimeDelta* rtt) const override; 166 base::TimeDelta* rtt) const override;
163 167
164 void set_start_time_null_downlink_throughput_kbps( 168 void set_start_time_null_downlink_throughput_kbps(
165 int32_t downlink_throughput_kbps) { 169 int32_t downlink_throughput_kbps) {
166 // Callers should not set effective connection type along with the 170 // Callers should not set effective connection type along with the
167 // lower-layer metrics. 171 // lower-layer metrics.
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 287
284 // Net log provided to network quality estimator. 288 // Net log provided to network quality estimator.
285 std::unique_ptr<net::BoundTestNetLog> net_log_; 289 std::unique_ptr<net::BoundTestNetLog> net_log_;
286 290
287 DISALLOW_COPY_AND_ASSIGN(TestNetworkQualityEstimator); 291 DISALLOW_COPY_AND_ASSIGN(TestNetworkQualityEstimator);
288 }; 292 };
289 293
290 } // namespace net 294 } // namespace net
291 295
292 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_TEST_UTIL_H_ 296 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « net/http/http_proxy_client_socket_pool_unittest.cc ('k') | net/nqe/network_quality_estimator_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698