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

Unified Diff: net/proxy/proxy_config.cc

Issue 198039: Aesthetic changes to the proxy configuration log format.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Split up another long line Created 11 years, 3 months 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
« no previous file with comments | « no previous file | net/proxy/proxy_config_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_config.cc
===================================================================
--- net/proxy/proxy_config.cc (revision 25517)
+++ net/proxy/proxy_config.cc (working copy)
@@ -175,6 +175,10 @@
return out;
}
+const char* BoolToYesNoString(bool b) {
+ return b ? "Yes" : "No";
+}
+
} // namespace
std::ostream& operator<<(std::ostream& out,
@@ -206,26 +210,54 @@
}
std::ostream& operator<<(std::ostream& out, const net::ProxyConfig& config) {
- out << "{\n"
- << " auto_detect: " << config.auto_detect << "\n"
- << " pac_url: " << config.pac_url << "\n"
- << " proxy_rules:\n" << config.proxy_rules << "\n"
- << " proxy_bypass_local_names: " << config.proxy_bypass_local_names
- << "\n"
- << " proxy_bypass_list:\n";
+ // "Automatic" settings.
+ out << "Automatic settings:\n";
+ out << " Auto-detect: " << BoolToYesNoString(config.auto_detect) << "\n";
+ out << " Custom PAC script: ";
+ if (config.pac_url.is_valid())
+ out << config.pac_url;
+ else
+ out << "[None]";
+ out << "\n";
- // Print out the proxy bypass list.
- if (!config.proxy_bypass.empty()) {
- out << " {\n";
+ // "Manual" settings.
+ out << "Manual settings:\n";
+ out << " Proxy server: ";
+
+ switch (config.proxy_rules.type) {
+ case net::ProxyConfig::ProxyRules::TYPE_NO_RULES:
+ out << "[None]\n";
+ break;
+ case net::ProxyConfig::ProxyRules::TYPE_SINGLE_PROXY:
+ out << config.proxy_rules.single_proxy;
+ out << "\n";
+ break;
+ case net::ProxyConfig::ProxyRules::TYPE_PROXY_PER_SCHEME:
+ out << "\n";
+ if (config.proxy_rules.proxy_for_http.is_valid())
+ out << " HTTP: " << config.proxy_rules.proxy_for_http << "\n";
+ if (config.proxy_rules.proxy_for_https.is_valid())
+ out << " HTTPS: " << config.proxy_rules.proxy_for_https << "\n";
+ if (config.proxy_rules.proxy_for_ftp.is_valid())
+ out << " FTP: " << config.proxy_rules.proxy_for_ftp << "\n";
+ if (config.proxy_rules.socks_proxy.is_valid())
+ out << " SOCKS: " << config.proxy_rules.socks_proxy << "\n";
+ break;
+ }
+
+ out << " Bypass list: ";
+ if (config.proxy_bypass.empty()) {
+ out << "[None]\n";
+ } else {
+ out << "\n";
std::vector<std::string>::const_iterator it;
for (it = config.proxy_bypass.begin();
it != config.proxy_bypass.end(); ++it) {
out << " " << *it << "\n";
}
- out << " }\n";
}
- out << " id: " << config.id() << "\n"
- << "}";
+ out << " Bypass local names: "
+ << BoolToYesNoString(config.proxy_bypass_local_names);
return out;
}
« no previous file with comments | « no previous file | net/proxy/proxy_config_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698