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

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

Issue 307743003: Add more Google domains to the list of domains which should have (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Back to v1 Created 6 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/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
diff --git a/chrome/browser/metrics/variations/variations_http_header_provider.cc b/chrome/browser/metrics/variations/variations_http_header_provider.cc
index 90fde20a0df46a7ae25e8f91559fb7d89f735aa0..3068c2410f3bcabf54ba0b2367be84ed2d81a5c5 100644
--- a/chrome/browser/metrics/variations/variations_http_header_provider.cc
+++ b/chrome/browser/metrics/variations/variations_http_header_provider.cc
@@ -20,6 +20,24 @@
namespace chrome_variations {
+namespace {
+
+const char* kSuffixesToSetHeadersFor[] = {
+ ".android.com",
+ ".doubleclick.com",
+ ".doubleclick.net",
+ ".ggpht.com",
+ ".googleadservices.com",
+ ".googleapis.com",
+ ".googlesyndication.com",
+ ".googleusercontent.com",
+ ".googlevideo.com",
+ ".gstatic.com",
+ ".ytimg.com",
+};
+
+} // namespace
+
VariationsHttpHeaderProvider* VariationsHttpHeaderProvider::GetInstance() {
return Singleton<VariationsHttpHeaderProvider>::get();
}
@@ -229,10 +247,9 @@ bool VariationsHttpHeaderProvider::ShouldAppendHeaders(const GURL& url) {
// 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;
+ for (size_t i = 0; i < arraysize(kSuffixesToSetHeadersFor); ++i) {
+ if (EndsWith(host, kSuffixesToSetHeadersFor[i], false))
+ return true;
}
// The below mirrors logic in IsGoogleDomainUrl(), but for youtube.<TLD>.
« 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