summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorziadh@chromium.org <ziadh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-11 00:19:50 +0000
committerziadh@chromium.org <ziadh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-11 00:19:50 +0000
commita8185d0d37f0d8c95274bcb433f0c0091113e3e9 (patch)
tree10593c4357c4daba9790acba8eff9afd994cbe1d /net
parent1caa9261639f9275071d172ba2711bb792093d55 (diff)
downloadchromium_src-a8185d0d37f0d8c95274bcb433f0c0091113e3e9.zip
chromium_src-a8185d0d37f0d8c95274bcb433f0c0091113e3e9.tar.gz
chromium_src-a8185d0d37f0d8c95274bcb433f0c0091113e3e9.tar.bz2
A couple of style mods in proxy_config_service_linux.cc
Relates to argument passing and iterating over an STL container. r=eroman Review URL: http://codereview.chromium.org/2735012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49478 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/proxy/proxy_config_service_linux.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/net/proxy/proxy_config_service_linux.cc b/net/proxy/proxy_config_service_linux.cc
index cd7102b..6444f0b 100644
--- a/net/proxy/proxy_config_service_linux.cc
+++ b/net/proxy/proxy_config_service_linux.cc
@@ -582,7 +582,7 @@ class GConfSettingGetterImplKDE
return kde_home.Append("share").Append("config");
}
- void AddProxy(std::string prefix, std::string value) {
+ void AddProxy(const std::string& prefix, const std::string& value) {
if (value.empty() || value.substr(0, 3) == "//:")
// No proxy.
return;
@@ -592,7 +592,7 @@ class GConfSettingGetterImplKDE
string_table_[prefix + "host"] = value;
}
- void AddHostList(std::string key, std::string value) {
+ void AddHostList(const std::string& key, const std::string& value) {
std::vector<std::string> tokens;
StringTokenizer tk(value, ",");
while (tk.GetNext()) {
@@ -645,7 +645,7 @@ 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_exception_ = value == "true" || StringToInt(value);
+ reversed_exception_ = (value == "true" || StringToInt(value));
} else if (key == "NoProxyFor") {
AddHostList("/system/http_proxy/ignore_hosts", value);
} else if (key == "AuthMode") {
@@ -660,7 +660,7 @@ class GConfSettingGetterImplKDE
}
}
- void ResolveIndirect(std::string key) {
+ void ResolveIndirect(const std::string& key) {
string_map_type::iterator it = string_table_.find(key);
if (it != string_table_.end()) {
std::string value;
@@ -671,7 +671,7 @@ class GConfSettingGetterImplKDE
}
}
- void ResolveIndirectList(std::string key) {
+ void ResolveIndirectList(const std::string& key) {
strings_map_type::iterator it = strings_table_.find(key);
if (it != strings_table_.end()) {
std::string value;
@@ -1012,13 +1012,13 @@ bool ProxyConfigServiceLinux::Delegate::GetConfigFromGConf(
// Now the bypass list.
std::vector<std::string> ignore_hosts_list;
- gconf_getter_->GetStringList("/system/http_proxy/ignore_hosts",
- &ignore_hosts_list);
-
config->proxy_rules().bypass_rules.Clear();
- for (size_t i = 0; i < ignore_hosts_list.size(); ++i)
- config->proxy_rules().bypass_rules.AddRuleFromString(ignore_hosts_list[i]);
-
+ if (gconf_getter_->GetStringList("/system/http_proxy/ignore_hosts",
+ &ignore_hosts_list)) {
+ std::vector<std::string>::const_iterator it(ignore_hosts_list.begin());
+ for (; it != ignore_hosts_list.end(); ++it)
+ config->proxy_rules().bypass_rules.AddRuleFromString(*it);
+ }
// Note that there are no settings with semantics corresponding to
// bypass of local names.