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

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

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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_unacked_packet_map.cc ('k') | net/quic/reliable_quic_stream.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/quic_utils.h" 5 #include "net/quic/quic_utils.h"
6 6
7 #include <ctype.h> 7 #include <ctype.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 RETURN_STRING_LITERAL(ALL_UNACKED_RETRANSMISSION); 252 RETURN_STRING_LITERAL(ALL_UNACKED_RETRANSMISSION);
253 RETURN_STRING_LITERAL(ALL_INITIAL_RETRANSMISSION); 253 RETURN_STRING_LITERAL(ALL_INITIAL_RETRANSMISSION);
254 RETURN_STRING_LITERAL(RTO_RETRANSMISSION); 254 RETURN_STRING_LITERAL(RTO_RETRANSMISSION);
255 RETURN_STRING_LITERAL(TLP_RETRANSMISSION); 255 RETURN_STRING_LITERAL(TLP_RETRANSMISSION);
256 } 256 }
257 return "INVALID_TRANSMISSION_TYPE"; 257 return "INVALID_TRANSMISSION_TYPE";
258 } 258 }
259 259
260 // static 260 // static
261 string QuicUtils::TagToString(QuicTag tag) { 261 string QuicUtils::TagToString(QuicTag tag) {
262 char chars[4]; 262 char chars[sizeof tag];
263 bool ascii = true; 263 bool ascii = true;
264 const QuicTag orig_tag = tag; 264 const QuicTag orig_tag = tag;
265 265
266 for (size_t i = 0; i < sizeof(chars); i++) { 266 for (size_t i = 0; i < arraysize(chars); i++) {
267 chars[i] = tag; 267 chars[i] = static_cast<char>(tag);
268 if ((chars[i] == 0 || chars[i] == '\xff') && i == 3) { 268 if ((chars[i] == 0 || chars[i] == '\xff') && i == arraysize(chars) - 1) {
269 chars[i] = ' '; 269 chars[i] = ' ';
270 } 270 }
271 if (!isprint(static_cast<unsigned char>(chars[i]))) { 271 if (!isprint(static_cast<unsigned char>(chars[i]))) {
272 ascii = false; 272 ascii = false;
273 break; 273 break;
274 } 274 }
275 tag >>= 8; 275 tag >>= 8;
276 } 276 }
277 277
278 if (ascii) { 278 if (ascii) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 QuicPriority QuicUtils::LowestPriority() { 337 QuicPriority QuicUtils::LowestPriority() {
338 return QuicWriteBlockedList::kLowestPriority; 338 return QuicWriteBlockedList::kLowestPriority;
339 } 339 }
340 340
341 // static 341 // static
342 QuicPriority QuicUtils::HighestPriority() { 342 QuicPriority QuicUtils::HighestPriority() {
343 return QuicWriteBlockedList::kHighestPriority; 343 return QuicWriteBlockedList::kHighestPriority;
344 } 344 }
345 345
346 } // namespace net 346 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_unacked_packet_map.cc ('k') | net/quic/reliable_quic_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698