| 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_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 | 10 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 switch (level) { | 224 switch (level) { |
| 225 RETURN_STRING_LITERAL(ENCRYPTION_NONE); | 225 RETURN_STRING_LITERAL(ENCRYPTION_NONE); |
| 226 RETURN_STRING_LITERAL(ENCRYPTION_INITIAL); | 226 RETURN_STRING_LITERAL(ENCRYPTION_INITIAL); |
| 227 RETURN_STRING_LITERAL(ENCRYPTION_FORWARD_SECURE); | 227 RETURN_STRING_LITERAL(ENCRYPTION_FORWARD_SECURE); |
| 228 RETURN_STRING_LITERAL(NUM_ENCRYPTION_LEVELS); | 228 RETURN_STRING_LITERAL(NUM_ENCRYPTION_LEVELS); |
| 229 } | 229 } |
| 230 return "INVALID_ENCRYPTION_LEVEL"; | 230 return "INVALID_ENCRYPTION_LEVEL"; |
| 231 } | 231 } |
| 232 | 232 |
| 233 // static | 233 // static |
| 234 const char* QuicUtils::TransmissionTypeToString(TransmissionType type) { |
| 235 switch (type) { |
| 236 RETURN_STRING_LITERAL(NOT_RETRANSMISSION); |
| 237 RETURN_STRING_LITERAL(NACK_RETRANSMISSION); |
| 238 RETURN_STRING_LITERAL(RTO_RETRANSMISSION); |
| 239 RETURN_STRING_LITERAL(TLP_RETRANSMISSION); |
| 240 } |
| 241 return "INVALID_TRANSMISSION_TYPE"; |
| 242 } |
| 243 |
| 244 // static |
| 234 string QuicUtils::TagToString(QuicTag tag) { | 245 string QuicUtils::TagToString(QuicTag tag) { |
| 235 char chars[4]; | 246 char chars[4]; |
| 236 bool ascii = true; | 247 bool ascii = true; |
| 237 const QuicTag orig_tag = tag; | 248 const QuicTag orig_tag = tag; |
| 238 | 249 |
| 239 for (size_t i = 0; i < sizeof(chars); i++) { | 250 for (size_t i = 0; i < sizeof(chars); i++) { |
| 240 chars[i] = tag; | 251 chars[i] = tag; |
| 241 if ((chars[i] == 0 || chars[i] == '\xff') && i == 3) { | 252 if ((chars[i] == 0 || chars[i] == '\xff') && i == 3) { |
| 242 chars[i] = ' '; | 253 chars[i] = ' '; |
| 243 } | 254 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 QuicPriority QuicUtils::LowestPriority() { | 302 QuicPriority QuicUtils::LowestPriority() { |
| 292 return QuicWriteBlockedList::kLowestPriority; | 303 return QuicWriteBlockedList::kLowestPriority; |
| 293 } | 304 } |
| 294 | 305 |
| 295 // static | 306 // static |
| 296 QuicPriority QuicUtils::HighestPriority() { | 307 QuicPriority QuicUtils::HighestPriority() { |
| 297 return QuicWriteBlockedList::kHighestPriority; | 308 return QuicWriteBlockedList::kHighestPriority; |
| 298 } | 309 } |
| 299 | 310 |
| 300 } // namespace net | 311 } // namespace net |
| OLD | NEW |