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 "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "net/quic/crypto/crypto_framer.h" | 8 #include "net/quic/crypto/crypto_framer.h" |
9 #include "net/quic/crypto/quic_decrypter.h" | 9 #include "net/quic/crypto/quic_decrypter.h" |
10 #include "net/quic/crypto/quic_encrypter.h" | 10 #include "net/quic/crypto/quic_encrypter.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 return false; | 34 return false; |
35 } | 35 } |
36 | 36 |
37 virtual void OnPacket() OVERRIDE {} | 37 virtual void OnPacket() OVERRIDE {} |
38 virtual void OnPublicResetPacket( | 38 virtual void OnPublicResetPacket( |
39 const QuicPublicResetPacket& packet) OVERRIDE {} | 39 const QuicPublicResetPacket& packet) OVERRIDE {} |
40 virtual void OnVersionNegotiationPacket( | 40 virtual void OnVersionNegotiationPacket( |
41 const QuicVersionNegotiationPacket& packet) OVERRIDE {} | 41 const QuicVersionNegotiationPacket& packet) OVERRIDE {} |
42 virtual void OnRevivedPacket() OVERRIDE {} | 42 virtual void OnRevivedPacket() OVERRIDE {} |
43 | 43 |
| 44 virtual bool OnUnauthenticatedPublicHeader( |
| 45 const QuicPacketPublicHeader& header) OVERRIDE { |
| 46 return true; |
| 47 } |
| 48 virtual bool OnUnauthenticatedHeader( |
| 49 const QuicPacketHeader& header) OVERRIDE { |
| 50 return true; |
| 51 } |
44 virtual bool OnPacketHeader(const QuicPacketHeader& header) OVERRIDE { | 52 virtual bool OnPacketHeader(const QuicPacketHeader& header) OVERRIDE { |
45 has_header_ = true; | 53 has_header_ = true; |
46 header_ = header; | 54 header_ = header; |
47 return true; | 55 return true; |
48 } | 56 } |
49 | 57 |
50 virtual bool OnUnauthenticatedHeader( | |
51 const QuicPacketHeader& header) OVERRIDE { | |
52 return true; | |
53 } | |
54 | |
55 virtual void OnFecProtectedPayload(StringPiece payload) OVERRIDE {} | 58 virtual void OnFecProtectedPayload(StringPiece payload) OVERRIDE {} |
56 | 59 |
57 virtual bool OnStreamFrame(const QuicStreamFrame& frame) OVERRIDE { | 60 virtual bool OnStreamFrame(const QuicStreamFrame& frame) OVERRIDE { |
58 // Save a copy of the data so it is valid after the packet is processed. | 61 // Save a copy of the data so it is valid after the packet is processed. |
59 stream_data_.push_back(frame.GetDataAsString()); | 62 stream_data_.push_back(frame.GetDataAsString()); |
60 QuicStreamFrame stream_frame(frame); | 63 QuicStreamFrame stream_frame(frame); |
61 // Make sure that the stream frame points to this data. | 64 // Make sure that the stream frame points to this data. |
62 stream_frame.data.Clear(); | 65 stream_frame.data.Clear(); |
63 stream_frame.data.Append(const_cast<char*>(stream_data_.back()->data()), | 66 stream_frame.data.Append(const_cast<char*>(stream_data_.back()->data()), |
64 stream_data_.back()->size()); | 67 stream_data_.back()->size()); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 return visitor_->goaway_frames(); | 208 return visitor_->goaway_frames(); |
206 } | 209 } |
207 | 210 |
208 const vector<QuicConnectionCloseFrame>& | 211 const vector<QuicConnectionCloseFrame>& |
209 SimpleQuicFramer::connection_close_frames() const { | 212 SimpleQuicFramer::connection_close_frames() const { |
210 return visitor_->connection_close_frames(); | 213 return visitor_->connection_close_frames(); |
211 } | 214 } |
212 | 215 |
213 } // namespace test | 216 } // namespace test |
214 } // namespace net | 217 } // namespace net |
OLD | NEW |