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

Unified Diff: net/proxy/proxy_bypass_rules.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
« net/http/http_response_headers.cc ('K') | « net/http/http_response_headers.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_bypass_rules.cc
diff --git a/net/proxy/proxy_bypass_rules.cc b/net/proxy/proxy_bypass_rules.cc
index 3d622a8978575f0f51f2ffa2ac3b9fb320110563..bc9fc331616493b4bc51f61d01bcda11dc8956d8 100644
--- a/net/proxy/proxy_bypass_rules.cc
+++ b/net/proxy/proxy_bypass_rules.cc
@@ -7,10 +7,13 @@
#include "base/stl_util.h"
#include "base/stringprintf.h"
#include "base/string_number_conversions.h"
+#include "base/string_piece.h"
#include "base/string_tokenizer.h"
#include "base/string_util.h"
#include "net/base/net_util.h"
+using base::StringPiece;
+
namespace net {
namespace {
@@ -315,7 +318,9 @@ bool ProxyBypassRules::AddRuleFromStringInternal(
host = raw;
port = -1;
if (pos_colon != std::string::npos) {
- if (!base::StringToInt(raw.begin() + pos_colon + 1, raw.end(), &port) ||
+ if (!base::StringToInt(StringPiece(raw.begin() + pos_colon + 1,
+ raw.end()),
+ &port) ||
(port < 0 || port > 0xFFFF)) {
return false; // Port was invalid.
}
« net/http/http_response_headers.cc ('K') | « net/http/http_response_headers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698