1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "net/proxy/proxy_info.h" 6 7 #include "net/proxy/proxy_retry_info.h" 8 9 namespace net { 10 11 ProxyInfo::ProxyInfo() : config_id_(ProxyConfig::INVALID_ID) { 12 } 13 14 ProxyInfo::~ProxyInfo() { 15 } 16 17 void ProxyInfo::Use(const ProxyInfo& other) { 18 proxy_list_ = other.proxy_list_; 19 } 20 21 void ProxyInfo::UseDirect() { 22 proxy_list_.SetSingleProxyServer(ProxyServer::Direct()); 23 } 24 25 void ProxyInfo::UseNamedProxy(const std::string& proxy_uri_list) { 26 proxy_list_.Set(proxy_uri_list); 27 } 28 29 void ProxyInfo::UseProxyServer(const ProxyServer& proxy_server) { 30 proxy_list_.SetSingleProxyServer(proxy_server); 31 } 32 33 std::string ProxyInfo::ToPacString() const { 34 return proxy_list_.ToPacString(); 35 } 36 37 bool ProxyInfo::Fallback(ProxyRetryInfoMap* proxy_retry_info) { 38 return proxy_list_.Fallback(proxy_retry_info); 39 } 40 41 void ProxyInfo::DeprioritizeBadProxies( 42 const ProxyRetryInfoMap& proxy_retry_info) { 43 proxy_list_.DeprioritizeBadProxies(proxy_retry_info); 44 } 45 46 void ProxyInfo::RemoveProxiesWithoutScheme(int scheme_bit_field) { 47 proxy_list_.RemoveProxiesWithoutScheme(scheme_bit_field); 48 } 49 50 } // namespace net 51