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

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

Issue 1680893002: Moving proxy resolution logic out of NetworkDelegate and into ProxyDelegate for DataReductionProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 10 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
« no previous file with comments | « net/base/network_delegate.h ('k') | net/base/network_delegate_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/profiler/scoped_tracker.h" 8 #include "base/profiler/scoped_tracker.h"
9 #include "net/base/load_flags.h" 9 #include "net/base/load_flags.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
11 #include "net/proxy/proxy_info.h" 11 #include "net/proxy/proxy_info.h"
12 #include "net/url_request/url_request.h" 12 #include "net/url_request/url_request.h"
13 13
14 namespace net { 14 namespace net {
15 15
16 int NetworkDelegate::NotifyBeforeURLRequest( 16 int NetworkDelegate::NotifyBeforeURLRequest(
17 URLRequest* request, const CompletionCallback& callback, 17 URLRequest* request, const CompletionCallback& callback,
18 GURL* new_url) { 18 GURL* new_url) {
19 DCHECK(CalledOnValidThread()); 19 DCHECK(CalledOnValidThread());
20 DCHECK(request); 20 DCHECK(request);
21 DCHECK(!callback.is_null()); 21 DCHECK(!callback.is_null());
22 // TODO(cbentzel): Remove ScopedTracker below once crbug.com/475753 is fixed. 22 // TODO(cbentzel): Remove ScopedTracker below once crbug.com/475753 is fixed.
23 tracked_objects::ScopedTracker tracking_profile( 23 tracked_objects::ScopedTracker tracking_profile(
24 FROM_HERE_WITH_EXPLICIT_FUNCTION( 24 FROM_HERE_WITH_EXPLICIT_FUNCTION(
25 "475753 NetworkDelegate::OnBeforeURLRequest")); 25 "475753 NetworkDelegate::OnBeforeURLRequest"));
26 return OnBeforeURLRequest(request, callback, new_url); 26 return OnBeforeURLRequest(request, callback, new_url);
27 } 27 }
28 28
29 void NetworkDelegate::NotifyResolveProxy(
30 const GURL& url,
31 int load_flags,
32 const ProxyService& proxy_service,
33 ProxyInfo* result) {
34 DCHECK(CalledOnValidThread());
35 DCHECK(result);
36 OnResolveProxy(url, load_flags, proxy_service, result);
37 }
38
39 void NetworkDelegate::NotifyProxyFallback(
40 const ProxyServer& bad_proxy,
41 int net_error) {
42 DCHECK(CalledOnValidThread());
43 OnProxyFallback(bad_proxy, net_error);
44 }
45
46 int NetworkDelegate::NotifyBeforeSendHeaders( 29 int NetworkDelegate::NotifyBeforeSendHeaders(
47 URLRequest* request, const CompletionCallback& callback, 30 URLRequest* request, const CompletionCallback& callback,
48 HttpRequestHeaders* headers) { 31 HttpRequestHeaders* headers) {
49 DCHECK(CalledOnValidThread()); 32 DCHECK(CalledOnValidThread());
50 DCHECK(headers); 33 DCHECK(headers);
51 DCHECK(!callback.is_null()); 34 DCHECK(!callback.is_null());
52 return OnBeforeSendHeaders(request, callback, headers); 35 return OnBeforeSendHeaders(request, callback, headers);
53 } 36 }
54 37
55 void NetworkDelegate::NotifyBeforeSendProxyHeaders( 38 void NetworkDelegate::NotifyBeforeSendProxyHeaders(
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 bool NetworkDelegate::CancelURLRequestWithPolicyViolatingReferrerHeader( 162 bool NetworkDelegate::CancelURLRequestWithPolicyViolatingReferrerHeader(
180 const URLRequest& request, 163 const URLRequest& request,
181 const GURL& target_url, 164 const GURL& target_url,
182 const GURL& referrer_url) const { 165 const GURL& referrer_url) const {
183 DCHECK(CalledOnValidThread()); 166 DCHECK(CalledOnValidThread());
184 return OnCancelURLRequestWithPolicyViolatingReferrerHeader( 167 return OnCancelURLRequestWithPolicyViolatingReferrerHeader(
185 request, target_url, referrer_url); 168 request, target_url, referrer_url);
186 } 169 }
187 170
188 } // namespace net 171 } // namespace net
OLDNEW
« no previous file with comments | « net/base/network_delegate.h ('k') | net/base/network_delegate_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698