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

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

Issue 1009543004: Create a Perspective enum to use instead of a bool is_server to improve (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added NET_EXPORT_PRIVATE to fix compiler error Created 5 years, 9 months 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/quic_protocol.h ('k') | net/quic/quic_reliable_client_stream_test.cc » ('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/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_utils.h" 8 #include "net/quic/quic_utils.h"
9 9
10 using base::StringPiece; 10 using base::StringPiece;
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 string result = ""; 192 string result = "";
193 for (size_t i = 0; i < versions.size(); ++i) { 193 for (size_t i = 0; i < versions.size(); ++i) {
194 if (i != 0) { 194 if (i != 0) {
195 result.append(","); 195 result.append(",");
196 } 196 }
197 result.append(QuicVersionToString(versions[i])); 197 result.append(QuicVersionToString(versions[i]));
198 } 198 }
199 return result; 199 return result;
200 } 200 }
201 201
202 ostream& operator<<(ostream& os, const Perspective& s) {
203 if (s == Perspective::IS_SERVER) {
204 os << "IS_SERVER";
205 } else {
206 os << "IS_CLIENT";
207 }
208 return os;
209 }
210
202 ostream& operator<<(ostream& os, const QuicPacketHeader& header) { 211 ostream& operator<<(ostream& os, const QuicPacketHeader& header) {
203 os << "{ connection_id: " << header.public_header.connection_id 212 os << "{ connection_id: " << header.public_header.connection_id
204 << ", connection_id_length:" << header.public_header.connection_id_length 213 << ", connection_id_length:" << header.public_header.connection_id_length
205 << ", sequence_number_length:" 214 << ", sequence_number_length:"
206 << header.public_header.sequence_number_length 215 << header.public_header.sequence_number_length
207 << ", reset_flag: " << header.public_header.reset_flag 216 << ", reset_flag: " << header.public_header.reset_flag
208 << ", version_flag: " << header.public_header.version_flag; 217 << ", version_flag: " << header.public_header.version_flag;
209 if (header.public_header.version_flag) { 218 if (header.public_header.version_flag) {
210 os << " version: "; 219 os << " version: ";
211 for (size_t i = 0; i < header.public_header.versions.size(); ++i) { 220 for (size_t i = 0; i < header.public_header.versions.size(); ++i) {
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 bytes_sent(bytes_sent), 677 bytes_sent(bytes_sent),
669 nack_count(0), 678 nack_count(0),
670 transmission_type(transmission_type), 679 transmission_type(transmission_type),
671 all_transmissions(nullptr), 680 all_transmissions(nullptr),
672 in_flight(false), 681 in_flight(false),
673 is_unackable(false), 682 is_unackable(false),
674 is_fec_packet(is_fec_packet) { 683 is_fec_packet(is_fec_packet) {
675 } 684 }
676 685
677 } // namespace net 686 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_protocol.h ('k') | net/quic/quic_reliable_client_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698