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/test_tools/simple_quic_framer.h" | 5 #include "net/quic/test_tools/simple_quic_framer.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "net/quic/core/crypto/quic_decrypter.h" | 10 #include "net/quic/core/crypto/quic_decrypter.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 const std::vector<QuicRstStreamFrame>& rst_stream_frames() const { | 119 const std::vector<QuicRstStreamFrame>& rst_stream_frames() const { |
120 return rst_stream_frames_; | 120 return rst_stream_frames_; |
121 } | 121 } |
122 const std::vector<std::unique_ptr<QuicStreamFrame>>& stream_frames() const { | 122 const std::vector<std::unique_ptr<QuicStreamFrame>>& stream_frames() const { |
123 return stream_frames_; | 123 return stream_frames_; |
124 } | 124 } |
125 const std::vector<QuicStopWaitingFrame>& stop_waiting_frames() const { | 125 const std::vector<QuicStopWaitingFrame>& stop_waiting_frames() const { |
126 return stop_waiting_frames_; | 126 return stop_waiting_frames_; |
127 } | 127 } |
128 const std::vector<QuicPingFrame>& ping_frames() const { return ping_frames_; } | 128 const std::vector<QuicPingFrame>& ping_frames() const { return ping_frames_; } |
| 129 const std::vector<QuicPaddingFrame>& padding_frames() const { |
| 130 return padding_frames_; |
| 131 } |
129 const QuicVersionNegotiationPacket* version_negotiation_packet() const { | 132 const QuicVersionNegotiationPacket* version_negotiation_packet() const { |
130 return version_negotiation_packet_.get(); | 133 return version_negotiation_packet_.get(); |
131 } | 134 } |
132 | 135 |
133 private: | 136 private: |
134 QuicErrorCode error_; | 137 QuicErrorCode error_; |
135 bool has_header_; | 138 bool has_header_; |
136 QuicPacketHeader header_; | 139 QuicPacketHeader header_; |
137 std::unique_ptr<QuicVersionNegotiationPacket> version_negotiation_packet_; | 140 std::unique_ptr<QuicVersionNegotiationPacket> version_negotiation_packet_; |
138 std::unique_ptr<QuicPublicResetPacket> public_reset_packet_; | 141 std::unique_ptr<QuicPublicResetPacket> public_reset_packet_; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } | 188 } |
186 | 189 |
187 QuicFramer* SimpleQuicFramer::framer() { | 190 QuicFramer* SimpleQuicFramer::framer() { |
188 return &framer_; | 191 return &framer_; |
189 } | 192 } |
190 | 193 |
191 size_t SimpleQuicFramer::num_frames() const { | 194 size_t SimpleQuicFramer::num_frames() const { |
192 return ack_frames().size() + goaway_frames().size() + | 195 return ack_frames().size() + goaway_frames().size() + |
193 rst_stream_frames().size() + stop_waiting_frames().size() + | 196 rst_stream_frames().size() + stop_waiting_frames().size() + |
194 stream_frames().size() + ping_frames().size() + | 197 stream_frames().size() + ping_frames().size() + |
195 connection_close_frames().size(); | 198 connection_close_frames().size() + padding_frames().size(); |
196 } | 199 } |
197 | 200 |
198 const std::vector<QuicAckFrame>& SimpleQuicFramer::ack_frames() const { | 201 const std::vector<QuicAckFrame>& SimpleQuicFramer::ack_frames() const { |
199 return visitor_->ack_frames(); | 202 return visitor_->ack_frames(); |
200 } | 203 } |
201 | 204 |
202 const std::vector<QuicStopWaitingFrame>& SimpleQuicFramer::stop_waiting_frames() | 205 const std::vector<QuicStopWaitingFrame>& SimpleQuicFramer::stop_waiting_frames() |
203 const { | 206 const { |
204 return visitor_->stop_waiting_frames(); | 207 return visitor_->stop_waiting_frames(); |
205 } | 208 } |
(...skipping 14 matching lines...) Expand all Loading... |
220 | 223 |
221 const std::vector<QuicGoAwayFrame>& SimpleQuicFramer::goaway_frames() const { | 224 const std::vector<QuicGoAwayFrame>& SimpleQuicFramer::goaway_frames() const { |
222 return visitor_->goaway_frames(); | 225 return visitor_->goaway_frames(); |
223 } | 226 } |
224 | 227 |
225 const std::vector<QuicConnectionCloseFrame>& | 228 const std::vector<QuicConnectionCloseFrame>& |
226 SimpleQuicFramer::connection_close_frames() const { | 229 SimpleQuicFramer::connection_close_frames() const { |
227 return visitor_->connection_close_frames(); | 230 return visitor_->connection_close_frames(); |
228 } | 231 } |
229 | 232 |
| 233 const std::vector<QuicPaddingFrame>& SimpleQuicFramer::padding_frames() const { |
| 234 return visitor_->padding_frames(); |
| 235 } |
| 236 |
230 } // namespace test | 237 } // namespace test |
231 } // namespace net | 238 } // namespace net |
OLD | NEW |