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

Side by Side Diff: chrome/browser/net/chrome_network_delegate.h

Issue 333113002: Move data reduction proxy to Chrome-Proxy header for authentication (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@flywheel-refactor-net-fake-a-redirect-response-headers-chrome-proxy-auth
Patch Set: Callback returns void Created 6 years, 6 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
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 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 16 matching lines...) Expand all
27 namespace base { 27 namespace base {
28 class Value; 28 class Value;
29 } 29 }
30 30
31 namespace chrome_browser_net { 31 namespace chrome_browser_net {
32 class ConnectInterceptor; 32 class ConnectInterceptor;
33 class Predictor; 33 class Predictor;
34 } 34 }
35 35
36 namespace data_reduction_proxy { 36 namespace data_reduction_proxy {
37 class DataReductionProxyAuthRequestHandler;
37 class DataReductionProxyParams; 38 class DataReductionProxyParams;
38 } 39 }
39 40
40 namespace domain_reliability { 41 namespace domain_reliability {
41 class DomainReliabilityMonitor; 42 class DomainReliabilityMonitor;
42 } // namespace domain_reliability 43 } // namespace domain_reliability
43 44
44 namespace extensions { 45 namespace extensions {
45 class EventRouterForwarder; 46 class EventRouterForwarder;
46 class InfoMap; 47 class InfoMap;
47 } 48 }
48 49
49 namespace net { 50 namespace net {
51 class ProxyInfo;
50 class URLRequest; 52 class URLRequest;
51 } 53 }
52 54
53 namespace policy { 55 namespace policy {
54 class URLBlacklistManager; 56 class URLBlacklistManager;
55 } 57 }
56 58
57 namespace prerender { 59 namespace prerender {
58 class PrerenderTracker; 60 class PrerenderTracker;
59 } 61 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 118
117 void set_prerender_tracker(prerender::PrerenderTracker* prerender_tracker) { 119 void set_prerender_tracker(prerender::PrerenderTracker* prerender_tracker) {
118 prerender_tracker_ = prerender_tracker; 120 prerender_tracker_ = prerender_tracker;
119 } 121 }
120 122
121 void set_data_reduction_proxy_params( 123 void set_data_reduction_proxy_params(
122 data_reduction_proxy::DataReductionProxyParams* params) { 124 data_reduction_proxy::DataReductionProxyParams* params) {
123 data_reduction_proxy_params_ = params; 125 data_reduction_proxy_params_ = params;
124 } 126 }
125 127
128 void set_data_reduction_proxy_auth_request_handler(
129 data_reduction_proxy::DataReductionProxyAuthRequestHandler* handler) {
130 data_reduction_proxy_auth_request_handler_ = handler;
131 }
132
126 // Adds the Client Hints header to HTTP requests. 133 // Adds the Client Hints header to HTTP requests.
127 void SetEnableClientHints(); 134 void SetEnableClientHints();
128 135
129 // Causes |OnCanThrottleRequest| to always return false, for all 136 // Causes |OnCanThrottleRequest| to always return false, for all
130 // instances of this object. 137 // instances of this object.
131 static void NeverThrottleRequests(); 138 static void NeverThrottleRequests();
132 139
133 // Binds the pref members to |pref_service| and moves them to the IO thread. 140 // Binds the pref members to |pref_service| and moves them to the IO thread.
134 // |enable_referrers| cannot be NULL, the others can. 141 // |enable_referrers| cannot be NULL, the others can.
135 // This method should be called on the UI thread. 142 // This method should be called on the UI thread.
(...skipping 19 matching lines...) Expand all
155 private: 162 private:
156 friend class ChromeNetworkDelegateTest; 163 friend class ChromeNetworkDelegateTest;
157 164
158 // NetworkDelegate implementation. 165 // NetworkDelegate implementation.
159 virtual int OnBeforeURLRequest(net::URLRequest* request, 166 virtual int OnBeforeURLRequest(net::URLRequest* request,
160 const net::CompletionCallback& callback, 167 const net::CompletionCallback& callback,
161 GURL* new_url) OVERRIDE; 168 GURL* new_url) OVERRIDE;
162 virtual int OnBeforeSendHeaders(net::URLRequest* request, 169 virtual int OnBeforeSendHeaders(net::URLRequest* request,
163 const net::CompletionCallback& callback, 170 const net::CompletionCallback& callback,
164 net::HttpRequestHeaders* headers) OVERRIDE; 171 net::HttpRequestHeaders* headers) OVERRIDE;
172 virtual void OnBeforeSendProxyHeaders(
173 net::URLRequest* request,
174 const net::ProxyInfo* proxy_info,
175 net::HttpRequestHeaders* headers) OVERRIDE;
165 virtual void OnSendHeaders(net::URLRequest* request, 176 virtual void OnSendHeaders(net::URLRequest* request,
166 const net::HttpRequestHeaders& headers) OVERRIDE; 177 const net::HttpRequestHeaders& headers) OVERRIDE;
167 virtual int OnHeadersReceived( 178 virtual int OnHeadersReceived(
168 net::URLRequest* request, 179 net::URLRequest* request,
169 const net::CompletionCallback& callback, 180 const net::CompletionCallback& callback,
170 const net::HttpResponseHeaders* original_response_headers, 181 const net::HttpResponseHeaders* original_response_headers,
171 scoped_refptr<net::HttpResponseHeaders>* override_response_headers, 182 scoped_refptr<net::HttpResponseHeaders>* override_response_headers,
172 GURL* allowed_unsafe_redirect_url) OVERRIDE; 183 GURL* allowed_unsafe_redirect_url) OVERRIDE;
173 virtual void OnBeforeRedirect(net::URLRequest* request, 184 virtual void OnBeforeRedirect(net::URLRequest* request,
174 const GURL& new_location) OVERRIDE; 185 const GURL& new_location) OVERRIDE;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 // Total original size of all content before it was transferred. 253 // Total original size of all content before it was transferred.
243 int64 original_content_length_; 254 int64 original_content_length_;
244 255
245 scoped_ptr<ClientHints> client_hints_; 256 scoped_ptr<ClientHints> client_hints_;
246 257
247 bool first_request_; 258 bool first_request_;
248 259
249 prerender::PrerenderTracker* prerender_tracker_; 260 prerender::PrerenderTracker* prerender_tracker_;
250 261
251 data_reduction_proxy::DataReductionProxyParams* data_reduction_proxy_params_; 262 data_reduction_proxy::DataReductionProxyParams* data_reduction_proxy_params_;
263 data_reduction_proxy::DataReductionProxyAuthRequestHandler*
264 data_reduction_proxy_auth_request_handler_;
252 265
253 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); 266 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate);
254 }; 267 };
255 268
256 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ 269 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698