summaryrefslogtreecommitdiffstats
path: root/net/proxy/proxy_list.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/proxy/proxy_list.cc')
-rw-r--r--net/proxy/proxy_list.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/proxy/proxy_list.cc b/net/proxy/proxy_list.cc
index 1b2ecc7..4a49501 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];