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 // Common utilities for Quic tests | 5 // Common utilities for Quic tests |
6 | 6 |
7 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 7 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
8 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 8 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 162 |
163 // Creates per-connection packet writers that register themselves with the | 163 // Creates per-connection packet writers that register themselves with the |
164 // TestWriterFactory on each write so that TestWriterFactory::OnPacketSent can | 164 // TestWriterFactory on each write so that TestWriterFactory::OnPacketSent can |
165 // be routed to the appropriate QuicConnection. | 165 // be routed to the appropriate QuicConnection. |
166 class TestWriterFactory : public QuicDispatcher::PacketWriterFactory { | 166 class TestWriterFactory : public QuicDispatcher::PacketWriterFactory { |
167 public: | 167 public: |
168 TestWriterFactory(); | 168 TestWriterFactory(); |
169 virtual ~TestWriterFactory(); | 169 virtual ~TestWriterFactory(); |
170 | 170 |
171 virtual QuicPacketWriter* Create(QuicPacketWriter* writer, | 171 virtual QuicPacketWriter* Create(QuicPacketWriter* writer, |
172 QuicConnection* connection) override; | 172 QuicConnection* connection) OVERRIDE; |
173 | 173 |
174 // Calls OnPacketSent on the last QuicConnection to write through one of the | 174 // Calls OnPacketSent on the last QuicConnection to write through one of the |
175 // packet writers created by this factory. | 175 // packet writers created by this factory. |
176 void OnPacketSent(WriteResult result); | 176 void OnPacketSent(WriteResult result); |
177 | 177 |
178 private: | 178 private: |
179 class PerConnectionPacketWriter : public QuicPerConnectionPacketWriter { | 179 class PerConnectionPacketWriter : public QuicPerConnectionPacketWriter { |
180 public: | 180 public: |
181 PerConnectionPacketWriter(TestWriterFactory* factory, | 181 PerConnectionPacketWriter(TestWriterFactory* factory, |
182 QuicPacketWriter* writer, | 182 QuicPacketWriter* writer, |
(...skipping 15 matching lines...) Expand all Loading... |
198 void Unregister(PerConnectionPacketWriter* writer); | 198 void Unregister(PerConnectionPacketWriter* writer); |
199 | 199 |
200 PerConnectionPacketWriter* current_writer_; | 200 PerConnectionPacketWriter* current_writer_; |
201 }; | 201 }; |
202 | 202 |
203 } // namespace test | 203 } // namespace test |
204 } // namespace tools | 204 } // namespace tools |
205 } // namespace net | 205 } // namespace net |
206 | 206 |
207 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 207 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
OLD | NEW |