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_protocol.h" | 5 #include "net/quic/quic_protocol.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "net/quic/quic_flags.h" | 8 #include "net/quic/quic_flags.h" |
9 #include "net/quic/quic_utils.h" | 9 #include "net/quic/quic_utils.h" |
10 | 10 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 offset(offset), | 151 offset(offset), |
152 buffer(std::move(buffer)) { | 152 buffer(std::move(buffer)) { |
153 if (this->buffer != nullptr) { | 153 if (this->buffer != nullptr) { |
154 DCHECK(frame_buffer == nullptr); | 154 DCHECK(frame_buffer == nullptr); |
155 this->frame_buffer = this->buffer.get(); | 155 this->frame_buffer = this->buffer.get(); |
156 } | 156 } |
157 } | 157 } |
158 | 158 |
159 QuicStreamFrame::~QuicStreamFrame() {} | 159 QuicStreamFrame::~QuicStreamFrame() {} |
160 | 160 |
161 uint32 MakeQuicTag(char a, char b, char c, char d) { | 161 uint32_t MakeQuicTag(char a, char b, char c, char d) { |
162 return static_cast<uint32>(a) | static_cast<uint32>(b) << 8 | | 162 return static_cast<uint32_t>(a) | static_cast<uint32_t>(b) << 8 | |
163 static_cast<uint32>(c) << 16 | static_cast<uint32>(d) << 24; | 163 static_cast<uint32_t>(c) << 16 | static_cast<uint32_t>(d) << 24; |
164 } | 164 } |
165 | 165 |
166 bool ContainsQuicTag(const QuicTagVector& tag_vector, QuicTag tag) { | 166 bool ContainsQuicTag(const QuicTagVector& tag_vector, QuicTag tag) { |
167 return std::find(tag_vector.begin(), tag_vector.end(), tag) != | 167 return std::find(tag_vector.begin(), tag_vector.end(), tag) != |
168 tag_vector.end(); | 168 tag_vector.end(); |
169 } | 169 } |
170 | 170 |
171 QuicVersionVector QuicSupportedVersions() { | 171 QuicVersionVector QuicSupportedVersions() { |
172 QuicVersionVector supported_versions; | 172 QuicVersionVector supported_versions; |
173 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) { | 173 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 return error_code; | 296 return error_code; |
297 } | 297 } |
298 | 298 |
299 QuicRstStreamFrame::QuicRstStreamFrame() | 299 QuicRstStreamFrame::QuicRstStreamFrame() |
300 : stream_id(0), error_code(QUIC_STREAM_NO_ERROR), byte_offset(0) {} | 300 : stream_id(0), error_code(QUIC_STREAM_NO_ERROR), byte_offset(0) {} |
301 | 301 |
302 QuicRstStreamFrame::QuicRstStreamFrame(QuicStreamId stream_id, | 302 QuicRstStreamFrame::QuicRstStreamFrame(QuicStreamId stream_id, |
303 QuicRstStreamErrorCode error_code, | 303 QuicRstStreamErrorCode error_code, |
304 QuicStreamOffset bytes_written) | 304 QuicStreamOffset bytes_written) |
305 : stream_id(stream_id), error_code(error_code), byte_offset(bytes_written) { | 305 : stream_id(stream_id), error_code(error_code), byte_offset(bytes_written) { |
306 DCHECK_LE(error_code, numeric_limits<uint8>::max()); | 306 DCHECK_LE(error_code, numeric_limits<uint8_t>::max()); |
307 } | 307 } |
308 | 308 |
309 QuicConnectionCloseFrame::QuicConnectionCloseFrame() | 309 QuicConnectionCloseFrame::QuicConnectionCloseFrame() |
310 : error_code(QUIC_NO_ERROR) {} | 310 : error_code(QUIC_NO_ERROR) {} |
311 | 311 |
312 QuicFrame::QuicFrame() {} | 312 QuicFrame::QuicFrame() {} |
313 | 313 |
314 QuicFrame::QuicFrame(QuicPaddingFrame padding_frame) | 314 QuicFrame::QuicFrame(QuicPaddingFrame padding_frame) |
315 : type(PADDING_FRAME), padding_frame(padding_frame) {} | 315 : type(PADDING_FRAME), padding_frame(padding_frame) {} |
316 | 316 |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 | 625 |
626 QuicGoAwayFrame::QuicGoAwayFrame() | 626 QuicGoAwayFrame::QuicGoAwayFrame() |
627 : error_code(QUIC_NO_ERROR), last_good_stream_id(0) {} | 627 : error_code(QUIC_NO_ERROR), last_good_stream_id(0) {} |
628 | 628 |
629 QuicGoAwayFrame::QuicGoAwayFrame(QuicErrorCode error_code, | 629 QuicGoAwayFrame::QuicGoAwayFrame(QuicErrorCode error_code, |
630 QuicStreamId last_good_stream_id, | 630 QuicStreamId last_good_stream_id, |
631 const string& reason) | 631 const string& reason) |
632 : error_code(error_code), | 632 : error_code(error_code), |
633 last_good_stream_id(last_good_stream_id), | 633 last_good_stream_id(last_good_stream_id), |
634 reason_phrase(reason) { | 634 reason_phrase(reason) { |
635 DCHECK_LE(error_code, numeric_limits<uint8>::max()); | 635 DCHECK_LE(error_code, numeric_limits<uint8_t>::max()); |
636 } | 636 } |
637 | 637 |
638 QuicData::QuicData(const char* buffer, size_t length) | 638 QuicData::QuicData(const char* buffer, size_t length) |
639 : buffer_(buffer), length_(length), owns_buffer_(false) {} | 639 : buffer_(buffer), length_(length), owns_buffer_(false) {} |
640 | 640 |
641 QuicData::QuicData(char* buffer, size_t length, bool owns_buffer) | 641 QuicData::QuicData(char* buffer, size_t length, bool owns_buffer) |
642 : buffer_(buffer), length_(length), owns_buffer_(owns_buffer) {} | 642 : buffer_(buffer), length_(length), owns_buffer_(owns_buffer) {} |
643 | 643 |
644 QuicData::~QuicData() { | 644 QuicData::~QuicData() { |
645 if (owns_buffer_) { | 645 if (owns_buffer_) { |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 transmission_type(transmission_type), | 854 transmission_type(transmission_type), |
855 in_flight(false), | 855 in_flight(false), |
856 is_unackable(false), | 856 is_unackable(false), |
857 is_fec_packet(is_fec_packet), | 857 is_fec_packet(is_fec_packet), |
858 all_transmissions(nullptr), | 858 all_transmissions(nullptr), |
859 retransmission(0) {} | 859 retransmission(0) {} |
860 | 860 |
861 TransmissionInfo::~TransmissionInfo() {} | 861 TransmissionInfo::~TransmissionInfo() {} |
862 | 862 |
863 } // namespace net | 863 } // namespace net |
OLD | NEW |