Chromium Code Reviews| Index: chrome/browser/metrics/variations/variations_http_header_provider.cc |
| diff --git a/chrome/browser/metrics/variations/variations_http_header_provider.cc b/chrome/browser/metrics/variations/variations_http_header_provider.cc |
| index 08907f3b8d42e5b4f0b87382afb3433615f5493c..29acd591d07f74bf89c6a1e924b297e5d5461f38 100644 |
| --- a/chrome/browser/metrics/variations/variations_http_header_provider.cc |
| +++ b/chrome/browser/metrics/variations/variations_http_header_provider.cc |
| @@ -30,7 +30,11 @@ void VariationsHttpHeaderProvider::AppendHeaders( |
| 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,18 @@ bool VariationsHttpHeaderProvider::ShouldAppendHeaders(const GURL& url) { |
| 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")) |
|
Alexei Svitkine (slow)
2014/04/01 15:16:48
Nit: {}'s
(Some reviewers disagree on this, but i
jar (doing other things)
2014/04/01 16:55:42
Done. (and I agree with the nit change... my faul
|
| + 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, |