| 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 "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 11 #include "net/quic/core/crypto/quic_decrypter.h" | 11 #include "net/quic/core/crypto/quic_decrypter.h" |
| 12 #include "net/quic/core/crypto/quic_encrypter.h" | 12 #include "net/quic/core/crypto/quic_encrypter.h" |
| 13 | 13 |
| 14 using base::StringPiece; | 14 using base::StringPiece; |
| 15 using std::string; | 15 using std::string; |
| 16 using std::vector; | 16 using std::vector; |
| 17 | 17 |
| 18 namespace net { | 18 namespace net { |
| 19 namespace test { | 19 namespace test { |
| 20 | 20 |
| 21 class SimpleFramerVisitor : public QuicFramerVisitorInterface { | 21 class SimpleFramerVisitor : public QuicFramerVisitorInterface { |
| 22 public: | 22 public: |
| 23 SimpleFramerVisitor() : error_(QUIC_NO_ERROR) {} | 23 SimpleFramerVisitor() : error_(QUIC_NO_ERROR) {} |
| 24 | 24 |
| 25 ~SimpleFramerVisitor() override { | 25 ~SimpleFramerVisitor() override { |
| 26 STLDeleteElements(&stream_frames_); | 26 base::STLDeleteElements(&stream_frames_); |
| 27 STLDeleteElements(&stream_data_); | 27 base::STLDeleteElements(&stream_data_); |
| 28 } | 28 } |
| 29 | 29 |
| 30 void OnError(QuicFramer* framer) override { error_ = framer->error(); } | 30 void OnError(QuicFramer* framer) override { error_ = framer->error(); } |
| 31 | 31 |
| 32 bool OnProtocolVersionMismatch(QuicVersion version) override { return false; } | 32 bool OnProtocolVersionMismatch(QuicVersion version) override { return false; } |
| 33 | 33 |
| 34 void OnPacket() override {} | 34 void OnPacket() override {} |
| 35 void OnPublicResetPacket(const QuicPublicResetPacket& packet) override { | 35 void OnPublicResetPacket(const QuicPublicResetPacket& packet) override { |
| 36 public_reset_packet_.reset(new QuicPublicResetPacket(packet)); | 36 public_reset_packet_.reset(new QuicPublicResetPacket(packet)); |
| 37 } | 37 } |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 return visitor_->goaway_frames(); | 231 return visitor_->goaway_frames(); |
| 232 } | 232 } |
| 233 | 233 |
| 234 const vector<QuicConnectionCloseFrame>& | 234 const vector<QuicConnectionCloseFrame>& |
| 235 SimpleQuicFramer::connection_close_frames() const { | 235 SimpleQuicFramer::connection_close_frames() const { |
| 236 return visitor_->connection_close_frames(); | 236 return visitor_->connection_close_frames(); |
| 237 } | 237 } |
| 238 | 238 |
| 239 } // namespace test | 239 } // namespace test |
| 240 } // namespace net | 240 } // namespace net |
| OLD | NEW |