diff options
author | dcblack@chromium.org <dcblack@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-05 22:24:34 +0000 |
---|---|---|
committer | dcblack@chromium.org <dcblack@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-05 22:24:34 +0000 |
commit | 05ef1f2e8a976219574432bcfe4370178c1d71c7 (patch) | |
tree | a2cc564e3ee5941024e94a18c3fa508c359612d9 /chrome | |
parent | 4937fd469f4fbb9e304d88221eac52e8ce181a47 (diff) | |
download | chromium_src-05ef1f2e8a976219574432bcfe4370178c1d71c7.zip chromium_src-05ef1f2e8a976219574432bcfe4370178c1d71c7.tar.gz chromium_src-05ef1f2e8a976219574432bcfe4370178c1d71c7.tar.bz2 |
Rename the X-Chrome-Variations header to X-Client-Data.
BUG=325472
Review URL: https://codereview.chromium.org/103063002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239054 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
6 files changed, 10 insertions, 9 deletions
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index e18e402..719dcb7 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc @@ -613,7 +613,7 @@ void ChromeBrowserMainParts::SetupMetricsAndFieldTrials() { } if (command_line->HasSwitch(switches::kForceVariationIds)) { // Create default variation ids which will always be included in the - // X-Chrome-Variations request header. + // X-Client-Data request header. chrome_variations::VariationsHttpHeaderProvider* provider = chrome_variations::VariationsHttpHeaderProvider::GetInstance(); bool result = provider->SetDefaultVariationIds( diff --git a/chrome/browser/metrics/variations/variations_http_header_provider.cc b/chrome/browser/metrics/variations/variations_http_header_provider.cc index 20b3e719..909394a 100644 --- a/chrome/browser/metrics/variations/variations_http_header_provider.cc +++ b/chrome/browser/metrics/variations/variations_http_header_provider.cc @@ -34,7 +34,7 @@ void VariationsHttpHeaderProvider::AppendHeaders( // 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. - // 4. For the X-Chrome-Variations, only include non-empty variation IDs. + // 4. For the X-Client-Data header, only include non-empty variation IDs. if (incognito || !ShouldAppendHeaders(url)) return; @@ -52,7 +52,8 @@ void VariationsHttpHeaderProvider::AppendHeaders( } if (!variation_ids_header_copy.empty()) { - headers->SetHeaderIfMissing("X-Chrome-Variations", + // Note that prior to M33 this header was named X-Chrome-Variations. + headers->SetHeaderIfMissing("X-Client-Data", variation_ids_header_copy); } } diff --git a/chrome/browser/metrics/variations/variations_http_header_provider.h b/chrome/browser/metrics/variations/variations_http_header_provider.h index 96e5f26..744b84d 100644 --- a/chrome/browser/metrics/variations/variations_http_header_provider.h +++ b/chrome/browser/metrics/variations/variations_http_header_provider.h @@ -46,7 +46,7 @@ class VariationsHttpHeaderProvider : base::FieldTrialList::Observer { bool uma_enabled, net::HttpRequestHeaders* headers); - // Sets *additional* variation ids to be encoded in the X-Chrome-Varations + // Sets *additional* variation ids to be encoded in the X-Client-Data // request header. This is intended for development use to force a server // side experiment id. |variation_ids| should be a comma-separated string of // numeric experiment ids. diff --git a/chrome/browser/metrics/variations/variations_http_header_provider_unittest.cc b/chrome/browser/metrics/variations/variations_http_header_provider_unittest.cc index 6d5be7e..69e1768 100644 --- a/chrome/browser/metrics/variations/variations_http_header_provider_unittest.cc +++ b/chrome/browser/metrics/variations/variations_http_header_provider_unittest.cc @@ -74,8 +74,8 @@ TEST(VariationsHttpHeaderProviderTest, SetDefaultVariationIds_Valid) { EXPECT_TRUE(provider.SetDefaultVariationIds("12,456")); provider.InitVariationIDsCacheIfNeeded(); provider.AppendHeaders(url, false, false, &headers); - EXPECT_TRUE(headers.HasHeader("X-Chrome-Variations")); - headers.GetHeader("X-Chrome-Variations", &variations); + EXPECT_TRUE(headers.HasHeader("X-Client-Data")); + headers.GetHeader("X-Client-Data", &variations); std::set<VariationID> variation_ids; ASSERT_TRUE(ExtractVariationIds(variations, &variation_ids)); EXPECT_TRUE(variation_ids.find(12) != variation_ids.end()); @@ -92,7 +92,7 @@ TEST(VariationsHttpHeaderProviderTest, SetDefaultVariationIds_Invalid) { EXPECT_FALSE(provider.SetDefaultVariationIds("abcd12,456")); provider.InitVariationIDsCacheIfNeeded(); provider.AppendHeaders(url, false, false, &headers); - EXPECT_FALSE(headers.HasHeader("X-Chrome-Variations")); + EXPECT_FALSE(headers.HasHeader("X-Client-Data")); } } // namespace chrome_variations diff --git a/chrome/browser/omnibox/omnibox_field_trial.h b/chrome/browser/omnibox/omnibox_field_trial.h index f7e38c8..8ee0381 100644 --- a/chrome/browser/omnibox/omnibox_field_trial.h +++ b/chrome/browser/omnibox/omnibox_field_trial.h @@ -34,7 +34,7 @@ class OmniboxFieldTrial { // the autocomplete dynamic and static field trials is that the former // don't require any code changes on the Chrome side as they are controlled // on the server side. Chrome binary simply propagates all necessary - // information through the X-Chrome-Variations header. + // information through the X-Client-Data header. // This method, unlike ActivateStaticTrials(), may be called multiple times. static void ActivateDynamicTrials(); diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index b1f8938..71f0f015 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -861,7 +861,7 @@ const char kForceAppMode[] = "force-app-mode"; const char kForceFirstRun[] = "force-first-run"; // Forces additional Chrome Variation Ids that will be sent in -// X-Chrome-Variations header, specified as a comma-separated list of numeric +// X-Client-Data header, specified as a 64-bit encoded list of numeric // experiment ids. const char kForceVariationIds[] = "force-variation-ids"; |