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 "net/quic/crypto/crypto_framer.h" | 7 #include "net/quic/crypto/crypto_framer.h" |
8 #include "net/quic/crypto/quic_decrypter.h" | 8 #include "net/quic/crypto/quic_decrypter.h" |
9 #include "net/quic/crypto/quic_encrypter.h" | 9 #include "net/quic/crypto/quic_encrypter.h" |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 virtual void OnRevivedPacket() OVERRIDE {} | 37 virtual void OnRevivedPacket() OVERRIDE {} |
38 | 38 |
39 virtual bool OnPacketHeader(const QuicPacketHeader& header) OVERRIDE { | 39 virtual bool OnPacketHeader(const QuicPacketHeader& header) OVERRIDE { |
40 has_header_ = true; | 40 has_header_ = true; |
41 header_ = header; | 41 header_ = header; |
42 return true; | 42 return true; |
43 } | 43 } |
44 | 44 |
45 virtual void OnFecProtectedPayload(StringPiece payload) OVERRIDE {} | 45 virtual void OnFecProtectedPayload(StringPiece payload) OVERRIDE {} |
46 | 46 |
47 virtual void OnStreamFrame(const QuicStreamFrame& frame) OVERRIDE { | 47 virtual bool OnStreamFrame(const QuicStreamFrame& frame) OVERRIDE { |
48 // Save a copy of the data so it is valid after the packet is processed. | 48 // Save a copy of the data so it is valid after the packet is processed. |
49 stream_data_.push_back(frame.data.as_string()); | 49 stream_data_.push_back(frame.data.as_string()); |
50 QuicStreamFrame stream_frame(frame); | 50 QuicStreamFrame stream_frame(frame); |
51 // Make sure that the stream frame points to this data. | 51 // Make sure that the stream frame points to this data. |
52 stream_frame.data = stream_data_.back(); | 52 stream_frame.data = stream_data_.back(); |
53 stream_frames_.push_back(stream_frame); | 53 stream_frames_.push_back(stream_frame); |
| 54 return true; |
54 } | 55 } |
55 | 56 |
56 virtual void OnAckFrame(const QuicAckFrame& frame) OVERRIDE { | 57 virtual bool OnAckFrame(const QuicAckFrame& frame) OVERRIDE { |
57 ack_frames_.push_back(frame); | 58 ack_frames_.push_back(frame); |
| 59 return true; |
58 } | 60 } |
59 | 61 |
60 virtual void OnCongestionFeedbackFrame( | 62 virtual bool OnCongestionFeedbackFrame( |
61 const QuicCongestionFeedbackFrame& frame) OVERRIDE { | 63 const QuicCongestionFeedbackFrame& frame) OVERRIDE { |
62 feedback_frames_.push_back(frame); | 64 feedback_frames_.push_back(frame); |
| 65 return true; |
63 } | 66 } |
64 | 67 |
65 virtual void OnFecData(const QuicFecData& fec) OVERRIDE { | 68 virtual void OnFecData(const QuicFecData& fec) OVERRIDE { |
66 fec_data_ = fec; | 69 fec_data_ = fec; |
67 fec_redundancy_ = fec_data_.redundancy.as_string(); | 70 fec_redundancy_ = fec_data_.redundancy.as_string(); |
68 fec_data_.redundancy = fec_redundancy_; | 71 fec_data_.redundancy = fec_redundancy_; |
69 } | 72 } |
70 | 73 |
71 virtual void OnRstStreamFrame(const QuicRstStreamFrame& frame) OVERRIDE { | 74 virtual bool OnRstStreamFrame(const QuicRstStreamFrame& frame) OVERRIDE { |
72 rst_stream_frames_.push_back(frame); | 75 rst_stream_frames_.push_back(frame); |
| 76 return true; |
73 } | 77 } |
74 | 78 |
75 virtual void OnConnectionCloseFrame( | 79 virtual bool OnConnectionCloseFrame( |
76 const QuicConnectionCloseFrame& frame) OVERRIDE { | 80 const QuicConnectionCloseFrame& frame) OVERRIDE { |
77 connection_close_frames_.push_back(frame); | 81 connection_close_frames_.push_back(frame); |
| 82 return true; |
78 } | 83 } |
79 | 84 |
80 virtual void OnGoAwayFrame(const QuicGoAwayFrame& frame) OVERRIDE { | 85 virtual bool OnGoAwayFrame(const QuicGoAwayFrame& frame) OVERRIDE { |
81 goaway_frames_.push_back(frame); | 86 goaway_frames_.push_back(frame); |
| 87 return true; |
82 } | 88 } |
83 | 89 |
84 virtual void OnPacketComplete() OVERRIDE {} | 90 virtual void OnPacketComplete() OVERRIDE {} |
85 | 91 |
86 const QuicPacketHeader& header() const { return header_; } | 92 const QuicPacketHeader& header() const { return header_; } |
87 const vector<QuicAckFrame>& ack_frames() const { return ack_frames_; } | 93 const vector<QuicAckFrame>& ack_frames() const { return ack_frames_; } |
88 const vector<QuicConnectionCloseFrame>& connection_close_frames() const { | 94 const vector<QuicConnectionCloseFrame>& connection_close_frames() const { |
89 return connection_close_frames_; | 95 return connection_close_frames_; |
90 } | 96 } |
91 const vector<QuicCongestionFeedbackFrame>& feedback_frames() const { | 97 const vector<QuicCongestionFeedbackFrame>& feedback_frames() const { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 return visitor_->goaway_frames(); | 189 return visitor_->goaway_frames(); |
184 } | 190 } |
185 | 191 |
186 const vector<QuicConnectionCloseFrame>& | 192 const vector<QuicConnectionCloseFrame>& |
187 SimpleQuicFramer::connection_close_frames() const { | 193 SimpleQuicFramer::connection_close_frames() const { |
188 return visitor_->connection_close_frames(); | 194 return visitor_->connection_close_frames(); |
189 } | 195 } |
190 | 196 |
191 } // namespace test | 197 } // namespace test |
192 } // namespace net | 198 } // namespace net |
OLD | NEW |