| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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/chromium/quic_test_packet_maker.h" | 5 #include "net/quic/chromium/quic_test_packet_maker.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "net/quic/chromium/quic_http_utils.h" | 11 #include "net/quic/chromium/quic_http_utils.h" |
| 12 #include "net/quic/core/quic_framer.h" | 12 #include "net/quic/core/quic_framer.h" |
| 13 #include "net/quic/core/quic_utils.h" | 13 #include "net/quic/core/quic_utils.h" |
| 14 #include "net/quic/test_tools/quic_test_utils.h" | 14 #include "net/quic/test_tools/quic_test_utils.h" |
| 15 | 15 |
| 16 namespace net { | 16 namespace net { |
| 17 namespace test { | 17 namespace test { |
| 18 | 18 |
| 19 QuicTestPacketMaker::QuicTestPacketMaker(QuicVersion version, | 19 QuicTestPacketMaker::QuicTestPacketMaker(QuicVersion version, |
| 20 QuicConnectionId connection_id, | 20 QuicConnectionId connection_id, |
| 21 MockClock* clock, | 21 MockClock* clock, |
| 22 const std::string& host, | 22 const std::string& host, |
| 23 Perspective perspective) | 23 Perspective perspective) |
| 24 : version_(version), | 24 : version_(version), |
| 25 connection_id_(connection_id), | 25 connection_id_(connection_id), |
| 26 clock_(clock), | 26 clock_(clock), |
| 27 host_(host), | 27 host_(host), |
| 28 spdy_request_framer_(SpdyFramer::ENABLE_COMPRESSION), |
| 29 spdy_response_framer_(SpdyFramer::ENABLE_COMPRESSION), |
| 28 perspective_(perspective) {} | 30 perspective_(perspective) {} |
| 29 | 31 |
| 30 QuicTestPacketMaker::~QuicTestPacketMaker() {} | 32 QuicTestPacketMaker::~QuicTestPacketMaker() {} |
| 31 | 33 |
| 32 void QuicTestPacketMaker::set_hostname(const std::string& host) { | 34 void QuicTestPacketMaker::set_hostname(const std::string& host) { |
| 33 host_.assign(host); | 35 host_.assign(host); |
| 34 } | 36 } |
| 35 | 37 |
| 36 std::unique_ptr<QuicReceivedPacket> QuicTestPacketMaker::MakePingPacket( | 38 std::unique_ptr<QuicReceivedPacket> QuicTestPacketMaker::MakePingPacket( |
| 37 QuicPacketNumber num, | 39 QuicPacketNumber num, |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 *offset += spdy_frame.size(); | 652 *offset += spdy_frame.size(); |
| 651 return MakePacket(header_, QuicFrame(&quic_frame)); | 653 return MakePacket(header_, QuicFrame(&quic_frame)); |
| 652 } | 654 } |
| 653 QuicStreamFrame quic_frame(kHeadersStreamId, false, 0, | 655 QuicStreamFrame quic_frame(kHeadersStreamId, false, 0, |
| 654 StringPiece(spdy_frame.data(), spdy_frame.size())); | 656 StringPiece(spdy_frame.data(), spdy_frame.size())); |
| 655 return MakePacket(header_, QuicFrame(&quic_frame)); | 657 return MakePacket(header_, QuicFrame(&quic_frame)); |
| 656 } | 658 } |
| 657 | 659 |
| 658 } // namespace test | 660 } // namespace test |
| 659 } // namespace net | 661 } // namespace net |
| OLD | NEW |