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

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

Issue 11821019: Move the Chrome Variations HTTP header helper file into c/b/metrics/variations, and fix up lock beh… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove TODO Created 7 years, 11 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
Index: chrome/browser/metrics/variations/variations_http_header_provider.h
diff --git a/chrome/browser/chrome_metrics_helper.h b/chrome/browser/metrics/variations/variations_http_header_provider.h
similarity index 76%
rename from chrome/browser/chrome_metrics_helper.h
rename to chrome/browser/metrics/variations/variations_http_header_provider.h
index 268b55cccb5c440ce382bf34e8900c930d7979b3..0c7e3acbc61de389e50e9a9dc481f7c0bc1431f0 100644
--- a/chrome/browser/chrome_metrics_helper.h
+++ b/chrome/browser/metrics/variations/variations_http_header_provider.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_CHROME_METRICS_HELPER_H_
-#define CHROME_BROWSER_CHROME_METRICS_HELPER_H_
+#ifndef CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_HTTP_HEADER_PROVIDER_H_
+#define CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_HTTP_HEADER_PROVIDER_H_
#include <set>
#include <string>
@@ -27,12 +27,14 @@ class ProfileIOData;
template <typename T> struct DefaultSingletonTraits;
+namespace chrome_variations {
+
// A helper class for maintaining Chrome experiments and metrics state
// transmitted in custom HTTP request headers.
// This class is a thread-safe singleton.
-class ChromeMetricsHelper : base::FieldTrialList::Observer {
+class VariationsHttpHeaderProvider : base::FieldTrialList::Observer {
public:
- static ChromeMetricsHelper* GetInstance();
+ static VariationsHttpHeaderProvider* GetInstance();
// Adds Chrome experiment and metrics state as custom headers to |headers|.
// Some headers may not be set given the |incognito| mode or whether
@@ -44,10 +46,10 @@ class ChromeMetricsHelper : base::FieldTrialList::Observer {
net::HttpRequestHeaders* headers);
private:
- friend struct DefaultSingletonTraits<ChromeMetricsHelper>;
+ friend struct DefaultSingletonTraits<VariationsHttpHeaderProvider>;
- ChromeMetricsHelper();
- virtual ~ChromeMetricsHelper();
+ VariationsHttpHeaderProvider();
+ virtual ~VariationsHttpHeaderProvider();
// base::FieldTrialList::Observer implementation.
// This will add the variation ID associated with |trial_name| and
@@ -62,7 +64,8 @@ class ChromeMetricsHelper : base::FieldTrialList::Observer {
void InitVariationIDsCacheIfNeeded();
// Takes whatever is currently in |variation_ids_set_| and recreates
- // |variation_ids_header_| with it.
+ // |variation_ids_header_| with it. Assumes the the |lock_| is currently
+ // held.
void UpdateVariationIDsHeaderValue();
// Guards |variation_ids_cache_initialized_|, |variation_ids_set_| and
@@ -77,7 +80,9 @@ class ChromeMetricsHelper : base::FieldTrialList::Observer {
std::set<chrome_variations::VariationID> variation_ids_set_;
std::string variation_ids_header_;
- DISALLOW_COPY_AND_ASSIGN(ChromeMetricsHelper);
+ DISALLOW_COPY_AND_ASSIGN(VariationsHttpHeaderProvider);
};
-#endif // CHROME_BROWSER_CHROME_METRICS_HELPER_H_
+} // namespace chrome_variations
+
+#endif // CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_HTTP_HEADER_PROVIDER_H_
« no previous file with comments | « chrome/browser/chrome_metrics_helper.cc ('k') | chrome/browser/metrics/variations/variations_http_header_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698