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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
216 | 216 |
217 // Returns the LoadState for this |pac_request| which must be non-NULL. | 217 // Returns the LoadState for this |pac_request| which must be non-NULL. |
218 LoadState GetLoadState(const PacRequest* pac_request) const; | 218 LoadState GetLoadState(const PacRequest* pac_request) const; |
219 | 219 |
220 // Sets the ProxyScriptFetcher and DhcpProxyScriptFetcher dependencies. This | 220 // Sets the ProxyScriptFetcher and DhcpProxyScriptFetcher dependencies. This |
221 // is needed if the ProxyResolver is of type ProxyResolverWithoutFetch. | 221 // is needed if the ProxyResolver is of type ProxyResolverWithoutFetch. |
222 // ProxyService takes ownership of proxy_script_fetcher. | 222 // ProxyService takes ownership of proxy_script_fetcher. |
223 void SetProxyScriptFetchers( | 223 void SetProxyScriptFetchers( |
224 ProxyScriptFetcher* proxy_script_fetcher, | 224 ProxyScriptFetcher* proxy_script_fetcher, |
225 std::unique_ptr<DhcpProxyScriptFetcher> dhcp_proxy_script_fetcher); | 225 std::unique_ptr<DhcpProxyScriptFetcher> dhcp_proxy_script_fetcher); |
226 ProxyScriptFetcher* GetProxyScriptFetcher() const; | 226 |
227 // Cancels all activity (including network requests), and causes new and | |
228 // in-progress resolutions to just hang. This is needed to breat the circular | |
eroman
2017/04/27 19:35:42
breat -> break
| |
229 // dependency when the ProxyService a URLRequestContext is using also uses | |
eroman
2017/04/27 19:35:42
wording
| |
230 // that URLRequestContext to make requests. | |
231 void ShutDown(); | |
227 | 232 |
228 // Tells this ProxyService to start using a new ProxyConfigService to | 233 // Tells this ProxyService to start using a new ProxyConfigService to |
229 // retrieve its ProxyConfig from. The new ProxyConfigService will immediately | 234 // retrieve its ProxyConfig from. The new ProxyConfigService will immediately |
230 // be queried for new config info which will be used for all subsequent | 235 // be queried for new config info which will be used for all subsequent |
231 // ResolveProxy calls. | 236 // ResolveProxy calls. |
232 void ResetConfigService( | 237 void ResetConfigService( |
233 std::unique_ptr<ProxyConfigService> new_proxy_config_service); | 238 std::unique_ptr<ProxyConfigService> new_proxy_config_service); |
234 | 239 |
235 // Returns the last configuration fetched from ProxyConfigService. | 240 // Returns the last configuration fetched from ProxyConfigService. |
236 const ProxyConfig& fetched_config() { | 241 const ProxyConfig& fetched_config() { |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
323 class InitProxyResolver; | 328 class InitProxyResolver; |
324 class ProxyScriptDeciderPoller; | 329 class ProxyScriptDeciderPoller; |
325 | 330 |
326 typedef std::set<scoped_refptr<PacRequest>> PendingRequests; | 331 typedef std::set<scoped_refptr<PacRequest>> PendingRequests; |
327 | 332 |
328 enum State { | 333 enum State { |
329 STATE_NONE, | 334 STATE_NONE, |
330 STATE_WAITING_FOR_PROXY_CONFIG, | 335 STATE_WAITING_FOR_PROXY_CONFIG, |
331 STATE_WAITING_FOR_INIT_PROXY_RESOLVER, | 336 STATE_WAITING_FOR_INIT_PROXY_RESOLVER, |
332 STATE_READY, | 337 STATE_READY, |
338 STATE_SHUTDOWN, | |
333 }; | 339 }; |
334 | 340 |
335 // Resets all the variables associated with the current proxy configuration, | 341 // Resets all the variables associated with the current proxy configuration, |
336 // and rewinds the current state to |STATE_NONE|. Returns the previous value | 342 // and rewinds the current state to |STATE_NONE|. Returns the previous value |
337 // of |current_state_|. If |reset_fetched_config| is true then | 343 // of |current_state_|. If |reset_fetched_config| is true then |
338 // |fetched_config_| will also be reset, otherwise it will be left as-is. | 344 // |fetched_config_| will also be reset, otherwise it will be left as-is. |
339 // Resetting it means that we will have to re-fetch the configuration from | 345 // Resetting it means that we will have to re-fetch the configuration from |
340 // the ProxyConfigService later. | 346 // the ProxyConfigService later. |
341 State ResetProxyConfig(bool reset_fetched_config); | 347 State ResetProxyConfig(bool reset_fetched_config); |
342 | 348 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
479 | 485 |
480 // The method to use for sanitizing URLs seen by the proxy resolver. | 486 // The method to use for sanitizing URLs seen by the proxy resolver. |
481 SanitizeUrlPolicy sanitize_url_policy_; | 487 SanitizeUrlPolicy sanitize_url_policy_; |
482 | 488 |
483 DISALLOW_COPY_AND_ASSIGN(ProxyService); | 489 DISALLOW_COPY_AND_ASSIGN(ProxyService); |
484 }; | 490 }; |
485 | 491 |
486 } // namespace net | 492 } // namespace net |
487 | 493 |
488 #endif // NET_PROXY_PROXY_SERVICE_H_ | 494 #endif // NET_PROXY_PROXY_SERVICE_H_ |
OLD | NEW |