summaryrefslogtreecommitdiffstats
path: root/net/proxy
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-31 17:29:25 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-31 17:29:25 +0000
commite83326f8400791e92875546b2fd1885a3a17d1b1 (patch)
treeedbe773208b1a9f6965b45b55da10afd210ea7bb /net/proxy
parent8e0a03bf3b1aacaa7a2bc2561d8eb1b83eb9c2e5 (diff)
downloadchromium_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/proxy')
-rw-r--r--net/proxy/proxy_bypass_rules.cc3
-rw-r--r--net/proxy/proxy_config_service_linux.cc11
2 files changed, 10 insertions, 4 deletions
diff --git a/net/proxy/proxy_bypass_rules.cc b/net/proxy/proxy_bypass_rules.cc
index e273d67..8ebc79e 100644
--- a/net/proxy/proxy_bypass_rules.cc
+++ b/net/proxy/proxy_bypass_rules.cc
@@ -5,6 +5,7 @@
#include "net/proxy/proxy_bypass_rules.h"
#include "base/logging.h"
+#include "base/string_number_conversions.h"
#include "base/string_tokenizer.h"
#include "base/string_util.h"
#include "net/base/net_util.h"
@@ -253,7 +254,7 @@ bool ProxyBypassRules::AddRuleFromStringInternal(
host = raw;
port = -1;
if (pos_colon != std::string::npos) {
- if (!StringToInt(raw.substr(pos_colon + 1), &port) ||
+ if (!base::StringToInt(raw.substr(pos_colon + 1), &port) ||
(port < 0 || port > 0xFFFF)) {
return false; // Port was invalid.
}
diff --git a/net/proxy/proxy_config_service_linux.cc b/net/proxy/proxy_config_service_linux.cc
index c2f9a94..e38083d 100644
--- a/net/proxy/proxy_config_service_linux.cc
+++ b/net/proxy/proxy_config_service_linux.cc
@@ -633,7 +633,9 @@ class GConfSettingGetterImplKDE
const char* mode = "none";
indirect_manual_ = false;
auto_no_pac_ = false;
- switch (StringToInt(value)) {
+ int int_value;
+ base::StringToInt(value, &int_value);
+ switch (int_value) {
case 0: // No proxy, or maybe kioslaverc syntax error.
break;
case 1: // Manual configuration.
@@ -664,12 +666,15 @@ class GConfSettingGetterImplKDE
// We count "true" or any nonzero number as true, otherwise false.
// Note that if the value is not actually numeric StringToInt()
// will return 0, which we count as false.
- reversed_bypass_list_ = (value == "true" || StringToInt(value));
+ int int_value;
+ base::StringToInt(value, &int_value);
+ reversed_bypass_list_ = (value == "true" || int_value);
} else if (key == "NoProxyFor") {
AddHostList("/system/http_proxy/ignore_hosts", value);
} else if (key == "AuthMode") {
// Check for authentication, just so we can warn.
- int mode = StringToInt(value);
+ int mode;
+ base::StringToInt(value, &mode);
if (mode) {
// ProxyConfig does not support authentication parameters, but
// Chrome will prompt for the password later. So we ignore this.