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

Unified Diff: net/quic/quic_connection.cc

Issue 125403006: Various QUIC cleanups to sync with internal code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comments Created 6 years, 11 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_end_to_end_unittest.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 ad88a90b33d879f183bb812e413d3bf4c7ccf055..51991be46cd61a0f983c3b15e80945075e657d8f 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -35,12 +35,7 @@ using std::vector;
using std::set;
using std::string;
-int FLAGS_fake_packet_loss_percentage = 0;
-
-// If true, then QUIC connections will bundle acks with any outgoing packet when
-// an ack is being delayed. This is an optimization to reduce ack latency and
-// packet count of pure ack packets.
-bool FLAGS_bundle_ack_with_outgoing_packet = false;
+extern bool FLAGS_quic_allow_oversized_packets_for_test;
namespace net {
@@ -66,7 +61,6 @@ bool Near(QuicPacketSequenceNumber a, QuicPacketSequenceNumber b) {
return delta <= kMaxPacketGap;
}
-
// An alarm that is scheduled to send an ack if a timeout occurs.
class AckAlarm : public QuicAlarm::Delegate {
public:
@@ -137,17 +131,17 @@ class TimeoutAlarm : public QuicAlarm::Delegate {
// Indicates if any of the frames are intended to be sent with FORCE.
// Returns FORCE when one of the frames is a CONNECTION_CLOSE_FRAME.
-net::QuicConnection::Force HasForcedFrames(
+QuicConnection::Force HasForcedFrames(
const RetransmittableFrames* retransmittable_frames) {
if (!retransmittable_frames) {
- return net::QuicConnection::NO_FORCE;
+ return QuicConnection::NO_FORCE;
}
for (size_t i = 0; i < retransmittable_frames->frames().size(); ++i) {
if (retransmittable_frames->frames()[i].type == CONNECTION_CLOSE_FRAME) {
- return net::QuicConnection::FORCE;
+ return QuicConnection::FORCE;
}
}
- return net::QuicConnection::NO_FORCE;
+ return QuicConnection::NO_FORCE;
}
} // namespace
@@ -828,7 +822,6 @@ QuicConsumedData QuicConnection::SendStreamData(
void QuicConnection::SendRstStream(QuicStreamId id,
QuicRstStreamErrorCode error) {
- DVLOG(1) << "Sending RST_STREAM: " << id << " code: " << error;
// Opportunistically bundle an ack with this outgoing packet.
ScopedPacketBundler ack_bundler(this, true);
packet_generator_.AddControlFrame(
@@ -1137,7 +1130,8 @@ bool QuicConnection::WritePacket(EncryptionLevel level,
DVLOG(2) << ENDPOINT << "packet(" << sequence_number << "): " << std::endl
<< QuicUtils::StringToHexASCIIDump(packet->AsStringPiece());
- DCHECK(encrypted->length() <= kMaxPacketSize)
+ DCHECK(encrypted->length() <= kMaxPacketSize ||
+ FLAGS_quic_allow_oversized_packets_for_test)
<< "Packet " << sequence_number << " will not be read; too large: "
<< packet->length() << " " << encrypted->length() << " "
<< " forced: " << (forced == FORCE ? "yes" : "no");
@@ -1592,8 +1586,8 @@ void QuicConnection::SetOverallConnectionTimeout(QuicTime::Delta timeout) {
bool QuicConnection::CheckForTimeout() {
QuicTime now = clock_->ApproximateNow();
- QuicTime time_of_last_packet = std::max(time_of_last_received_packet_,
- time_of_last_sent_new_packet_);
+ QuicTime time_of_last_packet = max(time_of_last_received_packet_,
+ time_of_last_sent_new_packet_);
// |delta| can be < 0 as |now| is approximate time but |time_of_last_packet|
// is accurate time. However, this should not change the behavior of
« no previous file with comments | « net/quic/quic_connection.h ('k') | net/quic/quic_end_to_end_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698