Index: chrome/common/metrics/variations/variations_util.cc |
diff --git a/chrome/common/metrics/variations/variations_util.cc b/chrome/common/metrics/variations/variations_util.cc |
index 5ef0bf89d3ef8337225a4fdb555346b8daed17ce..e0ffaf61b403b12ca0a8c1468f665f76aece05a0 100644 |
--- a/chrome/common/metrics/variations/variations_util.cc |
+++ b/chrome/common/metrics/variations/variations_util.cc |
@@ -13,6 +13,7 @@ |
#include "base/strings/stringprintf.h" |
#include "base/strings/utf_string_conversions.h" |
#include "chrome/common/child_process_logging.h" |
+#include "chrome/installer/util/google_update_constants.h" |
#include "chrome/installer/util/google_update_experiment_util.h" |
namespace chrome_variations { |
@@ -20,7 +21,6 @@ namespace chrome_variations { |
namespace { |
const char kVariationPrefix[] = "CrVar"; |
-const char kExperimentLabelSep[] = ";"; |
robertshield
2013/08/30 01:13:53
This has gone from a char to a wchar_t and doesn't
Alexei Svitkine (slow)
2013/08/30 02:16:47
It should be a char16, since on some platforms wch
gab
2013/08/30 02:43:18
Good catch; thanks for the hint; done.
|
// Populates |name_group_ids| based on |active_groups|. |
void GetFieldTrialActiveGroupIdsForActiveGroups( |
@@ -118,7 +118,7 @@ string16 BuildGoogleUpdateExperimentLabel( |
continue; |
if (!experiment_labels.empty()) |
- experiment_labels += ASCIIToUTF16(kExperimentLabelSep); |
+ experiment_labels += google_update::kExperimentLabelSep; |
experiment_labels += CreateSingleExperimentLabel(++counter, id); |
} |
@@ -126,12 +126,12 @@ string16 BuildGoogleUpdateExperimentLabel( |
} |
string16 ExtractNonVariationLabels(const string16& labels) { |
- const string16 separator = ASCIIToUTF16(kExperimentLabelSep); |
string16 non_variation_labels; |
// First, split everything by the label separator. |
std::vector<string16> entries; |
- base::SplitStringUsingSubstr(labels, separator, &entries); |
+ base::SplitStringUsingSubstr( |
+ labels, google_update::kExperimentLabelSep, &entries); |
// For each label, keep the ones that do not look like a Variations label. |
for (std::vector<string16>::const_iterator it = entries.begin(); |
@@ -141,7 +141,7 @@ string16 ExtractNonVariationLabels(const string16& labels) { |
// Dump the whole thing, including the timestamp. |
if (!non_variation_labels.empty()) |
- non_variation_labels += separator; |
+ non_variation_labels += google_update::kExperimentLabelSep; |
non_variation_labels += *it; |
} |
@@ -150,15 +150,16 @@ string16 ExtractNonVariationLabels(const string16& labels) { |
string16 CombineExperimentLabels(const string16& variation_labels, |
const string16& other_labels) { |
- const string16 separator = ASCIIToUTF16(kExperimentLabelSep); |
- DCHECK(!StartsWith(variation_labels, separator, false)); |
- DCHECK(!EndsWith(variation_labels, separator, false)); |
- DCHECK(!StartsWith(other_labels, separator, false)); |
- DCHECK(!EndsWith(other_labels, separator, false)); |
+ DCHECK(!StartsWith(variation_labels, google_update::kExperimentLabelSep, |
+ false)); |
+ DCHECK(!EndsWith(variation_labels, google_update::kExperimentLabelSep, |
+ false)); |
+ DCHECK(!StartsWith(other_labels, google_update::kExperimentLabelSep, false)); |
+ DCHECK(!EndsWith(other_labels, google_update::kExperimentLabelSep, false)); |
// Note that if either label is empty, a separator is not necessary. |
string16 combined_labels = other_labels; |
if (!other_labels.empty() && !variation_labels.empty()) |
- combined_labels += separator; |
+ combined_labels += google_update::kExperimentLabelSep; |
combined_labels += variation_labels; |
return combined_labels; |
} |