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

Side by Side Diff: net/base/network_delegate.cc

Issue 449973002: Use data reduction proxy when managed proxy config returns direct (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no-uma-in-proxy-service
Patch Set: Remove copy from ProxyConfig access Created 6 years, 4 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 #include "net/base/network_delegate.h" 5 #include "net/base/network_delegate.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "net/base/load_flags.h" 8 #include "net/base/load_flags.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "net/proxy/proxy_info.h" 10 #include "net/proxy/proxy_info.h"
11 #include "net/url_request/url_request.h" 11 #include "net/url_request/url_request.h"
12 12
13 namespace net { 13 namespace net {
14 14
15 int NetworkDelegate::NotifyBeforeURLRequest( 15 int NetworkDelegate::NotifyBeforeURLRequest(
16 URLRequest* request, const CompletionCallback& callback, 16 URLRequest* request, const CompletionCallback& callback,
17 GURL* new_url) { 17 GURL* new_url) {
18 DCHECK(CalledOnValidThread()); 18 DCHECK(CalledOnValidThread());
19 DCHECK(request); 19 DCHECK(request);
20 DCHECK(!callback.is_null()); 20 DCHECK(!callback.is_null());
21 return OnBeforeURLRequest(request, callback, new_url); 21 return OnBeforeURLRequest(request, callback, new_url);
22 } 22 }
23 23
24 void NetworkDelegate::NotifyResolveProxy(const GURL& url, int load_flags, 24 void NetworkDelegate::NotifyResolveProxy(
25 ProxyInfo* result) { 25 const GURL& url,
26 int load_flags,
27 const ProxyService& proxy_service,
28 ProxyInfo* result) {
26 DCHECK(CalledOnValidThread()); 29 DCHECK(CalledOnValidThread());
27 DCHECK(result); 30 DCHECK(result);
28 OnResolveProxy(url, load_flags, result); 31 OnResolveProxy(url, load_flags, proxy_service, result);
29 } 32 }
30 33
31 void NetworkDelegate::NotifyProxyFallback( 34 void NetworkDelegate::NotifyProxyFallback(
32 const ProxyServer& bad_proxy, 35 const ProxyServer& bad_proxy,
33 int net_error, 36 int net_error,
34 bool did_fallback) { 37 bool did_fallback) {
35 DCHECK(CalledOnValidThread()); 38 DCHECK(CalledOnValidThread());
36 OnProxyFallback(bad_proxy, net_error, did_fallback); 39 OnProxyFallback(bad_proxy, net_error, did_fallback);
37 } 40 }
38 41
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 DCHECK(CalledOnValidThread()); 166 DCHECK(CalledOnValidThread());
164 return OnCanEnablePrivacyMode(url, first_party_for_cookies); 167 return OnCanEnablePrivacyMode(url, first_party_for_cookies);
165 } 168 }
166 169
167 int NetworkDelegate::OnBeforeURLRequest(URLRequest* request, 170 int NetworkDelegate::OnBeforeURLRequest(URLRequest* request,
168 const CompletionCallback& callback, 171 const CompletionCallback& callback,
169 GURL* new_url) { 172 GURL* new_url) {
170 return OK; 173 return OK;
171 } 174 }
172 175
173 void NetworkDelegate::OnResolveProxy(const GURL& url, int load_flags, 176 void NetworkDelegate::OnResolveProxy(
174 ProxyInfo* result) { 177 const GURL& url,
178 int load_flags,
179 const ProxyService& proxy_service,
180 ProxyInfo* result) {
175 } 181 }
176 182
177 void NetworkDelegate::OnProxyFallback(const ProxyServer& bad_proxy, 183 void NetworkDelegate::OnProxyFallback(const ProxyServer& bad_proxy,
178 int net_error, 184 int net_error,
179 bool did_fallback) { 185 bool did_fallback) {
180 } 186 }
181 187
182 int NetworkDelegate::OnBeforeSendHeaders(URLRequest* request, 188 int NetworkDelegate::OnBeforeSendHeaders(URLRequest* request,
183 const CompletionCallback& callback, 189 const CompletionCallback& callback,
184 HttpRequestHeaders* headers) { 190 HttpRequestHeaders* headers) {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 return false; 265 return false;
260 } 266 }
261 267
262 int NetworkDelegate::OnBeforeSocketStreamConnect( 268 int NetworkDelegate::OnBeforeSocketStreamConnect(
263 SocketStream* socket, 269 SocketStream* socket,
264 const CompletionCallback& callback) { 270 const CompletionCallback& callback) {
265 return OK; 271 return OK;
266 } 272 }
267 273
268 } // namespace net 274 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698