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

Unified Diff: content/shell/browser/shell_network_delegate.cc

Issue 2764363002: PlzNavigate: sanitize the referrer in NavigationRequest (Closed)
Patch Set: Addressed comments Created 3 years, 9 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: content/shell/browser/shell_network_delegate.cc
diff --git a/content/shell/browser/shell_network_delegate.cc b/content/shell/browser/shell_network_delegate.cc
index dc58d455158e4072bd8a0378e063b80a982a3976..9565d26723963c06ade2a9e67bd00ffd5b9c9882 100644
--- a/content/shell/browser/shell_network_delegate.cc
+++ b/content/shell/browser/shell_network_delegate.cc
@@ -15,6 +15,7 @@ namespace content {
namespace {
bool g_block_third_party_cookies = false;
+bool g_cancel_requests_with_referrer_policy_violation = false;
}
ShellNetworkDelegate::ShellNetworkDelegate() {
@@ -27,6 +28,11 @@ void ShellNetworkDelegate::SetBlockThirdPartyCookies(bool block) {
g_block_third_party_cookies = block;
}
+void ShellNetworkDelegate::SetCancelURLRequestWithPolicyViolatingReferrerHeader(
+ bool cancel) {
+ g_cancel_requests_with_referrer_policy_violation = cancel;
+}
+
int ShellNetworkDelegate::OnBeforeURLRequest(
net::URLRequest* request,
const net::CompletionCallback& callback,
@@ -113,4 +119,11 @@ bool ShellNetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const {
switches::kEnableExperimentalWebPlatformFeatures);
}
+bool ShellNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader(
+ const net::URLRequest& request,
+ const GURL& target_url,
+ const GURL& referrer_url) const {
+ return g_cancel_requests_with_referrer_policy_violation;
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698