| 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 CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 6 #define CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 namespace prerender { | 66 namespace prerender { |
| 67 class PrerenderTracker; | 67 class PrerenderTracker; |
| 68 } | 68 } |
| 69 | 69 |
| 70 // ChromeNetworkDelegate is the central point from within the chrome code to | 70 // ChromeNetworkDelegate is the central point from within the chrome code to |
| 71 // add hooks into the network stack. | 71 // add hooks into the network stack. |
| 72 class ChromeNetworkDelegate : public net::NetworkDelegate { | 72 class ChromeNetworkDelegate : public net::NetworkDelegate { |
| 73 public: | 73 public: |
| 74 // Provides an opportunity to interpose on proxy resolution. Called before | 74 // Provides an opportunity to interpose on proxy resolution. Called before |
| 75 // ProxyService.ResolveProxy() returns. |proxy_info| contains information | 75 // ProxyService.ResolveProxy() returns. Two proxy configurations are provided |
| 76 // about the proxy being used, and may be modified by this callback. | 76 // that specify the data reduction proxy's configuration and the effective |
| 77 // configuration according to the proxy service, respectively. Retry info is |
| 78 // presumed to be from the proxy service. |
| 77 typedef base::Callback<void( | 79 typedef base::Callback<void( |
| 78 const GURL& url, | 80 const GURL& url, |
| 79 int load_flags, | 81 int load_flags, |
| 80 const net::ProxyConfig& data_reduction_proxy_config, | 82 const net::ProxyConfig& data_reduction_proxy_config, |
| 83 const net::ProxyConfig& proxy_service_proxy_config, |
| 81 const net::ProxyRetryInfoMap& proxy_retry_info_map, | 84 const net::ProxyRetryInfoMap& proxy_retry_info_map, |
| 82 const data_reduction_proxy::DataReductionProxyParams* params, | 85 const data_reduction_proxy::DataReductionProxyParams* params, |
| 83 net::ProxyInfo* result)> OnResolveProxyHandler; | 86 net::ProxyInfo* result)> OnResolveProxyHandler; |
| 84 | 87 |
| 85 // Provides an additional proxy configuration that can be consulted after | 88 // Provides an additional proxy configuration that can be consulted after |
| 86 // proxy resolution. | 89 // proxy resolution. |
| 87 typedef base::Callback<const net::ProxyConfig&()> ProxyConfigGetter; | 90 typedef base::Callback<const net::ProxyConfig&()> ProxyConfigGetter; |
| 88 | 91 |
| 89 // |enable_referrers| (and all of the other optional PrefMembers) should be | 92 // |enable_referrers| (and all of the other optional PrefMembers) should be |
| 90 // initialized on the UI thread (see below) beforehand. This object's owner is | 93 // initialized on the UI thread (see below) beforehand. This object's owner is |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 data_reduction_proxy::DataReductionProxyStatisticsPrefs* | 330 data_reduction_proxy::DataReductionProxyStatisticsPrefs* |
| 328 data_reduction_proxy_statistics_prefs_; | 331 data_reduction_proxy_statistics_prefs_; |
| 329 | 332 |
| 330 OnResolveProxyHandler on_resolve_proxy_handler_; | 333 OnResolveProxyHandler on_resolve_proxy_handler_; |
| 331 ProxyConfigGetter proxy_config_getter_; | 334 ProxyConfigGetter proxy_config_getter_; |
| 332 | 335 |
| 333 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); | 336 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); |
| 334 }; | 337 }; |
| 335 | 338 |
| 336 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 339 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
| OLD | NEW |