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

Unified Diff: chrome/browser/net/predictor.cc

Issue 2022963003: [predictor] Apply HSTS redirects when learning referrers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment Created 4 years, 7 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 | « no previous file | chrome/browser/net/predictor_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/predictor.cc
diff --git a/chrome/browser/net/predictor.cc b/chrome/browser/net/predictor.cc
index 4904ec17df74b39a597568dc356f7dc0ebe1bef6..0ef21599629dc765f3a164e184f7b2e8969d8574 100644
--- a/chrome/browser/net/predictor.cc
+++ b/chrome/browser/net/predictor.cc
@@ -472,9 +472,12 @@ void Predictor::LearnFromNavigation(const GURL& referring_url,
DCHECK_EQ(target_url, Predictor::CanonicalizeUrl(target_url));
DCHECK_NE(target_url, GURL::EmptyGURL());
+ // Skip HSTS redirects to learn the true referrer.
+ GURL referring_url_with_hsts = GetHSTSRedirectOnIOThread(referring_url);
+
if (observer_)
- observer_->OnLearnFromNavigation(referring_url, target_url);
- referrers_[referring_url].SuggestHost(target_url);
+ observer_->OnLearnFromNavigation(referring_url_with_hsts, target_url);
+ referrers_[referring_url_with_hsts].SuggestHost(target_url);
// Possibly do some referrer trimming.
TrimReferrers();
}
« no previous file with comments | « no previous file | chrome/browser/net/predictor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698