| 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/quic_packet_creator.h" | 5 #include "net/quic/quic_packet_creator.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 void QuicPacketCreator::MaybeAddPadding() { | 635 void QuicPacketCreator::MaybeAddPadding() { |
| 636 if (!needs_padding_) { | 636 if (!needs_padding_) { |
| 637 return; | 637 return; |
| 638 } | 638 } |
| 639 | 639 |
| 640 if (BytesFree() == 0) { | 640 if (BytesFree() == 0) { |
| 641 // Don't pad full packets. | 641 // Don't pad full packets. |
| 642 return; | 642 return; |
| 643 } | 643 } |
| 644 | 644 |
| 645 QuicPaddingFrame padding; | 645 bool success = AddFrame(QuicFrame(QuicPaddingFrame()), false, false, nullptr); |
| 646 bool success = AddFrame(QuicFrame(&padding), false, false, nullptr); | |
| 647 DCHECK(success); | 646 DCHECK(success); |
| 648 } | 647 } |
| 649 | 648 |
| 650 } // namespace net | 649 } // namespace net |
| OLD | NEW |