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

Unified Diff: net/proxy/proxy_config.h

Issue 12315019: Change ProxyRules to handle ProxyLists rather than just single ProxyServer instances. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 10 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.cc » ('j') | net/proxy/proxy_config.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_config.h
diff --git a/net/proxy/proxy_config.h b/net/proxy/proxy_config.h
index 29619dff1e36ae3cd4ac02e96365b660b2817ef4..75943b5ef64b7c40e167c172586e0d6a28968450 100644
--- a/net/proxy/proxy_config.h
+++ b/net/proxy/proxy_config.h
@@ -11,6 +11,7 @@
#include "net/base/net_export.h"
#include "net/proxy/proxy_bypass_rules.h"
#include "net/proxy/proxy_config_source.h"
+#include "net/proxy/proxy_list.h"
#include "net/proxy/proxy_server.h"
namespace base {
@@ -52,17 +53,23 @@ class NET_EXPORT ProxyConfig {
return type == TYPE_NO_RULES;
}
- // Sets |result| with the proxy to use for |url| based on the current rules.
+ // Sets |result| with the proxies to use for |url| based on the current
+ // rules.
void Apply(const GURL& url, ProxyInfo* result) const;
// Parses the rules from a string, indicating which proxies to use.
//
// proxy-uri = [<proxy-scheme>"://"]<proxy-host>[":"<proxy-port>]
//
+ // proxy-uri-list = <proxy-uri>[","<proxy-uri-list>]
+ //
// If the proxy to use depends on the scheme of the URL, can instead specify
// a semicolon separated list of:
//
- // <url-scheme>"="<proxy-uri>
+ // <url-scheme>"="<proxy-uri-list>
+ //
+ // If 'socks' is specified as a scheme, any schemes left without proxies
+ // specified will have that 'socks' server added.
//
// For example:
// "http=foopy:80;ftp=foopy2" -- use HTTP proxy "foopy:80" for http://
@@ -71,12 +78,21 @@ class NET_EXPORT ProxyConfig {
// "foopy:80" -- use HTTP proxy "foopy:80" for all URLs.
eroman 2013/03/01 00:05:13 It would make sense for proxy-uri-list to also be
marq_use_my_chromium_address 2013/03/04 18:04:20 Done.
// "socks4://foopy" -- use SOCKS v4 proxy "foopy:1080" for all
// URLs.
+ // "http=foopy,bar.com -- use HTTP proxy "foopy" for http URLs,
+ // and fail over to "bar.com" if "foopy"
+ // is unavailable.
+ // "http=foopy,direct:// -- use HTTP proxy "foopy" for http URLs,
+ // and use no proxy if "foopy" is
+ // unavailable.
+ // "http=foopy;socks=foopy2 -- use HTTP proxy "foopy" for http URLs,
+ // and use socks4://foopy2 for all other
+ // URLs.
void ParseFromString(const std::string& proxy_rules);
// Returns one of {&proxy_for_http, &proxy_for_https, &proxy_for_ftp,
eroman 2013/03/01 00:05:13 Please update this comment to reflect new names.
marq_use_my_chromium_address 2013/03/04 18:04:20 Done.
// &fallback_proxy}, or NULL if there is no proxy to use.
// Should only call this if the type is TYPE_PROXY_PER_SCHEME.
- const ProxyServer* MapUrlSchemeToProxy(const std::string& url_scheme) const;
+ const ProxyList* MapUrlSchemeToProxy(const std::string& url_scheme) const;
eroman 2013/03/01 00:05:13 Can you rename "ToProxy" --> "ToProxies" or "ToPro
marq_use_my_chromium_address 2013/03/04 18:04:20 Done.
// Returns true if |*this| describes the same configuration as |other|.
bool Equals(const ProxyRules& other) const;
@@ -90,21 +106,22 @@ class NET_EXPORT ProxyConfig {
Type type;
// Set if |type| is TYPE_SINGLE_PROXY.
- ProxyServer single_proxy;
+ ProxyList single_proxies;
eroman 2013/03/01 00:05:13 Side-comment [no action necessary]: Can probably j
marq_use_my_chromium_address 2013/03/04 18:04:20 Ack.
// Set if |type| is TYPE_PROXY_PER_SCHEME.
- ProxyServer proxy_for_http;
- ProxyServer proxy_for_https;
- ProxyServer proxy_for_ftp;
+ ProxyList proxies_for_http;
+ ProxyList proxies_for_https;
+ ProxyList proxies_for_ftp;
- // Used when there isn't a more specific per-scheme proxy server.
- ProxyServer fallback_proxy;
+ // Used when a fallback has been defined and the url to be proxied doesn't
+ // match any of the standard schemes.
+ ProxyList fallback_proxies;
private:
// Returns one of {&proxy_for_http, &proxy_for_https, &proxy_for_ftp}
eroman 2013/03/01 00:05:13 Please update this comment.
marq_use_my_chromium_address 2013/03/04 18:04:20 Done.
// or NULL if it is a scheme that we don't have a mapping
// for. Should only call this if the type is TYPE_PROXY_PER_SCHEME.
- ProxyServer* MapUrlSchemeToProxyNoFallback(const std::string& scheme);
+ ProxyList* MapUrlSchemeToProxyNoFallback(const std::string& scheme);
eroman 2013/03/01 00:05:13 See earlier rename suggestion.
marq_use_my_chromium_address 2013/03/04 18:04:20 Done.
};
typedef int ID;
« no previous file with comments | « no previous file | net/proxy/proxy_config.cc » ('j') | net/proxy/proxy_config.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698