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

Unified Diff: net/http/http_chunked_decoder.cc

Issue 8921006: Standardize StringToInt{,64} interface. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Update formatting and convert HexStringToInt() calls. Created 9 years 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
Index: net/http/http_chunked_decoder.cc
diff --git a/net/http/http_chunked_decoder.cc b/net/http/http_chunked_decoder.cc
index d5b16ddb6ea738ae4530e7d33b74ba06de66f336..ead6e6c32a7e7e1dc53e49a5255f50682559fc32 100644
--- a/net/http/http_chunked_decoder.cc
+++ b/net/http/http_chunked_decoder.cc
@@ -187,12 +187,13 @@ bool HttpChunkedDecoder::ParseChunkSize(const char* start, int len, int* out) {
// Be more restrictive than HexStringToInt;
// don't allow inputs with leading "-", "+", "0x", "0X"
- if (base::StringPiece(start, len).find_first_not_of("0123456789abcdefABCDEF")
+ base::StringPiece chunk_size(start, len);
+ if (chunk_size.find_first_not_of("0123456789abcdefABCDEF")
erikwright (departed) 2011/12/14 04:24:08 need {} around if and else blocks when condition w
!= base::StringPiece::npos)
return false;
int parsed_number;
- bool ok = base::HexStringToInt(start, start + len, &parsed_number);
+ bool ok = base::HexStringToInt(chunk_size, &parsed_number);
if (ok && parsed_number >= 0) {
*out = parsed_number;
return true;

Powered by Google App Engine
This is Rietveld 408576698