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

Unified Diff: components/variations/variations_associated_data.h

Issue 286063004: Move active field trial API to variations component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 | « components/variations.gypi ('k') | components/variations/variations_associated_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/variations/variations_associated_data.h
===================================================================
--- components/variations/variations_associated_data.h (revision 271296)
+++ components/variations/variations_associated_data.h (working copy)
@@ -9,6 +9,7 @@
#include <string>
#include "base/metrics/field_trial.h"
+#include "components/variations/active_field_trials.h"
Ilya Sherman 2014/05/19 12:29:42 nit: Can this be moved into the .cc file?
Alexei Svitkine (slow) 2014/05/19 12:50:47 Done.
// This file provides various helpers that extend the functionality around
// base::FieldTrial.
@@ -46,30 +47,6 @@
const VariationID EMPTY_ID = 0;
-// The Unique ID of a trial and its active group, where the name and group
-// identifiers are hashes of the trial and group name strings.
-struct ActiveGroupId {
- uint32 name;
- uint32 group;
-};
-
-// Returns an ActiveGroupId struct for the given trial and group names.
-ActiveGroupId MakeActiveGroupId(const std::string& trial_name,
- const std::string& group_name);
-
-// We need to supply a Compare class for templates since ActiveGroupId is a
-// user-defined type.
-struct ActiveGroupIdCompare {
- bool operator() (const ActiveGroupId& lhs, const ActiveGroupId& rhs) const {
- // The group and name fields are just SHA-1 Hashes, so we just need to treat
- // them as IDs and do a less-than comparison. We test group first, since
- // name is more likely to collide.
- if (lhs.group != rhs.group)
- return lhs.group < rhs.group;
- return lhs.name < rhs.name;
- }
-};
-
// A key into the Associate/Get methods for VariationIDs. This is used to create
// separate ID associations for separate parties interested in VariationIDs.
enum IDCollectionKey {
« no previous file with comments | « components/variations.gypi ('k') | components/variations/variations_associated_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698