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

Unified Diff: net/quic/quic_connection.cc

Issue 908493004: Landing Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix valgrind error Created 5 years, 10 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 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_test.cc » ('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 778d6d0c51ee5353784a053866bef381235e756e..019e044d8eb9db81d424a43be9cccc285da6094b 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -291,7 +291,7 @@ void QuicConnection::SetFromConfig(const QuicConfig& config) {
if (config.negotiated()) {
SetNetworkTimeouts(QuicTime::Delta::Infinite(),
config.IdleConnectionStateLifetime());
- if (FLAGS_quic_allow_silent_close && config.SilentClose()) {
+ if (config.SilentClose()) {
silent_close_enabled_ = true;
}
} else {
@@ -969,18 +969,16 @@ void QuicConnection::MaybeCloseIfTooManyOutstandingPackets() {
}
}
-QuicAckFrame* QuicConnection::CreateAckFrame() {
- QuicAckFrame* outgoing_ack = new QuicAckFrame();
- received_packet_manager_.UpdateReceivedPacketInfo(
- outgoing_ack, clock_->ApproximateNow());
- DVLOG(1) << ENDPOINT << "Creating ack frame: " << *outgoing_ack;
- return outgoing_ack;
+void QuicConnection::PopulateAckFrame(QuicAckFrame* ack) {
+ received_packet_manager_.UpdateReceivedPacketInfo(ack,
+ clock_->ApproximateNow());
}
-QuicStopWaitingFrame* QuicConnection::CreateStopWaitingFrame() {
- QuicStopWaitingFrame stop_waiting;
- UpdateStopWaiting(&stop_waiting);
- return new QuicStopWaitingFrame(stop_waiting);
+void QuicConnection::PopulateStopWaitingFrame(
+ QuicStopWaitingFrame* stop_waiting) {
+ stop_waiting->least_unacked = GetLeastUnacked();
+ stop_waiting->entropy_hash = sent_entropy_manager_.GetCumulativeEntropy(
+ stop_waiting->least_unacked - 1);
}
bool QuicConnection::ShouldLastPacketInstigateAck() const {
@@ -1439,15 +1437,14 @@ bool QuicConnection::WritePacketInner(QueuedPacket* packet) {
}
DCHECK_LE(encrypted->length(), packet_generator_.max_packet_length());
DVLOG(1) << ENDPOINT << "Sending packet " << sequence_number << " : "
- << (packet->serialized_packet.packet->is_fec_packet() ? "FEC " :
- (IsRetransmittable(*packet) == HAS_RETRANSMITTABLE_DATA
- ? "data bearing " : " ack only "))
- << ", encryption level: "
+ << (packet->serialized_packet.is_fec_packet
+ ? "FEC "
+ : (IsRetransmittable(*packet) == HAS_RETRANSMITTABLE_DATA
+ ? "data bearing "
+ : " ack only ")) << ", encryption level: "
<< QuicUtils::EncryptionLevelToString(packet->encryption_level)
- << ", length:"
- << packet->serialized_packet.packet->length()
- << ", encrypted length:"
- << encrypted->length();
+ << ", length:" << packet->serialized_packet.packet->length()
+ << ", encrypted length:" << encrypted->length();
DVLOG(2) << ENDPOINT << "packet(" << sequence_number << "): " << std::endl
<< QuicUtils::StringToHexASCIIDump(
packet->serialized_packet.packet->AsStringPiece());
@@ -1604,7 +1601,7 @@ void QuicConnection::OnSerializedPacket(
sent_packet_manager_.OnSerializedPacket(serialized_packet);
}
}
- if (serialized_packet.packet->is_fec_packet() && fec_alarm_->IsSet()) {
+ if (serialized_packet.is_fec_packet && fec_alarm_->IsSet()) {
// If an FEC packet is serialized with the FEC alarm set, cancel the alarm.
fec_alarm_->Cancel();
}
@@ -1653,12 +1650,6 @@ void QuicConnection::SendOrQueuePacket(QueuedPacket packet) {
}
}
-void QuicConnection::UpdateStopWaiting(QuicStopWaitingFrame* stop_waiting) {
- stop_waiting->least_unacked = GetLeastUnacked();
- stop_waiting->entropy_hash = sent_entropy_manager_.GetCumulativeEntropy(
- stop_waiting->least_unacked - 1);
-}
-
void QuicConnection::SendPing() {
if (retransmission_alarm_->IsSet()) {
return;
« no previous file with comments | « net/quic/quic_connection.h ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698