OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/variations/net/variations_http_header_provider.h" | 5 #include "components/variations/net/variations_http_header_provider.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 ".gstatic.com", | 37 ".gstatic.com", |
38 ".ytimg.com", | 38 ".ytimg.com", |
39 }; | 39 }; |
40 | 40 |
41 const char kChromeUMAEnabled[] = "X-Chrome-UMA-Enabled"; | 41 const char kChromeUMAEnabled[] = "X-Chrome-UMA-Enabled"; |
42 const char kClientData[] = "X-Client-Data"; | 42 const char kClientData[] = "X-Client-Data"; |
43 | 43 |
44 } // namespace | 44 } // namespace |
45 | 45 |
46 VariationsHttpHeaderProvider* VariationsHttpHeaderProvider::GetInstance() { | 46 VariationsHttpHeaderProvider* VariationsHttpHeaderProvider::GetInstance() { |
47 return Singleton<VariationsHttpHeaderProvider>::get(); | 47 return base::Singleton<VariationsHttpHeaderProvider>::get(); |
48 } | 48 } |
49 | 49 |
50 void VariationsHttpHeaderProvider::AppendHeaders( | 50 void VariationsHttpHeaderProvider::AppendHeaders( |
51 const GURL& url, | 51 const GURL& url, |
52 bool incognito, | 52 bool incognito, |
53 bool uma_enabled, | 53 bool uma_enabled, |
54 net::HttpRequestHeaders* headers) { | 54 net::HttpRequestHeaders* headers) { |
55 // Note the criteria for attaching client experiment headers: | 55 // Note the criteria for attaching client experiment headers: |
56 // 1. We only transmit to Google owned domains which can evaluate experiments. | 56 // 1. We only transmit to Google owned domains which can evaluate experiments. |
57 // 1a. These include hosts which have a standard postfix such as: | 57 // 1a. These include hosts which have a standard postfix such as: |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 if (base::EndsWith(host, kSuffixesToSetHeadersFor[i], | 282 if (base::EndsWith(host, kSuffixesToSetHeadersFor[i], |
283 base::CompareCase::INSENSITIVE_ASCII)) | 283 base::CompareCase::INSENSITIVE_ASCII)) |
284 return true; | 284 return true; |
285 } | 285 } |
286 | 286 |
287 return google_util::IsYoutubeDomainUrl(url, google_util::ALLOW_SUBDOMAIN, | 287 return google_util::IsYoutubeDomainUrl(url, google_util::ALLOW_SUBDOMAIN, |
288 google_util::ALLOW_NON_STANDARD_PORTS); | 288 google_util::ALLOW_NON_STANDARD_PORTS); |
289 } | 289 } |
290 | 290 |
291 } // namespace variations | 291 } // namespace variations |
OLD | NEW |