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

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

Issue 11620007: Switch from OnIPAddressChanged and OnConnectionTypeChange to OnNetworkChanged Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
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 24 matching lines...) Expand all
35 class HostResolver; 35 class HostResolver;
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
46 public NetworkChangeNotifier::DNSObserver, 46 : public NetworkChangeNotifier::NetworkChangeObserver,
47 public ProxyConfigService::Observer, 47 public NetworkChangeNotifier::DNSObserver,
48 NON_EXPORTED_BASE(public base::NonThreadSafe) { 48 public ProxyConfigService::Observer,
49 NON_EXPORTED_BASE(public base::NonThreadSafe) {
49 public: 50 public:
50 static const size_t kDefaultNumPacThreads = 4; 51 static const size_t kDefaultNumPacThreads = 4;
51 52
52 // This interface defines the set of policies for when to poll the PAC 53 // This interface defines the set of policies for when to poll the PAC
53 // script for changes. 54 // script for changes.
54 // 55 //
55 // The polling policy decides what the next poll delay should be in 56 // The polling policy decides what the next poll delay should be in
56 // milliseconds. It also decides how to wait for this delay -- either 57 // milliseconds. It also decides how to wait for this delay -- either
57 // by starting a timer to do the poll at exactly |next_delay_ms| 58 // by starting a timer to do the poll at exactly |next_delay_ms|
58 // (MODE_USE_TIMER) or by waiting for the first network request issued after 59 // (MODE_USE_TIMER) or by waiting for the first network request issued after
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 322
322 // Start initialization using |fetched_config_|. 323 // Start initialization using |fetched_config_|.
323 void InitializeUsingLastFetchedConfig(); 324 void InitializeUsingLastFetchedConfig();
324 325
325 // Start the initialization skipping past the "decision" phase. 326 // Start the initialization skipping past the "decision" phase.
326 void InitializeUsingDecidedConfig( 327 void InitializeUsingDecidedConfig(
327 int decider_result, 328 int decider_result,
328 ProxyResolverScriptData* script_data, 329 ProxyResolverScriptData* script_data,
329 const ProxyConfig& effective_config); 330 const ProxyConfig& effective_config);
330 331
331 // NetworkChangeNotifier::IPAddressObserver 332 // NetworkChangeNotifier::NetworkChangeObserver
332 // When this is called, we re-fetch PAC scripts and re-run WPAD. 333 // When this is called, we re-fetch PAC scripts and re-run WPAD.
333 virtual void OnIPAddressChanged() OVERRIDE; 334 virtual void OnNetworkChanged(
335 net::NetworkChangeNotifier::ConnectionType type) OVERRIDE;
334 336
335 // NetworkChangeNotifier::DNSObserver 337 // NetworkChangeNotifier::DNSObserver
336 // We respond as above. 338 // We respond as above.
337 virtual void OnDNSChanged() OVERRIDE; 339 virtual void OnDNSChanged() OVERRIDE;
338 340
339 // ProxyConfigService::Observer 341 // ProxyConfigService::Observer
340 virtual void OnProxyConfigChanged( 342 virtual void OnProxyConfigChanged(
341 const ProxyConfig& config, 343 const ProxyConfig& config,
342 ProxyConfigService::ConfigAvailability availability) OVERRIDE; 344 ProxyConfigService::ConfigAvailability availability) OVERRIDE;
343 345
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 434
433 base::WaitableEvent event_; 435 base::WaitableEvent event_;
434 CompletionCallback callback_; 436 CompletionCallback callback_;
435 ProxyInfo proxy_info_; 437 ProxyInfo proxy_info_;
436 int result_; 438 int result_;
437 }; 439 };
438 440
439 } // namespace net 441 } // namespace net
440 442
441 #endif // NET_PROXY_PROXY_SERVICE_H_ 443 #endif // NET_PROXY_PROXY_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698