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

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

Issue 572273002: Move handling of invalid referrer to the network delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 6 years, 3 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"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 return OnCanThrottleRequest(request); 159 return OnCanThrottleRequest(request);
160 } 160 }
161 161
162 bool NetworkDelegate::CanEnablePrivacyMode( 162 bool NetworkDelegate::CanEnablePrivacyMode(
163 const GURL& url, 163 const GURL& url,
164 const GURL& first_party_for_cookies) const { 164 const GURL& first_party_for_cookies) const {
165 DCHECK(CalledOnValidThread()); 165 DCHECK(CalledOnValidThread());
166 return OnCanEnablePrivacyMode(url, first_party_for_cookies); 166 return OnCanEnablePrivacyMode(url, first_party_for_cookies);
167 } 167 }
168 168
169 bool NetworkDelegate::CanCorrectInvalidReferrerHeader(
170 const URLRequest& request,
171 const GURL& target_url,
172 const GURL& referrer_url) const {
173 DCHECK(CalledOnValidThread());
174 return OnCanCorrectInvalidReferrerHeader(request, target_url, referrer_url);
175 }
176
169 int NetworkDelegate::OnBeforeURLRequest(URLRequest* request, 177 int NetworkDelegate::OnBeforeURLRequest(URLRequest* request,
170 const CompletionCallback& callback, 178 const CompletionCallback& callback,
171 GURL* new_url) { 179 GURL* new_url) {
172 return OK; 180 return OK;
173 } 181 }
174 182
175 void NetworkDelegate::OnResolveProxy( 183 void NetworkDelegate::OnResolveProxy(
176 const GURL& url, 184 const GURL& url,
177 int load_flags, 185 int load_flags,
178 const ProxyService& proxy_service, 186 const ProxyService& proxy_service,
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 const GURL& first_party_for_cookies) const { 270 const GURL& first_party_for_cookies) const {
263 return false; 271 return false;
264 } 272 }
265 273
266 int NetworkDelegate::OnBeforeSocketStreamConnect( 274 int NetworkDelegate::OnBeforeSocketStreamConnect(
267 SocketStream* socket, 275 SocketStream* socket,
268 const CompletionCallback& callback) { 276 const CompletionCallback& callback) {
269 return OK; 277 return OK;
270 } 278 }
271 279
280 bool NetworkDelegate::OnCanCorrectInvalidReferrerHeader(
281 const URLRequest& request,
282 const GURL& target_url,
283 const GURL& referrer_url) const {
284 return true;
285 }
286
272 } // namespace net 287 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698