| Index: components/variations/experiment_labels.cc
|
| diff --git a/components/variations/experiment_labels.cc b/components/variations/experiment_labels.cc
|
| index ef9788055adb7043f72dc22450fbfc4178fc63b3..c7cce9518b8ac4d2256efca4dd233a5775e2db97 100644
|
| --- a/components/variations/experiment_labels.cc
|
| +++ b/components/variations/experiment_labels.cc
|
| @@ -20,55 +20,8 @@ namespace {
|
|
|
| const char kVariationPrefix[] = "CrVar";
|
|
|
| -// This method builds a single experiment label for a Chrome Variation,
|
| -// including a timestamp that is a year in the future from |current_time|. Since
|
| -// multiple headers can be transmitted, |count| is a number that is appended
|
| -// after the label key to differentiate the labels.
|
| -base::string16 CreateSingleExperimentLabel(int count,
|
| - variations::VariationID id,
|
| - const base::Time& current_time) {
|
| - // Build the parts separately so they can be validated.
|
| - const base::string16 key =
|
| - base::ASCIIToUTF16(kVariationPrefix) + base::IntToString16(count);
|
| - DCHECK_LE(key.size(), 8U);
|
| - const base::string16 value = base::IntToString16(id);
|
| - DCHECK_LE(value.size(), 8U);
|
| - base::string16 label(key);
|
| - label += base::ASCIIToUTF16("=");
|
| - label += value;
|
| - label += base::ASCIIToUTF16("|");
|
| - label += variations::BuildExperimentDateString(current_time);
|
| - return label;
|
| -}
|
| -
|
| } // namespace
|
|
|
| -base::string16 BuildGoogleUpdateExperimentLabel(
|
| - const base::FieldTrial::ActiveGroups& active_groups) {
|
| - base::string16 experiment_labels;
|
| - int counter = 0;
|
| -
|
| - const base::Time current_time(base::Time::Now());
|
| -
|
| - // Find all currently active VariationIDs associated with Google Update.
|
| - for (base::FieldTrial::ActiveGroups::const_iterator it =
|
| - active_groups.begin(); it != active_groups.end(); ++it) {
|
| - const variations::VariationID id =
|
| - variations::GetGoogleVariationID(variations::GOOGLE_UPDATE_SERVICE,
|
| - it->trial_name, it->group_name);
|
| -
|
| - if (id == variations::EMPTY_ID)
|
| - continue;
|
| -
|
| - if (!experiment_labels.empty())
|
| - experiment_labels += variations::kExperimentLabelSeparator;
|
| - experiment_labels += CreateSingleExperimentLabel(++counter, id,
|
| - current_time);
|
| - }
|
| -
|
| - return experiment_labels;
|
| -}
|
| -
|
| base::string16 ExtractNonVariationLabels(const base::string16& labels) {
|
| // First, split everything by the label separator.
|
| std::vector<base::StringPiece16> entries = base::SplitStringPiece(
|
| @@ -94,23 +47,4 @@ base::string16 ExtractNonVariationLabels(const base::string16& labels) {
|
| return non_variation_labels;
|
| }
|
|
|
| -base::string16 CombineExperimentLabels(const base::string16& variation_labels,
|
| - const base::string16& other_labels) {
|
| - base::StringPiece16 separator(&variations::kExperimentLabelSeparator, 1);
|
| - DCHECK(!base::StartsWith(variation_labels, separator,
|
| - base::CompareCase::SENSITIVE));
|
| - DCHECK(!base::EndsWith(variation_labels, separator,
|
| - base::CompareCase::SENSITIVE));
|
| - DCHECK(!base::StartsWith(other_labels, separator,
|
| - base::CompareCase::SENSITIVE));
|
| - DCHECK(!base::EndsWith(other_labels, separator,
|
| - base::CompareCase::SENSITIVE));
|
| - // Note that if either label is empty, a separator is not necessary.
|
| - base::string16 combined_labels = other_labels;
|
| - if (!other_labels.empty() && !variation_labels.empty())
|
| - combined_labels += variations::kExperimentLabelSeparator;
|
| - combined_labels += variation_labels;
|
| - return combined_labels;
|
| -}
|
| -
|
| } // namespace variations
|
|
|