| 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 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_ | 5 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_ |
| 6 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_ | 6 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_ |
| 7 | 7 |
| 8 #include <cstdint> | 8 #include <cstdint> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 ~MockableQuicClient() override; | 50 ~MockableQuicClient() override; |
| 51 | 51 |
| 52 void ProcessPacket(const QuicSocketAddress& self_address, | 52 void ProcessPacket(const QuicSocketAddress& self_address, |
| 53 const QuicSocketAddress& peer_address, | 53 const QuicSocketAddress& peer_address, |
| 54 const QuicReceivedPacket& packet) override; | 54 const QuicReceivedPacket& packet) override; |
| 55 | 55 |
| 56 QuicPacketWriter* CreateQuicPacketWriter() override; | 56 QuicPacketWriter* CreateQuicPacketWriter() override; |
| 57 QuicConnectionId GenerateNewConnectionId() override; | 57 QuicConnectionId GenerateNewConnectionId() override; |
| 58 void UseWriter(QuicPacketWriterWrapper* writer); | 58 void UseWriter(QuicPacketWriterWrapper* writer); |
| 59 void UseConnectionId(QuicConnectionId connection_id); | 59 void UseConnectionId(QuicConnectionId connection_id); |
| 60 void SendCachedNetworkParamaters( | |
| 61 const CachedNetworkParameters& cached_network_params) { | |
| 62 cached_network_paramaters_ = cached_network_params; | |
| 63 } | |
| 64 const QuicReceivedPacket* last_incoming_packet() { | 60 const QuicReceivedPacket* last_incoming_packet() { |
| 65 return last_incoming_packet_.get(); | 61 return last_incoming_packet_.get(); |
| 66 } | 62 } |
| 67 void set_track_last_incoming_packet(bool track) { | 63 void set_track_last_incoming_packet(bool track) { |
| 68 track_last_incoming_packet_ = track; | 64 track_last_incoming_packet_ = track; |
| 69 } | 65 } |
| 70 | 66 |
| 71 private: | 67 private: |
| 72 QuicConnectionId override_connection_id_; // ConnectionId to use, if nonzero | 68 QuicConnectionId override_connection_id_; // ConnectionId to use, if nonzero |
| 73 QuicPacketWriterWrapper* test_writer_; | 69 QuicPacketWriterWrapper* test_writer_; |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 void set_priority(SpdyPriority priority) { priority_ = priority; } | 232 void set_priority(SpdyPriority priority) { priority_ = priority; } |
| 237 | 233 |
| 238 void WaitForWriteToFlush(); | 234 void WaitForWriteToFlush(); |
| 239 | 235 |
| 240 EpollServer* epoll_server() { return &epoll_server_; } | 236 EpollServer* epoll_server() { return &epoll_server_; } |
| 241 | 237 |
| 242 void set_allow_bidirectional_data(bool value) { | 238 void set_allow_bidirectional_data(bool value) { |
| 243 allow_bidirectional_data_ = value; | 239 allow_bidirectional_data_ = value; |
| 244 } | 240 } |
| 245 | 241 |
| 246 bool allow_bidirectional_data() const { return allow_bidirectional_data_; } | |
| 247 | |
| 248 size_t num_requests() const { return num_requests_; } | 242 size_t num_requests() const { return num_requests_; } |
| 249 | 243 |
| 250 size_t num_responses() const { return num_responses_; } | 244 size_t num_responses() const { return num_responses_; } |
| 251 | 245 |
| 252 void set_server_address(const QuicSocketAddress& server_address) { | 246 void set_server_address(const QuicSocketAddress& server_address) { |
| 253 client_->set_server_address(server_address); | 247 client_->set_server_address(server_address); |
| 254 } | 248 } |
| 255 | 249 |
| 256 // Explicitly set the SNI value for this client, overriding the default | 250 // Explicitly set the SNI value for this client, overriding the default |
| 257 // behavior which extracts the SNI value from the request URL. | 251 // behavior which extracts the SNI value from the request URL. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 std::string override_sni_; | 334 std::string override_sni_; |
| 341 | 335 |
| 342 DISALLOW_COPY_AND_ASSIGN(QuicTestClient); | 336 DISALLOW_COPY_AND_ASSIGN(QuicTestClient); |
| 343 }; | 337 }; |
| 344 | 338 |
| 345 } // namespace test | 339 } // namespace test |
| 346 | 340 |
| 347 } // namespace net | 341 } // namespace net |
| 348 | 342 |
| 349 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_ | 343 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_ |
| OLD | NEW |