Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 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 |
| 11 ProxyInfo::ProxyInfo() : config_id_(ProxyConfig::kInvalidConfigID) { | 11 ProxyInfo::ProxyInfo() |
| 12 : config_id_(ProxyConfig::kInvalidConfigID), | |
| 13 config_source_(PROXY_CONFIG_SOURCE_UNKNOWN) { | |
| 12 } | 14 } |
| 13 | 15 |
| 14 ProxyInfo::~ProxyInfo() { | 16 ProxyInfo::~ProxyInfo() { |
| 15 } | 17 } |
| 16 | 18 |
| 17 void ProxyInfo::Use(const ProxyInfo& other) { | 19 void ProxyInfo::Use(const ProxyInfo& other) { |
| 18 proxy_list_ = other.proxy_list_; | 20 proxy_list_ = other.proxy_list_; |
| 19 proxy_retry_info_ = other.proxy_retry_info_; | 21 proxy_retry_info_ = other.proxy_retry_info_; |
|
eroman
2012/05/18 03:58:56
Should this copy the source?
asanka
2012/05/18 16:27:01
The original intent was to set/reset config_id_ an
| |
| 20 } | 22 } |
| 21 | 23 |
| 22 void ProxyInfo::UseDirect() { | 24 void ProxyInfo::UseDirect() { |
| 23 proxy_list_.SetSingleProxyServer(ProxyServer::Direct()); | 25 proxy_list_.SetSingleProxyServer(ProxyServer::Direct()); |
| 24 proxy_retry_info_.clear(); | 26 proxy_retry_info_.clear(); |
|
eroman
2012/05/18 03:58:56
Should this reset the source too?
asanka
2012/05/18 16:27:01
Done. See above.
| |
| 25 } | 27 } |
| 26 | 28 |
| 27 void ProxyInfo::UseNamedProxy(const std::string& proxy_uri_list) { | 29 void ProxyInfo::UseNamedProxy(const std::string& proxy_uri_list) { |
| 28 proxy_list_.Set(proxy_uri_list); | 30 proxy_list_.Set(proxy_uri_list); |
| 29 proxy_retry_info_.clear(); | 31 proxy_retry_info_.clear(); |
|
eroman
2012/05/18 03:58:56
Should this reset the source too?
asanka
2012/05/18 16:27:01
Done. See above.
| |
| 30 } | 32 } |
| 31 | 33 |
| 32 void ProxyInfo::UseProxyServer(const ProxyServer& proxy_server) { | 34 void ProxyInfo::UseProxyServer(const ProxyServer& proxy_server) { |
| 33 proxy_list_.SetSingleProxyServer(proxy_server); | 35 proxy_list_.SetSingleProxyServer(proxy_server); |
| 34 proxy_retry_info_.clear(); | 36 proxy_retry_info_.clear(); |
|
eroman
2012/05/18 03:58:56
Should this reset the source too?
asanka
2012/05/18 16:27:01
Done. See above.
| |
| 35 } | 37 } |
| 36 | 38 |
| 37 std::string ProxyInfo::ToPacString() const { | 39 std::string ProxyInfo::ToPacString() const { |
| 38 return proxy_list_.ToPacString(); | 40 return proxy_list_.ToPacString(); |
| 39 } | 41 } |
| 40 | 42 |
| 41 bool ProxyInfo::Fallback(const BoundNetLog& net_log) { | 43 bool ProxyInfo::Fallback(const BoundNetLog& net_log) { |
| 42 return proxy_list_.Fallback(&proxy_retry_info_, net_log); | 44 return proxy_list_.Fallback(&proxy_retry_info_, net_log); |
| 43 } | 45 } |
| 44 | 46 |
| 45 void ProxyInfo::DeprioritizeBadProxies( | 47 void ProxyInfo::DeprioritizeBadProxies( |
| 46 const ProxyRetryInfoMap& proxy_retry_info) { | 48 const ProxyRetryInfoMap& proxy_retry_info) { |
| 47 proxy_list_.DeprioritizeBadProxies(proxy_retry_info); | 49 proxy_list_.DeprioritizeBadProxies(proxy_retry_info); |
| 48 } | 50 } |
| 49 | 51 |
| 50 void ProxyInfo::RemoveProxiesWithoutScheme(int scheme_bit_field) { | 52 void ProxyInfo::RemoveProxiesWithoutScheme(int scheme_bit_field) { |
| 51 proxy_list_.RemoveProxiesWithoutScheme(scheme_bit_field); | 53 proxy_list_.RemoveProxiesWithoutScheme(scheme_bit_field); |
| 52 } | 54 } |
| 53 | 55 |
| 54 } // namespace net | 56 } // namespace net |
| OLD | NEW |