Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Side by Side Diff: net/proxy/proxy_info.h

Issue 10310179: Track sources of proxy settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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);
95 98
96 // Deletes any entry which doesn't have one of the specified proxy schemes. 99 // Deletes any entry which doesn't have one of the specified proxy schemes.
97 void RemoveProxiesWithoutScheme(int scheme_bit_field); 100 void RemoveProxiesWithoutScheme(int scheme_bit_field);
98 101
99 private: 102 private:
100 friend class ProxyService; 103 friend class ProxyService;
101 104
102 const ProxyRetryInfoMap& proxy_retry_info() const { 105 const ProxyRetryInfoMap& proxy_retry_info() const {
103 return proxy_retry_info_; 106 return proxy_retry_info_;
104 } 107 }
105 108
109 // Reset proxy and config settings.
110 void Reset();
111
106 // The ordered list of proxy servers (including DIRECT attempts) remaining to 112 // 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. 113 // try. If proxy_list_ is empty, then there is nothing left to fall back to.
108 ProxyList proxy_list_; 114 ProxyList proxy_list_;
109 115
110 // List of proxies that have been tried already. 116 // List of proxies that have been tried already.
111 ProxyRetryInfoMap proxy_retry_info_; 117 ProxyRetryInfoMap proxy_retry_info_;
112 118
113 // This value identifies the proxy config used to initialize this object. 119 // This value identifies the proxy config used to initialize this object.
114 ProxyConfig::ID config_id_; 120 ProxyConfig::ID config_id_;
121
122 // The source of the proxy settings used,
123 ProxyConfigSource config_source_;
115 }; 124 };
116 125
117 } // namespace net 126 } // namespace net
118 127
119 #endif // NET_PROXY_PROXY_INFO_H_ 128 #endif // NET_PROXY_PROXY_INFO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698