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

Unified Diff: net/quic/core/quic_utils.cc

Issue 2517603003: Moves QuicTag typedefs, and QuicTag utility methods to quic_tag.{h,cc}. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/quic_utils.h ('k') | net/quic/core/quic_utils_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_utils.cc
diff --git a/net/quic/core/quic_utils.cc b/net/quic/core/quic_utils.cc
index e75f32d5f340c53e9a0882ece15a80863299a0d4..aa6dd63fd22cfdcd96e82ea78f0b1f36d8f71d27 100644
--- a/net/quic/core/quic_utils.cc
+++ b/net/quic/core/quic_utils.cc
@@ -124,31 +124,6 @@ uint128 QuicUtils::FNV1a_128_Hash_Two(const char* data1,
}
// static
-bool QuicUtils::FindMutualTag(const QuicTagVector& our_tags_vector,
- const QuicTag* their_tags,
- size_t num_their_tags,
- QuicTag* out_result,
- size_t* out_index) {
- if (our_tags_vector.empty()) {
- return false;
- }
- const size_t num_our_tags = our_tags_vector.size();
- for (size_t i = 0; i < num_our_tags; i++) {
- for (size_t j = 0; j < num_their_tags; j++) {
- if (our_tags_vector[i] == their_tags[j]) {
- *out_result = our_tags_vector[i];
- if (out_index != nullptr) {
- *out_index = j;
- }
- return true;
- }
- }
- }
-
- return false;
-}
-
-// static
void QuicUtils::SerializeUint128Short(uint128 v, uint8_t* out) {
const uint64_t lo = Uint128Low64(v);
const uint64_t hi = Uint128High64(v);
@@ -320,31 +295,6 @@ const char* QuicUtils::TransmissionTypeToString(TransmissionType type) {
}
// static
-string QuicUtils::TagToString(QuicTag tag) {
- char chars[sizeof tag];
- bool ascii = true;
- const QuicTag orig_tag = tag;
-
- for (size_t i = 0; i < arraysize(chars); i++) {
- chars[i] = static_cast<char>(tag);
- if ((chars[i] == 0 || chars[i] == '\xff') && i == arraysize(chars) - 1) {
- chars[i] = ' ';
- }
- if (!isprint(static_cast<unsigned char>(chars[i]))) {
- ascii = false;
- break;
- }
- tag >>= 8;
- }
-
- if (ascii) {
- return string(chars, sizeof(chars));
- }
-
- return base::UintToString(orig_tag);
-}
-
-// static
QuicTagVector QuicUtils::ParseQuicConnectionOptions(
const std::string& connection_options) {
QuicTagVector options;
« no previous file with comments | « net/quic/core/quic_utils.h ('k') | net/quic/core/quic_utils_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698