| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.h" | 5 #include "net/nqe/network_quality_estimator.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 | 636 |
| 637 if (!RequestSchemeIsHTTPOrHTTPS(request) || | 637 if (!RequestSchemeIsHTTPOrHTTPS(request) || |
| 638 !RequestProvidesRTTObservation(request)) { | 638 !RequestProvidesRTTObservation(request)) { |
| 639 return; | 639 return; |
| 640 } | 640 } |
| 641 | 641 |
| 642 const base::TimeTicks now = tick_clock_->NowTicks(); | 642 const base::TimeTicks now = tick_clock_->NowTicks(); |
| 643 | 643 |
| 644 // Update |estimated_quality_at_last_main_frame_| if this is a main frame | 644 // Update |estimated_quality_at_last_main_frame_| if this is a main frame |
| 645 // request. | 645 // request. |
| 646 if (request.load_flags() & LOAD_MAIN_FRAME) { | 646 if (request.load_flags() & LOAD_MAIN_FRAME_DEPRECATED) { |
| 647 last_main_frame_request_ = now; | 647 last_main_frame_request_ = now; |
| 648 base::TimeDelta estimated_http_rtt; | 648 base::TimeDelta estimated_http_rtt; |
| 649 if (!GetHttpRTTEstimate(&estimated_http_rtt)) | 649 if (!GetHttpRTTEstimate(&estimated_http_rtt)) |
| 650 estimated_http_rtt = nqe::internal::InvalidRTT(); | 650 estimated_http_rtt = nqe::internal::InvalidRTT(); |
| 651 | 651 |
| 652 base::TimeDelta estimated_transport_rtt; | 652 base::TimeDelta estimated_transport_rtt; |
| 653 if (!GetTransportRTTEstimate(&estimated_transport_rtt)) | 653 if (!GetTransportRTTEstimate(&estimated_transport_rtt)) |
| 654 estimated_transport_rtt = nqe::internal::InvalidRTT(); | 654 estimated_transport_rtt = nqe::internal::InvalidRTT(); |
| 655 | 655 |
| 656 int32_t downstream_throughput_kbps; | 656 int32_t downstream_throughput_kbps; |
| (...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1703 if (effective_connection_type_ != EFFECTIVE_CONNECTION_TYPE_UNKNOWN) { | 1703 if (effective_connection_type_ != EFFECTIVE_CONNECTION_TYPE_UNKNOWN) { |
| 1704 network_quality_store_->Add( | 1704 network_quality_store_->Add( |
| 1705 current_network_id_, | 1705 current_network_id_, |
| 1706 nqe::internal::CachedNetworkQuality( | 1706 nqe::internal::CachedNetworkQuality( |
| 1707 tick_clock_->NowTicks(), estimated_quality_at_last_main_frame_, | 1707 tick_clock_->NowTicks(), estimated_quality_at_last_main_frame_, |
| 1708 effective_connection_type_)); | 1708 effective_connection_type_)); |
| 1709 } | 1709 } |
| 1710 } | 1710 } |
| 1711 | 1711 |
| 1712 } // namespace net | 1712 } // namespace net |
| OLD | NEW |