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

Side by Side Diff: net/tools/quic/quic_server_session_base.cc

Issue 1871953003: relnote: deprecate --quic_log_received_parameters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@05_CL_119182848
Patch Set: Created 4 years, 8 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/quic/quic_flags.cc ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/tools/quic/quic_server_session_base.h" 5 #include "net/tools/quic/quic_server_session_base.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "net/quic/proto/cached_network_parameters.pb.h" 8 #include "net/quic/proto/cached_network_parameters.pb.h"
9 #include "net/quic/quic_bug_tracker.h" 9 #include "net/quic/quic_bug_tracker.h"
10 #include "net/quic/quic_connection.h" 10 #include "net/quic/quic_connection.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 server_push_enabled_ = 57 server_push_enabled_ =
58 ContainsQuicTag(config()->ReceivedConnectionOptions(), kSPSH); 58 ContainsQuicTag(config()->ReceivedConnectionOptions(), kSPSH);
59 59
60 // If the client has provided a bandwidth estimate from the same serving 60 // If the client has provided a bandwidth estimate from the same serving
61 // region as this server, then decide whether to use the data for bandwidth 61 // region as this server, then decide whether to use the data for bandwidth
62 // resumption. 62 // resumption.
63 const CachedNetworkParameters* cached_network_params = 63 const CachedNetworkParameters* cached_network_params =
64 crypto_stream_->PreviousCachedNetworkParams(); 64 crypto_stream_->PreviousCachedNetworkParams();
65 if (cached_network_params != nullptr && 65 if (cached_network_params != nullptr &&
66 cached_network_params->serving_region() == serving_region_) { 66 cached_network_params->serving_region() == serving_region_) {
67 if (FLAGS_quic_log_received_parameters) { 67 // Log the received connection parameters, regardless of how they
68 connection()->OnReceiveConnectionState(*cached_network_params); 68 // get used for bandwidth resumption.
69 } 69 connection()->OnReceiveConnectionState(*cached_network_params);
70 70
71 if (bandwidth_resumption_enabled_) { 71 if (bandwidth_resumption_enabled_) {
72 // Only do bandwidth resumption if estimate is recent enough. 72 // Only do bandwidth resumption if estimate is recent enough.
73 const int64_t seconds_since_estimate = 73 const int64_t seconds_since_estimate =
74 connection()->clock()->WallNow().ToUNIXSeconds() - 74 connection()->clock()->WallNow().ToUNIXSeconds() -
75 cached_network_params->timestamp(); 75 cached_network_params->timestamp();
76 if (seconds_since_estimate <= kNumSecondsPerHour) { 76 if (seconds_since_estimate <= kNumSecondsPerHour) {
77 connection()->ResumeConnectionState(*cached_network_params, 77 connection()->ResumeConnectionState(*cached_network_params,
78 max_bandwidth_resumption); 78 max_bandwidth_resumption);
79 } 79 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 234
235 int32_t QuicServerSessionBase::BandwidthToCachedParameterBytesPerSecond( 235 int32_t QuicServerSessionBase::BandwidthToCachedParameterBytesPerSecond(
236 const QuicBandwidth& bandwidth) { 236 const QuicBandwidth& bandwidth) {
237 int64_t bytes_per_second = bandwidth.ToBytesPerSecond(); 237 int64_t bytes_per_second = bandwidth.ToBytesPerSecond();
238 return (bytes_per_second > static_cast<int64_t>(INT32_MAX) 238 return (bytes_per_second > static_cast<int64_t>(INT32_MAX)
239 ? INT32_MAX 239 ? INT32_MAX
240 : static_cast<int32_t>(bytes_per_second)); 240 : static_cast<int32_t>(bytes_per_second));
241 } 241 }
242 242
243 } // namespace net 243 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_flags.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698