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

Unified Diff: net/base/network_delegate.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/net/chrome_network_delegate.cc ('k') | net/base/network_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/network_delegate.h
diff --git a/net/base/network_delegate.h b/net/base/network_delegate.h
index a290d16604eef86fe0c14f3162e37ee8a12c8a72..299989c9dab19737c9b54d79031a49a6574c849a 100644
--- a/net/base/network_delegate.h
+++ b/net/base/network_delegate.h
@@ -108,6 +108,11 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe {
int NotifyBeforeSocketStreamConnect(SocketStream* socket,
const CompletionCallback& callback);
+ bool CancelURLRequestWithPolicyViolatingReferrerHeader(
+ const URLRequest& request,
+ const GURL& target_url,
+ const GURL& referrer_url) const;
+
private:
// This is the interface for subclasses of NetworkDelegate to implement. These
// member functions will be called by the respective public notification
@@ -270,6 +275,16 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe {
// See OnBeforeURLRequest for return value description. Returns OK by default.
virtual int OnBeforeSocketStreamConnect(
SocketStream* socket, const CompletionCallback& callback);
+
+ // Called when the |referrer_url| for requesting |target_url| during handling
+ // of the |request| is does not comply with the referrer policy (e.g. a
+ // secure referrer for an insecure initial target).
+ // Returns true if the request should be cancelled. Otherwise, the referrer
+ // header is stripped from the request.
+ virtual bool OnCancelURLRequestWithPolicyViolatingReferrerHeader(
+ const URLRequest& request,
+ const GURL& target_url,
+ const GURL& referrer_url) const;
};
} // namespace net
« no previous file with comments | « chrome/browser/net/chrome_network_delegate.cc ('k') | net/base/network_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698