| 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" |
| 11 | 11 |
| 12 using base::StringPiece; | 12 using base::StringPiece; |
| 13 using std::string; | 13 using std::string; |
| 14 using std::vector; | 14 using std::vector; |
| 15 | 15 |
| 16 namespace net { | 16 namespace net { |
| 17 namespace test { | 17 namespace test { |
| 18 | 18 |
| 19 class SimpleFramerVisitor : public QuicFramerVisitorInterface { | 19 class SimpleFramerVisitor : public QuicFramerVisitorInterface { |
| 20 public: | 20 public: |
| 21 SimpleFramerVisitor() | 21 SimpleFramerVisitor() |
| 22 : error_(QUIC_NO_ERROR) { | 22 : error_(QUIC_NO_ERROR) { |
| 23 } | 23 } |
| 24 | 24 |
| 25 virtual ~SimpleFramerVisitor() { | 25 virtual ~SimpleFramerVisitor() OVERRIDE { |
| 26 STLDeleteElements(&stream_data_); | 26 STLDeleteElements(&stream_data_); |
| 27 } | 27 } |
| 28 | 28 |
| 29 virtual void OnError(QuicFramer* framer) OVERRIDE { | 29 virtual void OnError(QuicFramer* framer) OVERRIDE { |
| 30 error_ = framer->error(); | 30 error_ = framer->error(); |
| 31 } | 31 } |
| 32 | 32 |
| 33 virtual bool OnProtocolVersionMismatch(QuicVersion version) OVERRIDE { | 33 virtual bool OnProtocolVersionMismatch(QuicVersion version) OVERRIDE { |
| 34 return false; | 34 return false; |
| 35 } | 35 } |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 return visitor_->goaway_frames(); | 208 return visitor_->goaway_frames(); |
| 209 } | 209 } |
| 210 | 210 |
| 211 const vector<QuicConnectionCloseFrame>& | 211 const vector<QuicConnectionCloseFrame>& |
| 212 SimpleQuicFramer::connection_close_frames() const { | 212 SimpleQuicFramer::connection_close_frames() const { |
| 213 return visitor_->connection_close_frames(); | 213 return visitor_->connection_close_frames(); |
| 214 } | 214 } |
| 215 | 215 |
| 216 } // namespace test | 216 } // namespace test |
| 217 } // namespace net | 217 } // namespace net |
| OLD | NEW |