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 17 matching lines...) Expand all Loading... |
28 namespace base { | 28 namespace base { |
29 class Value; | 29 class Value; |
30 } | 30 } |
31 | 31 |
32 namespace chrome_browser_net { | 32 namespace chrome_browser_net { |
33 class ConnectInterceptor; | 33 class ConnectInterceptor; |
34 class Predictor; | 34 class Predictor; |
35 } | 35 } |
36 | 36 |
37 namespace data_reduction_proxy { | 37 namespace data_reduction_proxy { |
| 38 class DataReductionProxyAuthRequestHandler; |
38 class DataReductionProxyParams; | 39 class DataReductionProxyParams; |
39 class DataReductionProxyUsageStats; | 40 class DataReductionProxyUsageStats; |
40 } | 41 } |
41 | 42 |
42 namespace domain_reliability { | 43 namespace domain_reliability { |
43 class DomainReliabilityMonitor; | 44 class DomainReliabilityMonitor; |
44 } // namespace domain_reliability | 45 } // namespace domain_reliability |
45 | 46 |
46 namespace extensions { | 47 namespace extensions { |
47 class EventRouterForwarder; | 48 class EventRouterForwarder; |
48 class InfoMap; | 49 class InfoMap; |
49 } | 50 } |
50 | 51 |
51 namespace net { | 52 namespace net { |
| 53 class ProxyInfo; |
52 class URLRequest; | 54 class URLRequest; |
53 } | 55 } |
54 | 56 |
55 namespace policy { | 57 namespace policy { |
56 class URLBlacklistManager; | 58 class URLBlacklistManager; |
57 } | 59 } |
58 | 60 |
59 namespace prerender { | 61 namespace prerender { |
60 class PrerenderTracker; | 62 class PrerenderTracker; |
61 } | 63 } |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 data_reduction_proxy_params_ = params; | 128 data_reduction_proxy_params_ = params; |
127 } | 129 } |
128 | 130 |
129 // |data_reduction_proxy_usage_stats_| must outlive this | 131 // |data_reduction_proxy_usage_stats_| must outlive this |
130 // ChromeNetworkDelegate. | 132 // ChromeNetworkDelegate. |
131 void set_data_reduction_proxy_usage_stats( | 133 void set_data_reduction_proxy_usage_stats( |
132 data_reduction_proxy::DataReductionProxyUsageStats* usage_stats) { | 134 data_reduction_proxy::DataReductionProxyUsageStats* usage_stats) { |
133 data_reduction_proxy_usage_stats_ = usage_stats; | 135 data_reduction_proxy_usage_stats_ = usage_stats; |
134 } | 136 } |
135 | 137 |
| 138 // |data_reduction_proxy_auth_request_handler_| must outlive this |
| 139 // ChromeNetworkDelegate. |
| 140 void set_data_reduction_proxy_auth_request_handler( |
| 141 data_reduction_proxy::DataReductionProxyAuthRequestHandler* handler) { |
| 142 data_reduction_proxy_auth_request_handler_ = handler; |
| 143 } |
| 144 |
136 // Adds the Client Hints header to HTTP requests. | 145 // Adds the Client Hints header to HTTP requests. |
137 void SetEnableClientHints(); | 146 void SetEnableClientHints(); |
138 | 147 |
139 // Causes |OnCanThrottleRequest| to always return false, for all | 148 // Causes |OnCanThrottleRequest| to always return false, for all |
140 // instances of this object. | 149 // instances of this object. |
141 static void NeverThrottleRequests(); | 150 static void NeverThrottleRequests(); |
142 | 151 |
143 // Binds the pref members to |pref_service| and moves them to the IO thread. | 152 // Binds the pref members to |pref_service| and moves them to the IO thread. |
144 // |enable_referrers| cannot be NULL, the others can. | 153 // |enable_referrers| cannot be NULL, the others can. |
145 // This method should be called on the UI thread. | 154 // This method should be called on the UI thread. |
(...skipping 19 matching lines...) Expand all Loading... |
165 private: | 174 private: |
166 friend class ChromeNetworkDelegateTest; | 175 friend class ChromeNetworkDelegateTest; |
167 | 176 |
168 // NetworkDelegate implementation. | 177 // NetworkDelegate implementation. |
169 virtual int OnBeforeURLRequest(net::URLRequest* request, | 178 virtual int OnBeforeURLRequest(net::URLRequest* request, |
170 const net::CompletionCallback& callback, | 179 const net::CompletionCallback& callback, |
171 GURL* new_url) OVERRIDE; | 180 GURL* new_url) OVERRIDE; |
172 virtual int OnBeforeSendHeaders(net::URLRequest* request, | 181 virtual int OnBeforeSendHeaders(net::URLRequest* request, |
173 const net::CompletionCallback& callback, | 182 const net::CompletionCallback& callback, |
174 net::HttpRequestHeaders* headers) OVERRIDE; | 183 net::HttpRequestHeaders* headers) OVERRIDE; |
| 184 virtual void OnBeforeSendProxyHeaders( |
| 185 net::URLRequest* request, |
| 186 const net::ProxyInfo& proxy_info, |
| 187 net::HttpRequestHeaders* headers) OVERRIDE; |
175 virtual void OnSendHeaders(net::URLRequest* request, | 188 virtual void OnSendHeaders(net::URLRequest* request, |
176 const net::HttpRequestHeaders& headers) OVERRIDE; | 189 const net::HttpRequestHeaders& headers) OVERRIDE; |
177 virtual int OnHeadersReceived( | 190 virtual int OnHeadersReceived( |
178 net::URLRequest* request, | 191 net::URLRequest* request, |
179 const net::CompletionCallback& callback, | 192 const net::CompletionCallback& callback, |
180 const net::HttpResponseHeaders* original_response_headers, | 193 const net::HttpResponseHeaders* original_response_headers, |
181 scoped_refptr<net::HttpResponseHeaders>* override_response_headers, | 194 scoped_refptr<net::HttpResponseHeaders>* override_response_headers, |
182 GURL* allowed_unsafe_redirect_url) OVERRIDE; | 195 GURL* allowed_unsafe_redirect_url) OVERRIDE; |
183 virtual void OnBeforeRedirect(net::URLRequest* request, | 196 virtual void OnBeforeRedirect(net::URLRequest* request, |
184 const GURL& new_location) OVERRIDE; | 197 const GURL& new_location) OVERRIDE; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 bool first_request_; | 270 bool first_request_; |
258 | 271 |
259 prerender::PrerenderTracker* prerender_tracker_; | 272 prerender::PrerenderTracker* prerender_tracker_; |
260 | 273 |
261 // |data_reduction_proxy_params_| must outlive this ChromeNetworkDelegate. | 274 // |data_reduction_proxy_params_| must outlive this ChromeNetworkDelegate. |
262 data_reduction_proxy::DataReductionProxyParams* data_reduction_proxy_params_; | 275 data_reduction_proxy::DataReductionProxyParams* data_reduction_proxy_params_; |
263 // |data_reduction_proxy_usage_stats_| must outlive this | 276 // |data_reduction_proxy_usage_stats_| must outlive this |
264 // ChromeNetworkDelegate. | 277 // ChromeNetworkDelegate. |
265 data_reduction_proxy::DataReductionProxyUsageStats* | 278 data_reduction_proxy::DataReductionProxyUsageStats* |
266 data_reduction_proxy_usage_stats_; | 279 data_reduction_proxy_usage_stats_; |
| 280 data_reduction_proxy::DataReductionProxyAuthRequestHandler* |
| 281 data_reduction_proxy_auth_request_handler_; |
267 | 282 |
268 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); | 283 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); |
269 }; | 284 }; |
270 | 285 |
271 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 286 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
OLD | NEW |