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

Side by Side Diff: chrome/common/variations/experiment_labels.cc

Issue 1182183003: Move EndsWith to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/variations/experiment_labels.h" 5 #include "chrome/common/variations/experiment_labels.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 non_variation_labels += *it; 89 non_variation_labels += *it;
90 } 90 }
91 91
92 return non_variation_labels; 92 return non_variation_labels;
93 } 93 }
94 94
95 base::string16 CombineExperimentLabels(const base::string16& variation_labels, 95 base::string16 CombineExperimentLabels(const base::string16& variation_labels,
96 const base::string16& other_labels) { 96 const base::string16& other_labels) {
97 const base::string16 separator(1, google_update::kExperimentLabelSeparator); 97 const base::string16 separator(1, google_update::kExperimentLabelSeparator);
98 DCHECK(!base::StartsWith(variation_labels, separator, false)); 98 DCHECK(!base::StartsWith(variation_labels, separator, false));
99 DCHECK(!EndsWith(variation_labels, separator, false)); 99 DCHECK(!base::EndsWith(variation_labels, separator, false));
100 DCHECK(!base::StartsWith(other_labels, separator, false)); 100 DCHECK(!base::StartsWith(other_labels, separator, false));
101 DCHECK(!EndsWith(other_labels, separator, false)); 101 DCHECK(!base::EndsWith(other_labels, separator, false));
102 // Note that if either label is empty, a separator is not necessary. 102 // Note that if either label is empty, a separator is not necessary.
103 base::string16 combined_labels = other_labels; 103 base::string16 combined_labels = other_labels;
104 if (!other_labels.empty() && !variation_labels.empty()) 104 if (!other_labels.empty() && !variation_labels.empty())
105 combined_labels += google_update::kExperimentLabelSeparator; 105 combined_labels += google_update::kExperimentLabelSeparator;
106 combined_labels += variation_labels; 106 combined_labels += variation_labels;
107 return combined_labels; 107 return combined_labels;
108 } 108 }
109 109
110 } // namespace chrome_variations 110 } // namespace chrome_variations
OLDNEW
« no previous file with comments | « chrome/common/service_process_util_unittest.cc ('k') | chrome/installer/setup/setup_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698