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

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

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
« no previous file with comments | « net/nqe/network_quality_estimator_test_util.h ('k') | no next file » | 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_estimator_test_util.h" 5 #include "net/nqe/network_quality_estimator_test_util.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "net/base/load_flags.h" 10 #include "net/base/load_flags.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 return NetworkQualityEstimator::GetRecentTransportRTT(start_time, rtt); 176 return NetworkQualityEstimator::GetRecentTransportRTT(start_time, rtt);
177 } 177 }
178 178
179 if (recent_transport_rtt_) { 179 if (recent_transport_rtt_) {
180 *rtt = recent_transport_rtt_.value(); 180 *rtt = recent_transport_rtt_.value();
181 return true; 181 return true;
182 } 182 }
183 return NetworkQualityEstimator::GetRecentTransportRTT(start_time, rtt); 183 return NetworkQualityEstimator::GetRecentTransportRTT(start_time, rtt);
184 } 184 }
185 185
186 base::Optional<base::TimeDelta> TestNetworkQualityEstimator::GetTransportRTT()
187 const {
188 if (start_time_null_transport_rtt_)
189 return start_time_null_transport_rtt_;
190 return NetworkQualityEstimator::GetTransportRTT();
191 }
192
186 bool TestNetworkQualityEstimator::GetRecentDownlinkThroughputKbps( 193 bool TestNetworkQualityEstimator::GetRecentDownlinkThroughputKbps(
187 const base::TimeTicks& start_time, 194 const base::TimeTicks& start_time,
188 int32_t* kbps) const { 195 int32_t* kbps) const {
189 if (start_time.is_null()) { 196 if (start_time.is_null()) {
190 if (start_time_null_downlink_throughput_kbps_) { 197 if (start_time_null_downlink_throughput_kbps_) {
191 *kbps = start_time_null_downlink_throughput_kbps_.value(); 198 *kbps = start_time_null_downlink_throughput_kbps_.value();
192 return true; 199 return true;
193 } 200 }
194 return NetworkQualityEstimator::GetRecentDownlinkThroughputKbps(start_time, 201 return NetworkQualityEstimator::GetRecentDownlinkThroughputKbps(start_time,
195 kbps); 202 kbps);
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 NotifyRTTAndThroughputEstimatesObserverIfPresent( 323 NotifyRTTAndThroughputEstimatesObserverIfPresent(
317 RTTAndThroughputEstimatesObserver* observer) const { 324 RTTAndThroughputEstimatesObserver* observer) const {
318 if (suppress_notifications_for_testing_) 325 if (suppress_notifications_for_testing_)
319 return; 326 return;
320 327
321 NetworkQualityEstimator::NotifyRTTAndThroughputEstimatesObserverIfPresent( 328 NetworkQualityEstimator::NotifyRTTAndThroughputEstimatesObserverIfPresent(
322 observer); 329 observer);
323 } 330 }
324 331
325 } // namespace net 332 } // namespace net
OLDNEW
« no previous file with comments | « net/nqe/network_quality_estimator_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698