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

Side by Side Diff: net/base/sdch_manager.cc

Issue 1828103002: Extend net/base/parse_number.h for parsing of negative numbers, and determining if there was overflo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@proxy_num
Patch Set: fix comments Created 4 years, 8 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/base/parse_number_unittest.cc ('k') | net/cert/x509_cert_types.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/base/sdch_manager.h" 5 #include "net/base/sdch_manager.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 } else if (name == "format-version") { 375 } else if (name == "format-version") {
376 if (value != "1.0") 376 if (value != "1.0")
377 return SDCH_DICTIONARY_UNSUPPORTED_VERSION; 377 return SDCH_DICTIONARY_UNSUPPORTED_VERSION;
378 } else if (name == "max-age") { 378 } else if (name == "max-age") {
379 int64_t seconds; 379 int64_t seconds;
380 // TODO(eroman): crbug.com/596541 -- should not accept a leading +. 380 // TODO(eroman): crbug.com/596541 -- should not accept a leading +.
381 base::StringToInt64(value, &seconds); 381 base::StringToInt64(value, &seconds);
382 expiration = base::Time::Now() + base::TimeDelta::FromSeconds(seconds); 382 expiration = base::Time::Now() + base::TimeDelta::FromSeconds(seconds);
383 } else if (name == "port") { 383 } else if (name == "port") {
384 int port; 384 int port;
385 if (ParseNonNegativeDecimalInt(value, &port)) 385 if (ParseInt32(value, ParseIntFormat::NON_NEGATIVE, &port))
386 ports.insert(port); 386 ports.insert(port);
387 } 387 }
388 } 388 }
389 389
390 if (line_end >= header_end) 390 if (line_end >= header_end)
391 break; 391 break;
392 line_start = line_end + 1; 392 line_start = line_end + 1;
393 } 393 }
394 394
395 // Narrow fix for http://crbug.com/389451. 395 // Narrow fix for http://crbug.com/389451.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 entry_dict->SetInteger("tries", it->second.count); 474 entry_dict->SetInteger("tries", it->second.count);
475 entry_dict->SetInteger("reason", it->second.reason); 475 entry_dict->SetInteger("reason", it->second.reason);
476 entry_list->Append(std::move(entry_dict)); 476 entry_list->Append(std::move(entry_dict));
477 } 477 }
478 value->Set("blacklisted", std::move(entry_list)); 478 value->Set("blacklisted", std::move(entry_list));
479 479
480 return std::move(value); 480 return std::move(value);
481 } 481 }
482 482
483 } // namespace net 483 } // namespace net
OLDNEW
« no previous file with comments | « net/base/parse_number_unittest.cc ('k') | net/cert/x509_cert_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698