diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-31 17:29:25 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-31 17:29:25 +0000 |
commit | e83326f8400791e92875546b2fd1885a3a17d1b1 (patch) | |
tree | edbe773208b1a9f6965b45b55da10afd210ea7bb /net/base/net_util.cc | |
parent | 8e0a03bf3b1aacaa7a2bc2561d8eb1b83eb9c2e5 (diff) | |
download | chromium_src-e83326f8400791e92875546b2fd1885a3a17d1b1.zip chromium_src-e83326f8400791e92875546b2fd1885a3a17d1b1.tar.gz chromium_src-e83326f8400791e92875546b2fd1885a3a17d1b1.tar.bz2 |
Convert more callers of the integer/string functions to using
string_number_conversions.h
TEST=it compiles
BUG=none
Review URL: http://codereview.chromium.org/3013046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54454 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/net_util.cc')
-rw-r--r-- | net/base/net_util.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/net/base/net_util.cc b/net/base/net_util.cc index 7ba8a10..e25eb50 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -45,6 +45,7 @@ #include "base/path_service.h" #include "base/singleton.h" #include "base/stl_util-inl.h" +#include "base/string_number_conversions.h" #include "base/string_piece.h" #include "base/string_tokenizer.h" #include "base/string_util.h" @@ -1660,9 +1661,12 @@ void SetExplicitlyAllowedPorts(const std::wstring& allowed_ports) { return; if (i == size || allowed_ports[i] == kComma) { size_t length = i - last; - if (length > 0) - ports.insert(StringToInt(WideToASCII( - allowed_ports.substr(last, length)))); + if (length > 0) { + int port; + base::StringToInt(WideToUTF8(allowed_ports.substr(last, length)), + &port); + ports.insert(port); + } last = i + 1; } } @@ -1887,7 +1891,7 @@ bool ParseCIDRBlock(const std::string& cidr_literal, // Parse the prefix length. int number_of_bits = -1; - if (!StringToInt(parts[1], &number_of_bits)) + if (!base::StringToInt(parts[1], &number_of_bits)) return false; // Make sure the prefix length is in a valid range. |