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/core/quic_protocol.h" | 5 #include "net/quic/core/quic_protocol.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "net/quic/core/quic_flags.h" | 9 #include "net/quic/core/quic_flags.h" |
10 #include "net/quic/core/quic_utils.h" | 10 #include "net/quic/core/quic_utils.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 offset(offset), | 139 offset(offset), |
140 buffer(std::move(buffer)) { | 140 buffer(std::move(buffer)) { |
141 if (this->buffer != nullptr) { | 141 if (this->buffer != nullptr) { |
142 DCHECK(data_buffer == nullptr); | 142 DCHECK(data_buffer == nullptr); |
143 this->data_buffer = this->buffer.get(); | 143 this->data_buffer = this->buffer.get(); |
144 } | 144 } |
145 } | 145 } |
146 | 146 |
147 QuicStreamFrame::~QuicStreamFrame() {} | 147 QuicStreamFrame::~QuicStreamFrame() {} |
148 | 148 |
149 uint32_t MakeQuicTag(char a, char b, char c, char d) { | |
150 return static_cast<uint32_t>(a) | static_cast<uint32_t>(b) << 8 | | |
151 static_cast<uint32_t>(c) << 16 | static_cast<uint32_t>(d) << 24; | |
152 } | |
153 | |
154 bool ContainsQuicTag(const QuicTagVector& tag_vector, QuicTag tag) { | |
155 return std::find(tag_vector.begin(), tag_vector.end(), tag) != | |
156 tag_vector.end(); | |
157 } | |
158 | |
159 ostream& operator<<(ostream& os, const QuicPacketHeader& header) { | 149 ostream& operator<<(ostream& os, const QuicPacketHeader& header) { |
160 os << "{ connection_id: " << header.public_header.connection_id | 150 os << "{ connection_id: " << header.public_header.connection_id |
161 << ", connection_id_length: " << header.public_header.connection_id_length | 151 << ", connection_id_length: " << header.public_header.connection_id_length |
162 << ", packet_number_length: " << header.public_header.packet_number_length | 152 << ", packet_number_length: " << header.public_header.packet_number_length |
163 << ", multipath_flag: " << header.public_header.multipath_flag | 153 << ", multipath_flag: " << header.public_header.multipath_flag |
164 << ", reset_flag: " << header.public_header.reset_flag | 154 << ", reset_flag: " << header.public_header.reset_flag |
165 << ", version_flag: " << header.public_header.version_flag; | 155 << ", version_flag: " << header.public_header.version_flag; |
166 if (header.public_header.version_flag) { | 156 if (header.public_header.version_flag) { |
167 os << ", version:"; | 157 os << ", version:"; |
168 for (size_t i = 0; i < header.public_header.versions.size(); ++i) { | 158 for (size_t i = 0; i < header.public_header.versions.size(); ++i) { |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 is_unackable(false), | 693 is_unackable(false), |
704 has_crypto_handshake(has_crypto_handshake), | 694 has_crypto_handshake(has_crypto_handshake), |
705 num_padding_bytes(num_padding_bytes), | 695 num_padding_bytes(num_padding_bytes), |
706 retransmission(0) {} | 696 retransmission(0) {} |
707 | 697 |
708 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default; | 698 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default; |
709 | 699 |
710 TransmissionInfo::~TransmissionInfo() {} | 700 TransmissionInfo::~TransmissionInfo() {} |
711 | 701 |
712 } // namespace net | 702 } // namespace net |
OLD | NEW |