OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_SERVICE_H_ | 5 #ifndef NET_PROXY_PROXY_SERVICE_H_ |
6 #define NET_PROXY_PROXY_SERVICE_H_ | 6 #define NET_PROXY_PROXY_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 215 |
216 // Sends all the unstarted pending requests off to the resolver. | 216 // Sends all the unstarted pending requests off to the resolver. |
217 void ResumeAllPendingRequests(); | 217 void ResumeAllPendingRequests(); |
218 | 218 |
219 // Returns true if |pending_requests_| contains |req|. | 219 // Returns true if |pending_requests_| contains |req|. |
220 bool ContainsPendingRequest(PacRequest* req); | 220 bool ContainsPendingRequest(PacRequest* req); |
221 | 221 |
222 // Removes |req| from the list of pending requests. | 222 // Removes |req| from the list of pending requests. |
223 void RemovePendingRequest(PacRequest* req); | 223 void RemovePendingRequest(PacRequest* req); |
224 | 224 |
225 // Called to indicate that a PacRequest completed. The |config_id| parameter | |
226 // indicates the proxy configuration that was queried. |result_code| is OK | |
227 // if the PAC file could be downloaded and executed. Otherwise, it is an | |
228 // error code, indicating a bad proxy configuration. | |
229 void DidCompletePacRequest(int config_id, int result_code); | |
230 | |
231 // Returns true if the URL passed in should not go through the proxy server. | 225 // Returns true if the URL passed in should not go through the proxy server. |
232 // 1. If the proxy settings say to bypass local names, and |IsLocalName(url)|. | 226 // 1. If the proxy settings say to bypass local names, and |IsLocalName(url)|. |
233 // 2. The URL matches one of the entities in the proxy bypass list. | 227 // 2. The URL matches one of the entities in the proxy bypass list. |
234 bool ShouldBypassProxyForURL(const GURL& url); | 228 bool ShouldBypassProxyForURL(const GURL& url); |
235 | 229 |
236 // Returns true if |url| is to an intranet site (using non-FQDN as the | 230 // Returns true if |url| is to an intranet site (using non-FQDN as the |
237 // heuristic). | 231 // heuristic). |
238 static bool IsLocalName(const GURL& url); | 232 static bool IsLocalName(const GURL& url); |
239 | 233 |
240 // Helper to download the PAC script (wpad + custom) and apply fallback rules. | 234 // Helper to download the PAC script (wpad + custom) and apply fallback rules. |
241 scoped_ptr<InitProxyResolver> init_proxy_resolver_; | 235 scoped_ptr<InitProxyResolver> init_proxy_resolver_; |
242 | 236 |
243 // Log from the *last* time |init_proxy_resolver_.Init()| was called, or NULL. | 237 // Log from the *last* time |init_proxy_resolver_.Init()| was called, or NULL. |
244 scoped_refptr<LoadLog> init_proxy_resolver_log_; | 238 scoped_refptr<LoadLog> init_proxy_resolver_log_; |
245 | 239 |
246 scoped_ptr<ProxyConfigService> config_service_; | 240 scoped_ptr<ProxyConfigService> config_service_; |
247 scoped_ptr<ProxyResolver> resolver_; | 241 scoped_ptr<ProxyResolver> resolver_; |
248 | 242 |
249 // We store the proxy config and a counter (ID) that is incremented each time | 243 // We store the proxy config and a counter (ID) that is incremented each time |
250 // the config changes. | 244 // the config changes. |
251 ProxyConfig config_; | 245 ProxyConfig config_; |
252 | 246 |
253 // Increasing ID to give to the next ProxyConfig that we set. | 247 // Increasing ID to give to the next ProxyConfig that we set. |
254 int next_config_id_; | 248 int next_config_id_; |
255 | 249 |
256 // Indicates that the configuration is bad and should be ignored. | |
257 bool config_is_bad_; | |
258 | |
259 // Indicates whether the ProxyResolver should be sent requests. | 250 // Indicates whether the ProxyResolver should be sent requests. |
260 bool should_use_proxy_resolver_; | 251 bool should_use_proxy_resolver_; |
261 | 252 |
262 // The time when the proxy configuration was last read from the system. | 253 // The time when the proxy configuration was last read from the system. |
263 base::TimeTicks config_last_update_time_; | 254 base::TimeTicks config_last_update_time_; |
264 | 255 |
265 // Map of the known bad proxies and the information about the retry time. | 256 // Map of the known bad proxies and the information about the retry time. |
266 ProxyRetryInfoMap proxy_retry_info_; | 257 ProxyRetryInfoMap proxy_retry_info_; |
267 | 258 |
268 // Set of pending/inprogress requests. | 259 // Set of pending/inprogress requests. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 | 295 |
305 base::WaitableEvent event_; | 296 base::WaitableEvent event_; |
306 CompletionCallbackImpl<SyncProxyServiceHelper> callback_; | 297 CompletionCallbackImpl<SyncProxyServiceHelper> callback_; |
307 ProxyInfo proxy_info_; | 298 ProxyInfo proxy_info_; |
308 int result_; | 299 int result_; |
309 }; | 300 }; |
310 | 301 |
311 } // namespace net | 302 } // namespace net |
312 | 303 |
313 #endif // NET_PROXY_PROXY_SERVICE_H_ | 304 #endif // NET_PROXY_PROXY_SERVICE_H_ |
OLD | NEW |