| OLD | NEW |
| (Empty) |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_WRITER_H_ | |
| 6 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_WRITER_H_ | |
| 7 | |
| 8 #include "base/memory/scoped_ptr.h" | |
| 9 #include "net/quic/quic_packet_writer.h" | |
| 10 | |
| 11 namespace net { | |
| 12 namespace test { | |
| 13 | |
| 14 // Allows setting a writer for a QuicConnection, to allow | |
| 15 // fine-grained control of writes. | |
| 16 class QuicTestWriter : public QuicPacketWriter { | |
| 17 public: | |
| 18 QuicTestWriter(); | |
| 19 virtual ~QuicTestWriter(); | |
| 20 | |
| 21 virtual bool IsWriteBlocked() const OVERRIDE; | |
| 22 virtual void SetWritable() OVERRIDE; | |
| 23 | |
| 24 // Takes ownership of |writer|. | |
| 25 void set_writer(QuicPacketWriter* writer); | |
| 26 | |
| 27 protected: | |
| 28 QuicPacketWriter* writer(); | |
| 29 | |
| 30 private: | |
| 31 scoped_ptr<QuicPacketWriter> writer_; | |
| 32 }; | |
| 33 | |
| 34 } // namespace test | |
| 35 } // namespace net | |
| 36 | |
| 37 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_WRITER_H_ | |
| OLD | NEW |