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

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, 9 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 | « 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..4a4950119fcbdcc505231ea899c9d01b1f25fd7a 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 proxies_ == other.proxies_;
+}
+
const ProxyServer& ProxyList::Get() const {
DCHECK(!proxies_.empty());
return proxies_[0];
« no previous file with comments | « net/proxy/proxy_list.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698