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

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

Issue 10534102: [net] Connect DNS signals to re-fetching PAC script. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 3 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
« no previous file with comments | « no previous file | net/proxy/proxy_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 25 matching lines...) Expand all
36 class NetworkDelegate; 36 class NetworkDelegate;
37 class ProxyResolver; 37 class ProxyResolver;
38 class ProxyResolverScriptData; 38 class ProxyResolverScriptData;
39 class ProxyScriptDecider; 39 class ProxyScriptDecider;
40 class ProxyScriptFetcher; 40 class ProxyScriptFetcher;
41 41
42 // This class can be used to resolve the proxy server to use when loading a 42 // This class can be used to resolve the proxy server to use when loading a
43 // HTTP(S) URL. It uses the given ProxyResolver to handle the actual proxy 43 // HTTP(S) URL. It uses the given ProxyResolver to handle the actual proxy
44 // resolution. See ProxyResolverV8 for example. 44 // resolution. See ProxyResolverV8 for example.
45 class NET_EXPORT ProxyService : public NetworkChangeNotifier::IPAddressObserver, 45 class NET_EXPORT ProxyService : public NetworkChangeNotifier::IPAddressObserver,
46 public NetworkChangeNotifier::DNSObserver,
46 public ProxyConfigService::Observer, 47 public ProxyConfigService::Observer,
47 NON_EXPORTED_BASE(public base::NonThreadSafe) { 48 NON_EXPORTED_BASE(public base::NonThreadSafe) {
48 public: 49 public:
49 static const size_t kDefaultNumPacThreads = 4; 50 static const size_t kDefaultNumPacThreads = 4;
50 51
51 // This interface defines the set of policies for when to poll the PAC 52 // This interface defines the set of policies for when to poll the PAC
52 // script for changes. 53 // script for changes.
53 // 54 //
54 // The polling policy decides what the next poll delay should be in 55 // The polling policy decides what the next poll delay should be in
55 // milliseconds. It also decides how to wait for this delay -- either 56 // milliseconds. It also decides how to wait for this delay -- either
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 // Start the initialization skipping past the "decision" phase. 319 // Start the initialization skipping past the "decision" phase.
319 void InitializeUsingDecidedConfig( 320 void InitializeUsingDecidedConfig(
320 int decider_result, 321 int decider_result,
321 ProxyResolverScriptData* script_data, 322 ProxyResolverScriptData* script_data,
322 const ProxyConfig& effective_config); 323 const ProxyConfig& effective_config);
323 324
324 // NetworkChangeNotifier::IPAddressObserver 325 // NetworkChangeNotifier::IPAddressObserver
325 // When this is called, we re-fetch PAC scripts and re-run WPAD. 326 // When this is called, we re-fetch PAC scripts and re-run WPAD.
326 virtual void OnIPAddressChanged() OVERRIDE; 327 virtual void OnIPAddressChanged() OVERRIDE;
327 328
329 // NetworkChangeNotifier::DNSObserver
330 // We respond as above.
331 virtual void OnDNSChanged() OVERRIDE;
332
328 // ProxyConfigService::Observer 333 // ProxyConfigService::Observer
329 virtual void OnProxyConfigChanged( 334 virtual void OnProxyConfigChanged(
330 const ProxyConfig& config, 335 const ProxyConfig& config,
331 ProxyConfigService::ConfigAvailability availability) OVERRIDE; 336 ProxyConfigService::ConfigAvailability availability) OVERRIDE;
332 337
333 scoped_ptr<ProxyConfigService> config_service_; 338 scoped_ptr<ProxyConfigService> config_service_;
334 scoped_ptr<ProxyResolver> resolver_; 339 scoped_ptr<ProxyResolver> resolver_;
335 340
336 // We store the proxy configuration that was last fetched from the 341 // We store the proxy configuration that was last fetched from the
337 // ProxyConfigService, as well as the resulting "effective" configuration. 342 // ProxyConfigService, as well as the resulting "effective" configuration.
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 426
422 base::WaitableEvent event_; 427 base::WaitableEvent event_;
423 CompletionCallback callback_; 428 CompletionCallback callback_;
424 ProxyInfo proxy_info_; 429 ProxyInfo proxy_info_;
425 int result_; 430 int result_;
426 }; 431 };
427 432
428 } // namespace net 433 } // namespace net
429 434
430 #endif // NET_PROXY_PROXY_SERVICE_H_ 435 #endif // NET_PROXY_PROXY_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | net/proxy/proxy_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698