Chromium Code Reviews| Index: net/nqe/network_quality_estimator.cc |
| diff --git a/net/nqe/network_quality_estimator.cc b/net/nqe/network_quality_estimator.cc |
| index daa50cd7f4f09663b57660e92f621dc1980382c9..c92ed5286653fac450eb106402b4b326c424c4a5 100644 |
| --- a/net/nqe/network_quality_estimator.cc |
| +++ b/net/nqe/network_quality_estimator.cc |
| @@ -402,25 +402,11 @@ void NetworkQualityEstimator::NotifyStartTransaction( |
| if (!RequestSchemeIsHTTPOrHTTPS(request)) |
| return; |
| - throughput_analyzer_->NotifyStartTransaction(request); |
| -} |
| - |
| -void NetworkQualityEstimator::NotifyHeadersReceived(const URLRequest& request) { |
| - TRACE_EVENT0(kNetTracingCategory, |
| - "NetworkQualityEstimator::NotifyHeadersReceived"); |
| - DCHECK(thread_checker_.CalledOnValidThread()); |
| - |
| - if (!RequestSchemeIsHTTPOrHTTPS(request) || |
| - !RequestProvidesRTTObservation(request)) { |
| - return; |
| - } |
| - |
| - const base::TimeTicks now = tick_clock_->NowTicks(); |
| - |
| // Update |estimated_quality_at_last_main_frame_| if this is a main frame |
| // request. |
| // TODO(tbansal): Refactor this to a separate method. |
| if (request.load_flags() & LOAD_MAIN_FRAME_DEPRECATED) { |
| + base::TimeTicks now = tick_clock_->NowTicks(); |
| last_main_frame_request_ = now; |
|
RyanSturm
2017/02/14 18:12:53
Update comments in .h file about last_main_frame_r
tbansal1
2017/02/14 21:49:44
Done.
|
| ComputeEffectiveConnectionType(); |
| @@ -444,6 +430,25 @@ void NetworkQualityEstimator::NotifyHeadersReceived(const URLRequest& request) { |
| measuring_delay); |
| } |
| } |
| + throughput_analyzer_->NotifyStartTransaction(request); |
| +} |
| + |
| +void NetworkQualityEstimator::NotifyHeadersReceived(const URLRequest& request) { |
| + TRACE_EVENT0(kNetTracingCategory, |
| + "NetworkQualityEstimator::NotifyHeadersReceived"); |
| + DCHECK(thread_checker_.CalledOnValidThread()); |
| + |
| + if (!RequestSchemeIsHTTPOrHTTPS(request) || |
| + !RequestProvidesRTTObservation(request)) { |
| + return; |
| + } |
| + |
| + // Update |estimated_quality_at_last_main_frame_| if this is a main frame |
| + // request. |
| + // TODO(tbansal): Refactor this to a separate method. |
| + if (request.load_flags() & LOAD_MAIN_FRAME_DEPRECATED) { |
| + ComputeEffectiveConnectionType(); |
| + } |
| LoadTimingInfo load_timing_info; |
| request.GetLoadTimingInfo(&load_timing_info); |
| @@ -468,9 +473,9 @@ void NetworkQualityEstimator::NotifyHeadersReceived(const URLRequest& request) { |
| peak_network_quality_.downstream_throughput_kbps()); |
| } |
| - RttObservation http_rtt_observation(observed_http_rtt, now, |
| - signal_strength_dbm_, |
| - NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP); |
| + RttObservation http_rtt_observation( |
| + observed_http_rtt, tick_clock_->NowTicks(), signal_strength_dbm_, |
| + NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP); |
| rtt_observations_.AddObservation(http_rtt_observation); |
| NotifyObserversOfRTT(http_rtt_observation); |
| } |