OLD | NEW |
1 // Copyright (c) 2012 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_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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // | 117 // |
118 // We use the three possible proxy access types in the following order, | 118 // We use the three possible proxy access types in the following order, |
119 // doing fallback if one doesn't work. See "pac_script_decider.h" | 119 // doing fallback if one doesn't work. See "pac_script_decider.h" |
120 // for the specifics. | 120 // for the specifics. |
121 // 1. WPAD auto-detection | 121 // 1. WPAD auto-detection |
122 // 2. PAC URL | 122 // 2. PAC URL |
123 // 3. named proxy | 123 // 3. named proxy |
124 // | 124 // |
125 // Profiling information for the request is saved to |net_log| if non-NULL. | 125 // Profiling information for the request is saved to |net_log| if non-NULL. |
126 int ResolveProxy(const GURL& url, | 126 int ResolveProxy(const GURL& url, |
| 127 int load_flags, |
127 ProxyInfo* results, | 128 ProxyInfo* results, |
128 const net::CompletionCallback& callback, | 129 const net::CompletionCallback& callback, |
129 PacRequest** pac_request, | 130 PacRequest** pac_request, |
| 131 NetworkDelegate* network_delegate, |
130 const BoundNetLog& net_log); | 132 const BoundNetLog& net_log); |
131 | 133 |
132 // This method is called after a failure to connect or resolve a host name. | 134 // This method is called after a failure to connect or resolve a host name. |
133 // It gives the proxy service an opportunity to reconsider the proxy to use. | 135 // It gives the proxy service an opportunity to reconsider the proxy to use. |
134 // The |results| parameter contains the results returned by an earlier call | 136 // The |results| parameter contains the results returned by an earlier call |
135 // to ResolveProxy. The |net_error| parameter contains the network error | 137 // to ResolveProxy. The |net_error| parameter contains the network error |
136 // code associated with the failure. See "net/base/net_error_list.h" for a | 138 // code associated with the failure. See "net/base/net_error_list.h" for a |
137 // list of possible values. The semantics of this call are otherwise | 139 // list of possible values. The semantics of this call are otherwise |
138 // similar to ResolveProxy. | 140 // similar to ResolveProxy. |
139 // | 141 // |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 // starts initializing for it. | 346 // starts initializing for it. |
345 void ApplyProxyConfigIfAvailable(); | 347 void ApplyProxyConfigIfAvailable(); |
346 | 348 |
347 // Callback for when the proxy resolver has been initialized with a | 349 // Callback for when the proxy resolver has been initialized with a |
348 // PAC script. | 350 // PAC script. |
349 void OnInitProxyResolverComplete(int result); | 351 void OnInitProxyResolverComplete(int result); |
350 | 352 |
351 // Returns ERR_IO_PENDING if the request cannot be completed synchronously. | 353 // Returns ERR_IO_PENDING if the request cannot be completed synchronously. |
352 // Otherwise it fills |result| with the proxy information for |url|. | 354 // Otherwise it fills |result| with the proxy information for |url|. |
353 // Completing synchronously means we don't need to query ProxyResolver. | 355 // Completing synchronously means we don't need to query ProxyResolver. |
354 int TryToCompleteSynchronously(const GURL& url, ProxyInfo* result); | 356 int TryToCompleteSynchronously(const GURL& url, int load_flags, |
| 357 NetworkDelegate* network_delegate, |
| 358 ProxyInfo* result); |
355 | 359 |
356 // Cancels all of the requests sent to the ProxyResolver. These will be | 360 // Cancels all of the requests sent to the ProxyResolver. These will be |
357 // restarted when calling SetReady(). | 361 // restarted when calling SetReady(). |
358 void SuspendAllPendingRequests(); | 362 void SuspendAllPendingRequests(); |
359 | 363 |
360 // Advances the current state to |STATE_READY|, and resumes any pending | 364 // Advances the current state to |STATE_READY|, and resumes any pending |
361 // requests which had been stalled waiting for initialization to complete. | 365 // requests which had been stalled waiting for initialization to complete. |
362 void SetReady(); | 366 void SetReady(); |
363 | 367 |
364 // Returns true if |pending_requests_| contains |req|. | 368 // Returns true if |pending_requests_| contains |req|. |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 | 497 |
494 base::WaitableEvent event_; | 498 base::WaitableEvent event_; |
495 CompletionCallback callback_; | 499 CompletionCallback callback_; |
496 ProxyInfo proxy_info_; | 500 ProxyInfo proxy_info_; |
497 int result_; | 501 int result_; |
498 }; | 502 }; |
499 | 503 |
500 } // namespace net | 504 } // namespace net |
501 | 505 |
502 #endif // NET_PROXY_PROXY_SERVICE_H_ | 506 #endif // NET_PROXY_PROXY_SERVICE_H_ |
OLD | NEW |