| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 void ProxyInfo::UseNamedProxy(const std::string& proxy_uri_list) { | 42 void ProxyInfo::UseNamedProxy(const std::string& proxy_uri_list) { |
| 43 Reset(); | 43 Reset(); |
| 44 proxy_list_.Set(proxy_uri_list); | 44 proxy_list_.Set(proxy_uri_list); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void ProxyInfo::UseProxyServer(const ProxyServer& proxy_server) { | 47 void ProxyInfo::UseProxyServer(const ProxyServer& proxy_server) { |
| 48 Reset(); | 48 Reset(); |
| 49 proxy_list_.SetSingleProxyServer(proxy_server); | 49 proxy_list_.SetSingleProxyServer(proxy_server); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void ProxyInfo::UsePacString(const std::string& pac_string) { |
| 53 Reset(); |
| 54 proxy_list_.SetFromPacString(pac_string); |
| 55 } |
| 56 |
| 52 std::string ProxyInfo::ToPacString() const { | 57 std::string ProxyInfo::ToPacString() const { |
| 53 return proxy_list_.ToPacString(); | 58 return proxy_list_.ToPacString(); |
| 54 } | 59 } |
| 55 | 60 |
| 56 bool ProxyInfo::Fallback(const BoundNetLog& net_log) { | 61 bool ProxyInfo::Fallback(const BoundNetLog& net_log) { |
| 57 return proxy_list_.Fallback(&proxy_retry_info_, net_log); | 62 return proxy_list_.Fallback(&proxy_retry_info_, net_log); |
| 58 } | 63 } |
| 59 | 64 |
| 60 void ProxyInfo::DeprioritizeBadProxies( | 65 void ProxyInfo::DeprioritizeBadProxies( |
| 61 const ProxyRetryInfoMap& proxy_retry_info) { | 66 const ProxyRetryInfoMap& proxy_retry_info) { |
| 62 proxy_list_.DeprioritizeBadProxies(proxy_retry_info); | 67 proxy_list_.DeprioritizeBadProxies(proxy_retry_info); |
| 63 } | 68 } |
| 64 | 69 |
| 65 void ProxyInfo::RemoveProxiesWithoutScheme(int scheme_bit_field) { | 70 void ProxyInfo::RemoveProxiesWithoutScheme(int scheme_bit_field) { |
| 66 proxy_list_.RemoveProxiesWithoutScheme(scheme_bit_field); | 71 proxy_list_.RemoveProxiesWithoutScheme(scheme_bit_field); |
| 67 } | 72 } |
| 68 | 73 |
| 69 void ProxyInfo::Reset() { | 74 void ProxyInfo::Reset() { |
| 70 proxy_resolve_start_time_ = base::TimeTicks(); | 75 proxy_resolve_start_time_ = base::TimeTicks(); |
| 71 proxy_resolve_end_time_ = base::TimeTicks(); | 76 proxy_resolve_end_time_ = base::TimeTicks(); |
| 72 proxy_list_.Clear(); | 77 proxy_list_.Clear(); |
| 73 proxy_retry_info_.clear(); | 78 proxy_retry_info_.clear(); |
| 74 config_id_ = ProxyConfig::kInvalidConfigID; | 79 config_id_ = ProxyConfig::kInvalidConfigID; |
| 75 config_source_ = PROXY_CONFIG_SOURCE_UNKNOWN; | 80 config_source_ = PROXY_CONFIG_SOURCE_UNKNOWN; |
| 76 did_bypass_proxy_ = false; | 81 did_bypass_proxy_ = false; |
| 77 did_use_pac_script_ = false; | 82 did_use_pac_script_ = false; |
| 78 } | 83 } |
| 79 | 84 |
| 80 } // namespace net | 85 } // namespace net |
| OLD | NEW |