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

Unified Diff: chrome/browser/metrics/variations/variations_http_header_provider.cc

Issue 224323002: Merge 260929 "Send Finch experiment selection data to ad-service..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1916/src/
Patch Set: 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 | « no previous file | chrome/browser/metrics/variations/variations_http_header_provider_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/variations/variations_http_header_provider.cc
===================================================================
--- chrome/browser/metrics/variations/variations_http_header_provider.cc (revision 261467)
+++ chrome/browser/metrics/variations/variations_http_header_provider.cc (working copy)
@@ -30,7 +30,11 @@
bool uma_enabled,
net::HttpRequestHeaders* headers) {
// Note the criteria for attaching Chrome experiment headers:
- // 1. We only transmit to *.google.<TLD> or *.youtube.<TLD> domains.
+ // 1. We only transmit to Google owned domains which can evaluate experiments.
+ // 1a. These include hosts which have a standard postfix such as:
+ // *.doubleclick.net or *.googlesyndication.com or
+ // exactly www.googleadservices.com or
+ // international TLD domains *.google.<TLD> or *.youtube.<TLD>.
// 2. Only transmit for non-Incognito profiles.
// 3. For the X-Chrome-UMA-Enabled bit, only set it if UMA is in fact enabled
// for this install of Chrome.
@@ -178,11 +182,19 @@
return true;
}
- // The below mirrors logic in IsGoogleDomainUrl(), but for youtube.<TLD>.
if (!url.is_valid() || !url.SchemeIsHTTPOrHTTPS())
return false;
+ // Some domains don't have international TLD extensions, so testing for them
+ // is very straight forward.
const std::string host = url.host();
+ if (EndsWith(host, ".doubleclick.net", false) ||
+ EndsWith(host, ".googlesyndication.com", false) ||
+ LowerCaseEqualsASCII(host, "www.googleadservices.com")) {
+ return true;
+ }
+
+ // The below mirrors logic in IsGoogleDomainUrl(), but for youtube.<TLD>.
const size_t tld_length = net::registry_controlled_domains::GetRegistryLength(
host,
net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
« no previous file with comments | « no previous file | chrome/browser/metrics/variations/variations_http_header_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698