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

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

Issue 2015523002: Pulls out QuicConnection alarm cancellation into method. No behavior change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@122677152
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') | no next file » | 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 2028 matching lines...) Expand 10 before | Expand all | Expand 10 after
2039 if (visitor_ != nullptr) { 2039 if (visitor_ != nullptr) {
2040 visitor_->OnConnectionClosed(error, error_details, source); 2040 visitor_->OnConnectionClosed(error, error_details, source);
2041 } else { 2041 } else {
2042 UMA_HISTOGRAM_BOOLEAN("Net.QuicCloseConnection.NullVisitor", true); 2042 UMA_HISTOGRAM_BOOLEAN("Net.QuicCloseConnection.NullVisitor", true);
2043 } 2043 }
2044 if (debug_visitor_ != nullptr) { 2044 if (debug_visitor_ != nullptr) {
2045 debug_visitor_->OnConnectionClosed(error, error_details, source); 2045 debug_visitor_->OnConnectionClosed(error, error_details, source);
2046 } 2046 }
2047 // Cancel the alarms so they don't trigger any action now that the 2047 // Cancel the alarms so they don't trigger any action now that the
2048 // connection is closed. 2048 // connection is closed.
2049 CancelAllAlarms();
2050 }
2051
2052 void QuicConnection::CancelAllAlarms() {
2049 ack_alarm_->Cancel(); 2053 ack_alarm_->Cancel();
2050 ping_alarm_->Cancel(); 2054 ping_alarm_->Cancel();
2051 resume_writes_alarm_->Cancel(); 2055 resume_writes_alarm_->Cancel();
2052 retransmission_alarm_->Cancel(); 2056 retransmission_alarm_->Cancel();
2053 send_alarm_->Cancel(); 2057 send_alarm_->Cancel();
2054 timeout_alarm_->Cancel(); 2058 timeout_alarm_->Cancel();
2055 mtu_discovery_alarm_->Cancel(); 2059 mtu_discovery_alarm_->Cancel();
2056 } 2060 }
2057 2061
2058 void QuicConnection::SendGoAway(QuicErrorCode error, 2062 void QuicConnection::SendGoAway(QuicErrorCode error,
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
2494 // the sender and a signaling mechanism -- if the sender uses a 2498 // the sender and a signaling mechanism -- if the sender uses a
2495 // different MinRTO, we may get spurious retransmissions. May not have 2499 // different MinRTO, we may get spurious retransmissions. May not have
2496 // any benefits, but if the delayed ack becomes a significant source 2500 // any benefits, but if the delayed ack becomes a significant source
2497 // of (likely, tail) latency, then consider such a mechanism. 2501 // of (likely, tail) latency, then consider such a mechanism.
2498 const QuicTime::Delta QuicConnection::DelayedAckTime() { 2502 const QuicTime::Delta QuicConnection::DelayedAckTime() {
2499 return QuicTime::Delta::FromMilliseconds( 2503 return QuicTime::Delta::FromMilliseconds(
2500 min(kMaxDelayedAckTimeMs, kMinRetransmissionTimeMs / 2)); 2504 min(kMaxDelayedAckTimeMs, kMinRetransmissionTimeMs / 2));
2501 } 2505 }
2502 2506
2503 } // namespace net 2507 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698