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

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

Issue 2278823003: Change net::LOAD_MAIN_FRAME to net::LOAD_MAIN_FRAME_DEPRECATED to discourage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added deprecation flag to two recent tests. Created 4 years, 3 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/http/http_network_transaction.cc ('k') | net/nqe/network_quality_estimator_unittest.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 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
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
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
OLDNEW
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | net/nqe/network_quality_estimator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698