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

Unified Diff: net/quic/quic_connection.cc

Issue 288313003: Land Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src
Patch Set: implemented rch's comments Created 6 years, 7 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
Index: net/quic/quic_connection.cc
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
index be606c2e138cd61505951d03720e6c1b6467934f..523ce6ecef8b184822955d4de1a8177f8cb66316 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -23,7 +23,6 @@
#include "net/quic/quic_bandwidth.h"
#include "net/quic/quic_config.h"
#include "net/quic/quic_flags.h"
-#include "net/quic/quic_flow_controller.h"
#include "net/quic/quic_utils.h"
using base::hash_map;
@@ -193,8 +192,7 @@ QuicConnection::QuicConnection(QuicConnectionId connection_id,
QuicConnectionHelperInterface* helper,
QuicPacketWriter* writer,
bool is_server,
- const QuicVersionVector& supported_versions,
- uint32 max_flow_control_receive_window_bytes)
+ const QuicVersionVector& supported_versions)
: framer_(supported_versions, helper->GetClock()->ApproximateNow(),
is_server),
helper_(helper),
@@ -238,22 +236,7 @@ QuicConnection::QuicConnection(QuicConnectionId connection_id,
peer_ip_changed_(false),
peer_port_changed_(false),
self_ip_changed_(false),
- self_port_changed_(false),
- max_flow_control_receive_window_bytes_(
- max_flow_control_receive_window_bytes) {
- if (max_flow_control_receive_window_bytes_ < kDefaultFlowControlSendWindow) {
- DLOG(ERROR) << "Initial receive window ("
- << max_flow_control_receive_window_bytes_
- << ") cannot be set lower than default ("
- << kDefaultFlowControlSendWindow << ").";
- max_flow_control_receive_window_bytes_ = kDefaultFlowControlSendWindow;
- }
-
- flow_controller_.reset(new QuicFlowController(
- supported_versions.front(), 0, is_server_,
- kDefaultFlowControlSendWindow, max_flow_control_receive_window_bytes_,
- max_flow_control_receive_window_bytes_));
-
+ self_port_changed_(false) {
if (!is_server_) {
// Pacing will be enabled if the client negotiates it.
sent_packet_manager_.MaybeEnablePacing();
@@ -375,10 +358,6 @@ bool QuicConnection::OnProtocolVersionMismatch(QuicVersion received_version) {
// Store the new version.
framer_.set_version(received_version);
- if (received_version < QUIC_VERSION_19) {
- flow_controller_->Disable();
- }
-
// TODO(satyamshekhar): Store the sequence number of this packet and close the
// connection if we ever received a packet with incorrect version and whose
// sequence number is greater.
@@ -494,9 +473,6 @@ bool QuicConnection::OnPacketHeader(const QuicPacketHeader& header) {
DCHECK_EQ(header.public_header.versions[0], version());
version_negotiation_state_ = NEGOTIATED_VERSION;
visitor_->OnSuccessfulVersionNegotiation(version());
- if (version() < QUIC_VERSION_19) {
- flow_controller_->Disable();
- }
}
} else {
DCHECK(!header.public_header.version_flag);
@@ -505,9 +481,6 @@ bool QuicConnection::OnPacketHeader(const QuicPacketHeader& header) {
packet_creator_.StopSendingVersion();
version_negotiation_state_ = NEGOTIATED_VERSION;
visitor_->OnSuccessfulVersionNegotiation(version());
- if (version() < QUIC_VERSION_19) {
- flow_controller_->Disable();
- }
}
}
@@ -1184,7 +1157,8 @@ void QuicConnection::OnCanWrite() {
// After the visitor writes, it may have caused the socket to become write
// blocked or the congestion manager to prohibit sending, so check again.
- if (visitor_->HasPendingWrites() && !resume_writes_alarm_->IsSet() &&
+ if (visitor_->WillingAndAbleToWrite() &&
+ !resume_writes_alarm_->IsSet() &&
CanWrite(NOT_RETRANSMISSION, HAS_RETRANSMITTABLE_DATA)) {
// We're not write blocked, but some stream didn't write out all of its
// bytes. Register for 'immediate' resumption so we'll keep writing after

Powered by Google App Engine
This is Rietveld 408576698