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

Unified Diff: net/quic/quic_connection.cc

Issue 14816006: Land Recent QUIC changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing NET_PRIVATE_EXPORT to QuicWallTime Created 7 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
« no previous file with comments | « net/quic/quic_connection.h ('k') | net/quic/quic_connection_helper_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 4851d47019a6ab84448514c46835d1fedc7650b4..481fca95148aa10bb98c843bc17286a7457d306a 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -24,10 +24,6 @@ using std::set;
using std::string;
namespace net {
-
-// TODO(pwestin): kDefaultTimeoutUs is in int64.
-int32 kNegotiatedTimeoutUs = kDefaultTimeoutUs;
-
namespace {
// The largest gap in packets we'll accept without closing the connection.
@@ -77,10 +73,10 @@ QuicConnection::QuicConnection(QuicGuid guid,
IPEndPoint address,
QuicConnectionHelperInterface* helper,
bool is_server)
- : helper_(helper),
- framer_(kQuicVersion1,
+ : framer_(kQuicVersion1,
helper->GetClock()->ApproximateNow(),
is_server),
+ helper_(helper),
encryption_level_(ENCRYPTION_NONE),
clock_(helper->GetClock()),
random_generator_(helper->GetRandomGenerator()),
@@ -136,7 +132,7 @@ QuicConnection::~QuicConnection() {
}
bool QuicConnection::SelectMutualVersion(
- const QuicVersionTagList& available_versions) {
+ const QuicTagVector& available_versions) {
// TODO(satyamshekhar): Make this generic.
if (std::find(available_versions.begin(), available_versions.end(),
kQuicVersion1) == available_versions.end()) {
@@ -178,8 +174,7 @@ void QuicConnection::OnPublicResetPacket(
CloseConnection(QUIC_PUBLIC_RESET, true);
}
-bool QuicConnection::OnProtocolVersionMismatch(
- QuicVersionTag received_version) {
+bool QuicConnection::OnProtocolVersionMismatch(QuicTag received_version) {
// TODO(satyamshekhar): Implement no server state in this mode.
if (!is_server_) {
LOG(DFATAL) << "Framer called OnProtocolVersionMismatch for server. "
@@ -680,7 +675,7 @@ void QuicConnection::MaybeSendAckInResponseToPacket() {
}
void QuicConnection::SendVersionNegotiationPacket() {
- QuicVersionTagList supported_versions;
+ QuicTagVector supported_versions;
supported_versions.push_back(kQuicVersion1);
QuicEncryptedPacket* encrypted =
packet_creator_.SerializeVersionNegotiationPacket(supported_versions);
@@ -1294,6 +1289,11 @@ bool QuicConnection::HasQueuedData() const {
return !queued_packets_.empty() || packet_generator_.HasQueuedData();
}
+void QuicConnection::SetConnectionTimeout(QuicTime::Delta timeout) {
+ timeout_ = timeout;
+ CheckForTimeout();
+}
+
bool QuicConnection::CheckForTimeout() {
QuicTime now = clock_->ApproximateNow();
QuicTime time_of_last_packet = std::max(time_of_last_received_packet_,
« no previous file with comments | « net/quic/quic_connection.h ('k') | net/quic/quic_connection_helper_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698