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

Unified Diff: net/proxy/proxy_list.cc

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
« net/proxy/proxy_config_unittest.cc ('K') | « net/proxy/proxy_list.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_list.cc
diff --git a/net/proxy/proxy_list.cc b/net/proxy/proxy_list.cc
index 1b2ecc73aef6269001dfff64e647d45499ecc5c8..eb8fed068017953c5f6b5b79c8d97e4d2a650850 100644
--- a/net/proxy/proxy_list.cc
+++ b/net/proxy/proxy_list.cc
@@ -35,6 +35,10 @@ void ProxyList::Set(const std::string& proxy_uri_list) {
void ProxyList::SetSingleProxyServer(const ProxyServer& proxy_server) {
proxies_.clear();
+ AddProxyServer(proxy_server);
+}
+
+void ProxyList::AddProxyServer(const ProxyServer& proxy_server) {
if (proxy_server.is_valid())
proxies_.push_back(proxy_server);
}
@@ -110,6 +114,13 @@ size_t ProxyList::size() const {
return proxies_.size();
}
+// Returns true if |*this| lists the same proxies as |other|.
+bool ProxyList::Equals(const ProxyList& other) const {
+ if (size() != other.size())
+ return false;
+ return ToPacString() == other.ToPacString();
eroman 2013/02/26 01:13:50 Not ideal. I will allow it though.
marq_use_my_chromium_address 2013/02/27 23:08:19 ProxyServer has an == operator, so I can just comp
+}
+
const ProxyServer& ProxyList::Get() const {
DCHECK(!proxies_.empty());
return proxies_[0];
« net/proxy/proxy_config_unittest.cc ('K') | « net/proxy/proxy_list.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698