| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // We use the three possible proxy access types in the following order, | 69 // We use the three possible proxy access types in the following order, |
| 70 // doing fallback if one doesn't work. See "pac_script_decider.h" | 70 // doing fallback if one doesn't work. See "pac_script_decider.h" |
| 71 // for the specifics. | 71 // for the specifics. |
| 72 // 1. WPAD auto-detection | 72 // 1. WPAD auto-detection |
| 73 // 2. PAC URL | 73 // 2. PAC URL |
| 74 // 3. named proxy | 74 // 3. named proxy |
| 75 // | 75 // |
| 76 // Profiling information for the request is saved to |net_log| if non-NULL. | 76 // Profiling information for the request is saved to |net_log| if non-NULL. |
| 77 int ResolveProxy(const GURL& url, | 77 int ResolveProxy(const GURL& url, |
| 78 ProxyInfo* results, | 78 ProxyInfo* results, |
| 79 OldCompletionCallback* callback, | |
| 80 PacRequest** pac_request, | |
| 81 const BoundNetLog& net_log); | |
| 82 int ResolveProxy(const GURL& url, | |
| 83 ProxyInfo* results, | |
| 84 const net::CompletionCallback& callback, | 79 const net::CompletionCallback& callback, |
| 85 PacRequest** pac_request, | 80 PacRequest** pac_request, |
| 86 const BoundNetLog& net_log); | 81 const BoundNetLog& net_log); |
| 87 | 82 |
| 88 // This method is called after a failure to connect or resolve a host name. | 83 // This method is called after a failure to connect or resolve a host name. |
| 89 // It gives the proxy service an opportunity to reconsider the proxy to use. | 84 // It gives the proxy service an opportunity to reconsider the proxy to use. |
| 90 // The |results| parameter contains the results returned by an earlier call | 85 // The |results| parameter contains the results returned by an earlier call |
| 91 // to ResolveProxy. The semantics of this call are otherwise similar to | 86 // to ResolveProxy. The semantics of this call are otherwise similar to |
| 92 // ResolveProxy. | 87 // ResolveProxy. |
| 93 // | 88 // |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 // The fetcher to use when downloading PAC scripts for the ProxyResolver. | 335 // The fetcher to use when downloading PAC scripts for the ProxyResolver. |
| 341 // This dependency can be NULL if our ProxyResolver has no need for | 336 // This dependency can be NULL if our ProxyResolver has no need for |
| 342 // external PAC script fetching. | 337 // external PAC script fetching. |
| 343 scoped_ptr<ProxyScriptFetcher> proxy_script_fetcher_; | 338 scoped_ptr<ProxyScriptFetcher> proxy_script_fetcher_; |
| 344 | 339 |
| 345 // The fetcher to use when attempting to download the most appropriate PAC | 340 // The fetcher to use when attempting to download the most appropriate PAC |
| 346 // script configured in DHCP, if any. Can be NULL if the ProxyResolver has | 341 // script configured in DHCP, if any. Can be NULL if the ProxyResolver has |
| 347 // no need for DHCP PAC script fetching. | 342 // no need for DHCP PAC script fetching. |
| 348 scoped_ptr<DhcpProxyScriptFetcher> dhcp_proxy_script_fetcher_; | 343 scoped_ptr<DhcpProxyScriptFetcher> dhcp_proxy_script_fetcher_; |
| 349 | 344 |
| 350 // Callback for when |init_proxy_resolver_| is done. | |
| 351 OldCompletionCallbackImpl<ProxyService> init_proxy_resolver_callback_; | |
| 352 | |
| 353 // Helper to download the PAC script (wpad + custom) and apply fallback rules. | 345 // Helper to download the PAC script (wpad + custom) and apply fallback rules. |
| 354 // | 346 // |
| 355 // Note that the declaration is important here: |proxy_script_fetcher_| and | 347 // Note that the declaration is important here: |proxy_script_fetcher_| and |
| 356 // |proxy_resolver_| must outlive |init_proxy_resolver_|. | 348 // |proxy_resolver_| must outlive |init_proxy_resolver_|. |
| 357 scoped_ptr<InitProxyResolver> init_proxy_resolver_; | 349 scoped_ptr<InitProxyResolver> init_proxy_resolver_; |
| 358 | 350 |
| 359 State current_state_; | 351 State current_state_; |
| 360 | 352 |
| 361 // Either OK or an ERR_* value indicating that a permanent error (e.g. | 353 // Either OK or an ERR_* value indicating that a permanent error (e.g. |
| 362 // failed to fetch the PAC script) prevents proxy resolution. | 354 // failed to fetch the PAC script) prevents proxy resolution. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 | 397 |
| 406 base::WaitableEvent event_; | 398 base::WaitableEvent event_; |
| 407 CompletionCallback callback_; | 399 CompletionCallback callback_; |
| 408 ProxyInfo proxy_info_; | 400 ProxyInfo proxy_info_; |
| 409 int result_; | 401 int result_; |
| 410 }; | 402 }; |
| 411 | 403 |
| 412 } // namespace net | 404 } // namespace net |
| 413 | 405 |
| 414 #endif // NET_PROXY_PROXY_SERVICE_H_ | 406 #endif // NET_PROXY_PROXY_SERVICE_H_ |
| OLD | NEW |