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

Unified Diff: net/url_request/url_request.cc

Issue 185133005: Move referrer stripping into GURL::GetAsReferrer(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch over the Android ContextMenuHelper. Created 6 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
« no previous file with comments | « chrome/browser/ui/android/context_menu_helper.cc ('k') | url/gurl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request.cc
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index 53d00439d55ef1cc544da8d3307568648eebab47..30579708f256f60028ab5fec961d81b83f303871 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -608,21 +608,12 @@ std::string URLRequest::ComputeMethodForRedirect(
void URLRequest::SetReferrer(const std::string& referrer) {
DCHECK(!is_pending_);
- referrer_ = referrer;
// Ensure that we do not send URL fragment, username and password
gavinp 2014/03/17 10:51:35 This comment is now subsumed by the definition of
ppi 2014/03/20 10:50:56 Done.
// fields in the referrer.
GURL referrer_url(referrer);
UMA_HISTOGRAM_BOOLEAN("Net.URLRequest_SetReferrer_IsEmptyOrValid",
referrer_url.is_empty() || referrer_url.is_valid());
- if (referrer_url.is_valid() && (referrer_url.has_ref() ||
- referrer_url.has_username() || referrer_url.has_password())) {
- GURL::Replacements referrer_mods;
- referrer_mods.ClearRef();
- referrer_mods.ClearUsername();
- referrer_mods.ClearPassword();
- referrer_url = referrer_url.ReplaceComponents(referrer_mods);
- referrer_ = referrer_url.spec();
- }
+ referrer_ = referrer_url.GetAsReferrer().spec();
}
void URLRequest::set_referrer_policy(ReferrerPolicy referrer_policy) {
« no previous file with comments | « chrome/browser/ui/android/context_menu_helper.cc ('k') | url/gurl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698