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 #ifndef NET_PROXY_PROXY_INFO_H_ | 5 #ifndef NET_PROXY_PROXY_INFO_H_ |
6 #define NET_PROXY_PROXY_INFO_H_ | 6 #define NET_PROXY_PROXY_INFO_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "net/base/net_export.h" | 11 #include "net/base/net_export.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 // Returns true if this proxy info has no proxies left to try. | 76 // Returns true if this proxy info has no proxies left to try. |
77 bool is_empty() const { | 77 bool is_empty() const { |
78 return proxy_list_.IsEmpty(); | 78 return proxy_list_.IsEmpty(); |
79 } | 79 } |
80 | 80 |
81 // Returns the first valid proxy server. is_empty() must be false to be able | 81 // Returns the first valid proxy server. is_empty() must be false to be able |
82 // to call this function. | 82 // to call this function. |
83 const ProxyServer& proxy_server() const { return proxy_list_.Get(); } | 83 const ProxyServer& proxy_server() const { return proxy_list_.Get(); } |
84 | 84 |
| 85 // Returns the source for configuration settings used for proxy resolution. |
| 86 ProxyConfigSource config_source() const { return config_source_; } |
| 87 |
85 // See description in ProxyList::ToPacString(). | 88 // See description in ProxyList::ToPacString(). |
86 std::string ToPacString() const; | 89 std::string ToPacString() const; |
87 | 90 |
88 // Marks the current proxy as bad. Returns true if there is another proxy | 91 // Marks the current proxy as bad. Returns true if there is another proxy |
89 // available to try in proxy list_. | 92 // available to try in proxy list_. |
90 bool Fallback(const BoundNetLog& net_log); | 93 bool Fallback(const BoundNetLog& net_log); |
91 | 94 |
92 // De-prioritizes the proxies that we have cached as not working, by moving | 95 // De-prioritizes the proxies that we have cached as not working, by moving |
93 // them to the end of the proxy list. | 96 // them to the end of the proxy list. |
94 void DeprioritizeBadProxies(const ProxyRetryInfoMap& proxy_retry_info); | 97 void DeprioritizeBadProxies(const ProxyRetryInfoMap& proxy_retry_info); |
(...skipping 10 matching lines...) Expand all Loading... |
105 | 108 |
106 // The ordered list of proxy servers (including DIRECT attempts) remaining to | 109 // The ordered list of proxy servers (including DIRECT attempts) remaining to |
107 // try. If proxy_list_ is empty, then there is nothing left to fall back to. | 110 // try. If proxy_list_ is empty, then there is nothing left to fall back to. |
108 ProxyList proxy_list_; | 111 ProxyList proxy_list_; |
109 | 112 |
110 // List of proxies that have been tried already. | 113 // List of proxies that have been tried already. |
111 ProxyRetryInfoMap proxy_retry_info_; | 114 ProxyRetryInfoMap proxy_retry_info_; |
112 | 115 |
113 // This value identifies the proxy config used to initialize this object. | 116 // This value identifies the proxy config used to initialize this object. |
114 ProxyConfig::ID config_id_; | 117 ProxyConfig::ID config_id_; |
| 118 |
| 119 // The source of the proxy settings used, |
| 120 ProxyConfigSource config_source_; |
115 }; | 121 }; |
116 | 122 |
117 } // namespace net | 123 } // namespace net |
118 | 124 |
119 #endif // NET_PROXY_PROXY_INFO_H_ | 125 #endif // NET_PROXY_PROXY_INFO_H_ |
OLD | NEW |