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

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

Issue 1215933004: New new versions of Starts/EndsWith and SplitString in net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@starts_with
Patch Set: Created 5 years, 5 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/proxy/proxy_config_service_linux.cc ('k') | net/server/http_server_unittest.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_utils.h" 5 #include "net/quic/quic_utils.h"
6 6
7 #include <ctype.h> 7 #include <ctype.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 return string(chars, sizeof(chars)); 285 return string(chars, sizeof(chars));
286 } 286 }
287 287
288 return base::UintToString(orig_tag); 288 return base::UintToString(orig_tag);
289 } 289 }
290 290
291 // static 291 // static
292 QuicTagVector QuicUtils::ParseQuicConnectionOptions( 292 QuicTagVector QuicUtils::ParseQuicConnectionOptions(
293 const std::string& connection_options) { 293 const std::string& connection_options) {
294 QuicTagVector options; 294 QuicTagVector options;
295 std::vector<std::string> tokens;
296 base::SplitString(connection_options, ',', &tokens);
297 // Tokens are expected to be no more than 4 characters long, but we 295 // Tokens are expected to be no more than 4 characters long, but we
298 // handle overflow gracefully. 296 // handle overflow gracefully.
299 for (const std::string& token : tokens) { 297 for (const base::StringPiece& token :
298 base::SplitStringPiece(connection_options, ",", base::TRIM_WHITESPACE,
299 base::SPLIT_WANT_ALL)) {
300 uint32 option = 0; 300 uint32 option = 0;
301 for (char token_char : base::Reversed(token)) { 301 for (char token_char : base::Reversed(token)) {
302 option <<= 8; 302 option <<= 8;
303 option |= static_cast<unsigned char>(token_char); 303 option |= static_cast<unsigned char>(token_char);
304 } 304 }
305 options.push_back(option); 305 options.push_back(option);
306 } 306 }
307 return options; 307 return options;
308 } 308 }
309 309
(...skipping 28 matching lines...) Expand all
338 } 338 }
339 return s; 339 return s;
340 } 340 }
341 341
342 // static 342 // static
343 QuicPriority QuicUtils::HighestPriority() { 343 QuicPriority QuicUtils::HighestPriority() {
344 return QuicWriteBlockedList::kHighestPriority; 344 return QuicWriteBlockedList::kHighestPriority;
345 } 345 }
346 346
347 } // namespace net 347 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_config_service_linux.cc ('k') | net/server/http_server_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698