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

Unified Diff: chrome/browser/net/chrome_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/net/chrome_network_delegate.h ('k') | net/base/network_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/chrome_network_delegate.cc
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
index 77abac00de1b6e2699cf068e2e6d57f191d015f6..285a2e31f620f92b7a0e0c2c1cb236c792be813a 100644
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -12,6 +12,7 @@
#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
+#include "base/metrics/user_metrics.h"
#include "base/path_service.h"
#include "base/prefs/pref_member.h"
#include "base/prefs/pref_service.h"
@@ -233,6 +234,12 @@ void RecordIOThreadToRequestStartOnUIThread(
}
#endif // defined(OS_ANDROID)
+void ReportInvalidReferrerSend(const GURL& target_url,
+ const GURL& referrer_url) {
+ base::RecordAction(
+ base::UserMetricsAction("Net.URLRequest_StartJob_InvalidReferrer"));
+}
+
} // namespace
ChromeNetworkDelegate::ChromeNetworkDelegate(
@@ -811,6 +818,15 @@ int ChromeNetworkDelegate::OnBeforeSocketStreamConnect(
return net::OK;
}
+bool ChromeNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader(
+ const net::URLRequest& request,
+ const GURL& target_url,
+ const GURL& referrer_url) const {
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ base::Bind(&ReportInvalidReferrerSend, target_url, referrer_url));
+ return true;
+}
+
void ChromeNetworkDelegate::AccumulateContentLength(
int64 received_content_length,
int64 original_content_length,
« no previous file with comments | « chrome/browser/net/chrome_network_delegate.h ('k') | net/base/network_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698