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

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
Index: net/base/network_delegate.h
diff --git a/net/base/network_delegate.h b/net/base/network_delegate.h
index a290d16604eef86fe0c14f3162e37ee8a12c8a72..147c0d68c7841531cc41cc6ab20696d723ffa2f7 100644
--- a/net/base/network_delegate.h
+++ b/net/base/network_delegate.h
@@ -108,6 +108,10 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe {
int NotifyBeforeSocketStreamConnect(SocketStream* socket,
const CompletionCallback& callback);
+ bool CanCorrectInvalidReferrerHeader(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 +274,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 invalid (e.g. a secure referrer for an insecure
+ // target).
+ // Returns true if the referrer header should be omitted, or false if the
+ // request should be cancelled.
+ virtual bool OnCanCorrectInvalidReferrerHeader(
+ const URLRequest& request,
+ const GURL& target_url,
+ const GURL& referrer_url) const;
};
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698