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

Unified Diff: net/quic/quic_connection.cc

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_connection.h ('k') | net/quic/quic_connection_logger.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_connection.cc
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
index 62cbc6465ff0d63eb16175c74cc37b7bac355f42..c33aec55e26698650b0069184588f3446a9f8ac3 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -15,6 +15,7 @@
#include <utility>
#include "base/debug/stack_trace.h"
+#include "base/format_macros.h"
#include "base/logging.h"
#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
@@ -57,10 +58,10 @@ const QuicPacketSequenceNumber kMaxPacketGap = 5000;
const size_t kMaxFecGroups = 2;
// Maximum number of acks received before sending an ack in response.
-const size_t kMaxPacketsReceivedBeforeAckSend = 20;
+const QuicPacketCount kMaxPacketsReceivedBeforeAckSend = 20;
// Maximum number of tracked packets.
-const size_t kMaxTrackedPackets = 5 * kMaxTcpCongestionWindow;;
+const QuicPacketCount kMaxTrackedPackets = 5 * kMaxTcpCongestionWindow;
bool Near(QuicPacketSequenceNumber a, QuicPacketSequenceNumber b) {
QuicPacketSequenceNumber delta = (a > b) ? a - b : b - a;
@@ -282,9 +283,9 @@ void QuicConnection::SetFromConfig(const QuicConfig& config) {
max_undecryptable_packets_ = config.max_undecryptable_packets();
}
-void QuicConnection::ResumeConnectionState(
+bool QuicConnection::ResumeConnectionState(
const CachedNetworkParameters& cached_network_params) {
- sent_packet_manager_.ResumeConnectionState(cached_network_params);
+ return sent_packet_manager_.ResumeConnectionState(cached_network_params);
}
void QuicConnection::SetNumOpenStreams(size_t num_streams) {
@@ -949,14 +950,14 @@ void QuicConnection::MaybeCloseIfTooManyOutstandingPackets() {
(sent_packet_manager_.GetLeastUnacked() + kMaxTrackedPackets)) {
SendConnectionCloseWithDetails(
QUIC_TOO_MANY_OUTSTANDING_SENT_PACKETS,
- StringPrintf("More than %zu outstanding.", kMaxTrackedPackets));
+ StringPrintf("More than %" PRIu64 " outstanding.", kMaxTrackedPackets));
}
// This occurs if there are received packet gaps and the peer does not raise
// the least unacked fast enough.
if (received_packet_manager_.NumTrackedPackets() > kMaxTrackedPackets) {
SendConnectionCloseWithDetails(
QUIC_TOO_MANY_OUTSTANDING_RECEIVED_PACKETS,
- StringPrintf("More than %zu outstanding.", kMaxTrackedPackets));
+ StringPrintf("More than %" PRIu64 " outstanding.", kMaxTrackedPackets));
}
}
@@ -1138,8 +1139,7 @@ const QuicConnectionStats& QuicConnection::GetStats() {
sent_packet_manager_.GetRttStats()->min_rtt().ToMicroseconds();
stats_.srtt_us =
sent_packet_manager_.GetRttStats()->smoothed_rtt().ToMicroseconds();
- stats_.estimated_bandwidth =
- sent_packet_manager_.BandwidthEstimate().ToBytesPerSecond();
+ stats_.estimated_bandwidth = sent_packet_manager_.BandwidthEstimate();
stats_.max_packet_size = packet_generator_.max_packet_length();
return stats_;
}
« no previous file with comments | « net/quic/quic_connection.h ('k') | net/quic/quic_connection_logger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698