OLD | NEW |
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/core/quic_packet_generator.h" | 5 #include "net/quic/core/quic_packet_generator.h" |
6 | 6 |
7 #include <cstdint> | 7 #include <cstdint> |
8 | 8 |
9 #include "net/quic/core/crypto/quic_random.h" | 9 #include "net/quic/core/crypto/quic_random.h" |
10 #include "net/quic/core/quic_utils.h" | 10 #include "net/quic/core/quic_utils.h" |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 random_generator_->RandUint64() % kMaxNumRandomPaddingBytes + 1); | 341 random_generator_->RandUint64() % kMaxNumRandomPaddingBytes + 1); |
342 } | 342 } |
343 | 343 |
344 void QuicPacketGenerator::SendRemainingPendingPadding() { | 344 void QuicPacketGenerator::SendRemainingPendingPadding() { |
345 while (packet_creator_.pending_padding_bytes() > 0 && !HasQueuedFrames() && | 345 while (packet_creator_.pending_padding_bytes() > 0 && !HasQueuedFrames() && |
346 CanSendWithNextPendingFrameAddition()) { | 346 CanSendWithNextPendingFrameAddition()) { |
347 packet_creator_.Flush(); | 347 packet_creator_.Flush(); |
348 } | 348 } |
349 } | 349 } |
350 | 350 |
| 351 bool QuicPacketGenerator::HasRetransmittableFrames() const { |
| 352 return !queued_control_frames_.empty() || |
| 353 packet_creator_.HasPendingRetransmittableFrames(); |
| 354 } |
| 355 |
351 } // namespace net | 356 } // namespace net |
OLD | NEW |