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

Side by Side Diff: net/quic/quic_connection.cc

Issue 1981643002: Combine OnCongestionWindowChange and OnRttChange to OnCongestionChange in QuicSentPacketManager::Ne… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@121732198
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « net/quic/quic_connection.h ('k') | net/quic/quic_sent_packet_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_connection.h" 5 #include "net/quic/quic_connection.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 #include <sys/types.h> 8 #include <sys/types.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1739 matching lines...) Expand 10 before | Expand all | Expand 10 after
1750 } 1750 }
1751 1751
1752 void QuicConnection::OnUnrecoverableError(QuicErrorCode error, 1752 void QuicConnection::OnUnrecoverableError(QuicErrorCode error,
1753 const string& error_details, 1753 const string& error_details,
1754 ConnectionCloseSource source) { 1754 ConnectionCloseSource source) {
1755 // The packet creator or generator encountered an unrecoverable error: tear 1755 // The packet creator or generator encountered an unrecoverable error: tear
1756 // down local connection state immediately. 1756 // down local connection state immediately.
1757 TearDownLocalConnectionState(error, error_details, source); 1757 TearDownLocalConnectionState(error, error_details, source);
1758 } 1758 }
1759 1759
1760 void QuicConnection::OnCongestionWindowChange() { 1760 void QuicConnection::OnCongestionChange() {
1761 visitor_->OnCongestionWindowChange(clock_->ApproximateNow()); 1761 visitor_->OnCongestionWindowChange(clock_->ApproximateNow());
1762 }
1763 1762
1764 void QuicConnection::OnRttChange() {
1765 // Uses the connection's smoothed RTT. If zero, uses initial_rtt. 1763 // Uses the connection's smoothed RTT. If zero, uses initial_rtt.
1766 QuicTime::Delta rtt = sent_packet_manager_.GetRttStats()->smoothed_rtt(); 1764 QuicTime::Delta rtt = sent_packet_manager_.GetRttStats()->smoothed_rtt();
1767 if (rtt.IsZero()) { 1765 if (rtt.IsZero()) {
1768 rtt = QuicTime::Delta::FromMicroseconds( 1766 rtt = QuicTime::Delta::FromMicroseconds(
1769 sent_packet_manager_.GetRttStats()->initial_rtt_us()); 1767 sent_packet_manager_.GetRttStats()->initial_rtt_us());
1770 } 1768 }
1771 1769
1772 if (debug_visitor_) 1770 if (debug_visitor_)
1773 debug_visitor_->OnRttChanged(rtt); 1771 debug_visitor_->OnRttChanged(rtt);
1774 } 1772 }
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
2436 } 2434 }
2437 2435
2438 StringPiece QuicConnection::GetCurrentPacket() { 2436 StringPiece QuicConnection::GetCurrentPacket() {
2439 if (current_packet_data_ == nullptr) { 2437 if (current_packet_data_ == nullptr) {
2440 return StringPiece(); 2438 return StringPiece();
2441 } 2439 }
2442 return StringPiece(current_packet_data_, last_size_); 2440 return StringPiece(current_packet_data_, last_size_);
2443 } 2441 }
2444 2442
2445 } // namespace net 2443 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection.h ('k') | net/quic/quic_sent_packet_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698