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

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..5cca88754dc7515cdf9f02604245b85172171700 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 {
@@ -64,6 +65,12 @@ class NET_EXPORT ProxyConfig {
//
// <url-scheme>"="<proxy-uri>
//
+ //
+ // Multiple values can be specified for any given scheme, and they will
+ // be appended to the ProxyList for that scheme. If 'socks' is specified
+ // as a scheme, any schemes left without proxies specified will have
+ // that 'socks' server added.
eroman 2013/02/26 01:13:50 What about instead changing the grammar from: ur
marq_use_my_chromium_address 2013/02/27 23:08:19 Using this format to set things is the current pla
+ //
// For example:
// "http=foopy:80;ftp=foopy2" -- use HTTP proxy "foopy:80" for http://
// URLs, and HTTP proxy "foopy2:80" for
@@ -71,12 +78,21 @@ class NET_EXPORT ProxyConfig {
// "foopy:80" -- use HTTP proxy "foopy:80" for all URLs.
// "socks4://foopy" -- use SOCKS v4 proxy "foopy:1080" for all
// URLs.
+ // "http=foopy;http=bar.com; -- use HTTP proxy "foopy" for http URLs,
+ // and fail over to "bar.com" if "foopy"
+ // is unavailable.
+ // "http=foopy;http=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,
// &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;
// 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_proxy;
eroman 2013/02/26 01:13:50 These names are no longer good, since they are act
marq_use_my_chromium_address 2013/02/27 23:08:19 Done.
// Set if |type| is TYPE_PROXY_PER_SCHEME.
- ProxyServer proxy_for_http;
- ProxyServer proxy_for_https;
- ProxyServer proxy_for_ftp;
+ ProxyList proxy_for_http;
+ ProxyList proxy_for_https;
+ ProxyList proxy_for_ftp;
- // Used when there isn't a more specific per-scheme proxy server.
- ProxyServer fallback_proxy;
+ // Used when a fallback (a socks= scheme) has been defined and the
eroman 2013/02/26 01:13:50 I don't think this comment should mention socks= h
marq_use_my_chromium_address 2013/02/27 23:08:19 Done.
+ // url to be proxied doesn't match any of the standard schemes.
+ ProxyList fallback_proxy;
private:
// Returns one of {&proxy_for_http, &proxy_for_https, &proxy_for_ftp}
// 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);
};
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