| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/test_tools/quic_packet_creator_peer.h" | 5 #include "net/quic/test_tools/quic_packet_creator_peer.h" |
| 6 | 6 |
| 7 #include "net/quic/quic_packet_creator.h" | 7 #include "net/quic/quic_packet_creator.h" |
| 8 | 8 |
| 9 namespace net { | 9 namespace net { |
| 10 namespace test { | 10 namespace test { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 DCHECK(creator->queued_frames_.empty()); | 120 DCHECK(creator->queued_frames_.empty()); |
| 121 DCHECK(!frames.empty()); | 121 DCHECK(!frames.empty()); |
| 122 for (const QuicFrame& frame : frames) { | 122 for (const QuicFrame& frame : frames) { |
| 123 bool success = creator->AddFrame(frame, false); | 123 bool success = creator->AddFrame(frame, false); |
| 124 DCHECK(success); | 124 DCHECK(success); |
| 125 } | 125 } |
| 126 creator->SerializePacket(buffer, buffer_len); | 126 creator->SerializePacket(buffer, buffer_len); |
| 127 SerializedPacket packet = creator->packet_; | 127 SerializedPacket packet = creator->packet_; |
| 128 // The caller takes ownership of the QuicEncryptedPacket. | 128 // The caller takes ownership of the QuicEncryptedPacket. |
| 129 creator->packet_.packet = nullptr; | 129 creator->packet_.packet = nullptr; |
| 130 DCHECK(packet.retransmittable_frames == nullptr); | 130 DCHECK(packet.retransmittable_frames.empty()); |
| 131 return packet; | 131 return packet; |
| 132 } | 132 } |
| 133 | 133 |
| 134 // static | 134 // static |
| 135 void QuicPacketCreatorPeer::ResetFecGroup(QuicPacketCreator* creator) { | 135 void QuicPacketCreatorPeer::ResetFecGroup(QuicPacketCreator* creator) { |
| 136 creator->ResetFecGroup(); | 136 creator->ResetFecGroup(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 // static | 139 // static |
| 140 QuicTime::Delta QuicPacketCreatorPeer::GetFecTimeout( | 140 QuicTime::Delta QuicPacketCreatorPeer::GetFecTimeout( |
| (...skipping 13 matching lines...) Expand all Loading... |
| 154 return creator->packet_.encryption_level; | 154 return creator->packet_.encryption_level; |
| 155 } | 155 } |
| 156 | 156 |
| 157 // static | 157 // static |
| 158 QuicPathId QuicPacketCreatorPeer::GetCurrentPath(QuicPacketCreator* creator) { | 158 QuicPathId QuicPacketCreatorPeer::GetCurrentPath(QuicPacketCreator* creator) { |
| 159 return creator->packet_.path_id; | 159 return creator->packet_.path_id; |
| 160 } | 160 } |
| 161 | 161 |
| 162 } // namespace test | 162 } // namespace test |
| 163 } // namespace net | 163 } // namespace net |
| OLD | NEW |