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

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

Issue 1786493003: Add a QUIC ScopedPacketBundler to send an ack when the ack alarm goes off. No functional change. … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@116389752
Patch Set: Created 4 years, 9 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 | « no previous file | 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 net::ADDRESS_FAMILY_UNSPECIFIED; 81 net::ADDRESS_FAMILY_UNSPECIFIED;
82 } 82 }
83 83
84 // An alarm that is scheduled to send an ack if a timeout occurs. 84 // An alarm that is scheduled to send an ack if a timeout occurs.
85 class AckAlarm : public QuicAlarm::Delegate { 85 class AckAlarm : public QuicAlarm::Delegate {
86 public: 86 public:
87 explicit AckAlarm(QuicConnection* connection) : connection_(connection) {} 87 explicit AckAlarm(QuicConnection* connection) : connection_(connection) {}
88 88
89 void OnAlarm() override { 89 void OnAlarm() override {
90 DCHECK(connection_->ack_frame_updated()); 90 DCHECK(connection_->ack_frame_updated());
91 connection_->SendAck(); 91 QuicConnection::ScopedPacketBundler bundler(connection_,
92 QuicConnection::SEND_ACK);
92 } 93 }
93 94
94 private: 95 private:
95 QuicConnection* connection_; 96 QuicConnection* connection_;
96 97
97 DISALLOW_COPY_AND_ASSIGN(AckAlarm); 98 DISALLOW_COPY_AND_ASSIGN(AckAlarm);
98 }; 99 };
99 100
100 // This alarm will be scheduled any time a data-bearing packet is sent out. 101 // This alarm will be scheduled any time a data-bearing packet is sent out.
101 // When the alarm goes off, the connection checks to see if the oldest packets 102 // When the alarm goes off, the connection checks to see if the oldest packets
(...skipping 2226 matching lines...) Expand 10 before | Expand all | Expand 10 after
2328 } 2329 }
2329 2330
2330 StringPiece QuicConnection::GetCurrentPacket() { 2331 StringPiece QuicConnection::GetCurrentPacket() {
2331 if (current_packet_data_ == nullptr) { 2332 if (current_packet_data_ == nullptr) {
2332 return StringPiece(); 2333 return StringPiece();
2333 } 2334 }
2334 return StringPiece(current_packet_data_, last_size_); 2335 return StringPiece(current_packet_data_, last_size_);
2335 } 2336 }
2336 2337
2337 } // namespace net 2338 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698