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 #include <vector> | 10 #include <vector> |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } | 116 } |
117 return true; | 117 return true; |
118 } | 118 } |
119 } | 119 } |
120 } | 120 } |
121 | 121 |
122 return false; | 122 return false; |
123 } | 123 } |
124 | 124 |
125 // static | 125 // static |
126 void QuicUtils::SerializeUint128(uint128 v, uint8* out) { | |
127 const uint64 lo = Uint128Low64(v); | |
128 const uint64 hi = Uint128High64(v); | |
129 // This assumes that the system is little-endian. | |
130 memcpy(out, &lo, sizeof(lo)); | |
131 memcpy(out + sizeof(lo), &hi, sizeof(hi)); | |
132 } | |
133 | |
134 // static | |
135 void QuicUtils::SerializeUint128Short(uint128 v, uint8* out) { | 126 void QuicUtils::SerializeUint128Short(uint128 v, uint8* out) { |
136 const uint64 lo = Uint128Low64(v); | 127 const uint64 lo = Uint128Low64(v); |
137 const uint64 hi = Uint128High64(v); | 128 const uint64 hi = Uint128High64(v); |
138 // This assumes that the system is little-endian. | 129 // This assumes that the system is little-endian. |
139 memcpy(out, &lo, sizeof(lo)); | 130 memcpy(out, &lo, sizeof(lo)); |
140 memcpy(out + sizeof(lo), &hi, sizeof(hi) / 2); | 131 memcpy(out + sizeof(lo), &hi, sizeof(hi) / 2); |
141 } | 132 } |
142 | 133 |
143 #define RETURN_STRING_LITERAL(x) \ | 134 #define RETURN_STRING_LITERAL(x) \ |
144 case x: \ | 135 case x: \ |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 | 331 |
341 bytes_remaining -= line_bytes; | 332 bytes_remaining -= line_bytes; |
342 offset += line_bytes; | 333 offset += line_bytes; |
343 p += line_bytes; | 334 p += line_bytes; |
344 s += '\n'; | 335 s += '\n'; |
345 } | 336 } |
346 return s; | 337 return s; |
347 } | 338 } |
348 | 339 |
349 // static | 340 // static |
350 QuicPriority QuicUtils::LowestPriority() { | |
351 return QuicWriteBlockedList::kLowestPriority; | |
352 } | |
353 | |
354 // static | |
355 QuicPriority QuicUtils::HighestPriority() { | 341 QuicPriority QuicUtils::HighestPriority() { |
356 return QuicWriteBlockedList::kHighestPriority; | 342 return QuicWriteBlockedList::kHighestPriority; |
357 } | 343 } |
358 | 344 |
359 } // namespace net | 345 } // namespace net |
OLD | NEW |