Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: net/quic/core/quic_protocol.cc

Issue 2505993004: Move enums from QuicProtocol to QuicTypes. No behavior change. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/core/quic_protocol.h ('k') | net/quic/core/quic_types.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 uint32_t MakeQuicTag(char a, char b, char c, char d) { 159 uint32_t MakeQuicTag(char a, char b, char c, char d) {
160 return static_cast<uint32_t>(a) | static_cast<uint32_t>(b) << 8 | 160 return static_cast<uint32_t>(a) | static_cast<uint32_t>(b) << 8 |
161 static_cast<uint32_t>(c) << 16 | static_cast<uint32_t>(d) << 24; 161 static_cast<uint32_t>(c) << 16 | static_cast<uint32_t>(d) << 24;
162 } 162 }
163 163
164 bool ContainsQuicTag(const QuicTagVector& tag_vector, QuicTag tag) { 164 bool ContainsQuicTag(const QuicTagVector& tag_vector, QuicTag tag) {
165 return std::find(tag_vector.begin(), tag_vector.end(), tag) != 165 return std::find(tag_vector.begin(), tag_vector.end(), tag) !=
166 tag_vector.end(); 166 tag_vector.end();
167 } 167 }
168 168
169 ostream& operator<<(ostream& os, const Perspective& s) {
170 if (s == Perspective::IS_SERVER) {
171 os << "IS_SERVER";
172 } else {
173 os << "IS_CLIENT";
174 }
175 return os;
176 }
177
178 ostream& operator<<(ostream& os, const QuicPacketHeader& header) { 169 ostream& operator<<(ostream& os, const QuicPacketHeader& header) {
179 os << "{ connection_id: " << header.public_header.connection_id 170 os << "{ connection_id: " << header.public_header.connection_id
180 << ", connection_id_length: " << header.public_header.connection_id_length 171 << ", connection_id_length: " << header.public_header.connection_id_length
181 << ", packet_number_length: " << header.public_header.packet_number_length 172 << ", packet_number_length: " << header.public_header.packet_number_length
182 << ", multipath_flag: " << header.public_header.multipath_flag 173 << ", multipath_flag: " << header.public_header.multipath_flag
183 << ", reset_flag: " << header.public_header.reset_flag 174 << ", reset_flag: " << header.public_header.reset_flag
184 << ", version_flag: " << header.public_header.version_flag; 175 << ", version_flag: " << header.public_header.version_flag;
185 if (header.public_header.version_flag) { 176 if (header.public_header.version_flag) {
186 os << ", version:"; 177 os << ", version:";
187 for (size_t i = 0; i < header.public_header.versions.size(); ++i) { 178 for (size_t i = 0; i < header.public_header.versions.size(); ++i) {
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 is_unackable(false), 730 is_unackable(false),
740 has_crypto_handshake(has_crypto_handshake), 731 has_crypto_handshake(has_crypto_handshake),
741 num_padding_bytes(num_padding_bytes), 732 num_padding_bytes(num_padding_bytes),
742 retransmission(0) {} 733 retransmission(0) {}
743 734
744 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default; 735 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default;
745 736
746 TransmissionInfo::~TransmissionInfo() {} 737 TransmissionInfo::~TransmissionInfo() {}
747 738
748 } // namespace net 739 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_protocol.h ('k') | net/quic/core/quic_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698