| 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/quic_connection.h" | 5 #include "net/quic/quic_connection.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <ostream> | 9 #include <ostream> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 916 bool entropy_flag, | 916 bool entropy_flag, |
| 917 bool has_stop_waiting) { | 917 bool has_stop_waiting) { |
| 918 QuicPacketHeader header; | 918 QuicPacketHeader header; |
| 919 header.public_header.connection_id = connection_id_; | 919 header.public_header.connection_id = connection_id_; |
| 920 header.public_header.packet_number_length = packet_number_length_; | 920 header.public_header.packet_number_length = packet_number_length_; |
| 921 header.public_header.connection_id_length = connection_id_length_; | 921 header.public_header.connection_id_length = connection_id_length_; |
| 922 header.public_header.multipath_flag = path_id != kDefaultPathId; | 922 header.public_header.multipath_flag = path_id != kDefaultPathId; |
| 923 header.entropy_flag = entropy_flag; | 923 header.entropy_flag = entropy_flag; |
| 924 header.path_id = path_id; | 924 header.path_id = path_id; |
| 925 header.packet_number = number; | 925 header.packet_number = number; |
| 926 header.is_in_fec_group = NOT_IN_FEC_GROUP; | |
| 927 header.fec_group = 0; | |
| 928 | 926 |
| 929 QuicFrames frames; | 927 QuicFrames frames; |
| 930 frames.push_back(QuicFrame(&frame1_)); | 928 frames.push_back(QuicFrame(&frame1_)); |
| 931 if (has_stop_waiting) { | 929 if (has_stop_waiting) { |
| 932 frames.push_back(QuicFrame(&stop_waiting_)); | 930 frames.push_back(QuicFrame(&stop_waiting_)); |
| 933 } | 931 } |
| 934 return ConstructPacket(header, frames); | 932 return ConstructPacket(header, frames); |
| 935 } | 933 } |
| 936 | 934 |
| 937 QuicPacket* ConstructClosePacket(QuicPacketNumber number) { | 935 QuicPacket* ConstructClosePacket(QuicPacketNumber number) { |
| 938 QuicPacketHeader header; | 936 QuicPacketHeader header; |
| 939 header.public_header.connection_id = connection_id_; | 937 header.public_header.connection_id = connection_id_; |
| 940 header.packet_number = number; | 938 header.packet_number = number; |
| 941 header.is_in_fec_group = NOT_IN_FEC_GROUP; | |
| 942 header.fec_group = 0; | |
| 943 | 939 |
| 944 QuicConnectionCloseFrame qccf; | 940 QuicConnectionCloseFrame qccf; |
| 945 qccf.error_code = QUIC_PEER_GOING_AWAY; | 941 qccf.error_code = QUIC_PEER_GOING_AWAY; |
| 946 | 942 |
| 947 QuicFrames frames; | 943 QuicFrames frames; |
| 948 frames.push_back(QuicFrame(&qccf)); | 944 frames.push_back(QuicFrame(&qccf)); |
| 949 return ConstructPacket(header, frames); | 945 return ConstructPacket(header, frames); |
| 950 } | 946 } |
| 951 | 947 |
| 952 QuicTime::Delta DefaultRetransmissionTime() { | 948 QuicTime::Delta DefaultRetransmissionTime() { |
| (...skipping 4053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5006 frame1_.data_length = data->length(); | 5002 frame1_.data_length = data->length(); |
| 5007 | 5003 |
| 5008 EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_MAYBE_CORRUPTED_MEMORY, _, | 5004 EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_MAYBE_CORRUPTED_MEMORY, _, |
| 5009 ConnectionCloseSource::FROM_SELF)); | 5005 ConnectionCloseSource::FROM_SELF)); |
| 5010 ProcessFramePacket(QuicFrame(&frame1_)); | 5006 ProcessFramePacket(QuicFrame(&frame1_)); |
| 5011 } | 5007 } |
| 5012 | 5008 |
| 5013 } // namespace | 5009 } // namespace |
| 5014 } // namespace test | 5010 } // namespace test |
| 5015 } // namespace net | 5011 } // namespace net |
| OLD | NEW |