Index: base/metrics/field_trial.h |
=================================================================== |
--- base/metrics/field_trial.h (revision 118842) |
+++ base/metrics/field_trial.h (working copy) |
@@ -92,6 +92,9 @@ |
class BASE_EXPORT FieldTrial : public RefCounted<FieldTrial> { |
public: |
typedef int Probability; // Probability type for being selected in a trial. |
+ // The Unique ID of a trial, first element is a hashed value of the name |
+ // and the second one is the group identifier. |
+ typedef std::pair<size_t, int> UID; |
jar (doing other things)
2012/01/24 19:19:45
You might want to send two hashes, rather than one
MAD
2012/01/24 20:30:24
OK! Done...
Thanks! :-)
|
// A return value to indicate that a given instance has not yet had a group |
// assignment (and hence is not yet participating in the trial). |
@@ -148,6 +151,10 @@ |
// number is used as the group name. |
std::string group_name(); |
+ // Gets the unique identifier of the Field Trial, but only if a winner was |
+ // elected. Returns true if a winner is returned, false otherwise. |
+ bool GetUID(UID* uid); |
+ |
// Return the default group name of the FieldTrial. |
std::string default_group_name() const { return default_group_name_; } |
@@ -285,11 +292,14 @@ |
// Create a persistent representation of all FieldTrial instances and the |
// |client_id()| state for resurrection in another process. This allows |
- // randomization to be done in one process, and secondary processes can by |
+ // randomization to be done in one process, and secondary processes can be |
// synchronized on the result. The resulting string contains the |
// |client_id()|, the names, the trial name, and a "/" separator. |
static void StatesToString(std::string* output); |
+ // Returns an array of Unique IDs for each currently running Field Trials. |
+ static void GetFieldTrialUIDs(std::vector<FieldTrial::UID>* uids); |
+ |
// Use a previously generated state string (re: StatesToString()) augment the |
// current list of field tests to include the supplied tests, and using a 100% |
// probability for each test, force them to have the same group string. This |