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