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

Unified Diff: base/metrics/field_trial.h

Issue 2633383002: Change FieldTrial::State to not use StringPiece members. (Closed)
Patch Set: Fix initialization in new struct. Created 3 years, 11 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 | « no previous file | base/metrics/field_trial.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/field_trial.h
diff --git a/base/metrics/field_trial.h b/base/metrics/field_trial.h
index 5c5240c42af6bc4ba773f1c2d1fdec21e1179ce1..b2bd0468de49f6ce0fefb0dac244866f2c9190a5 100644
--- a/base/metrics/field_trial.h
+++ b/base/metrics/field_trial.h
@@ -124,11 +124,13 @@ class BASE_EXPORT FieldTrial : public RefCounted<FieldTrial> {
};
// A triplet representing a FieldTrial, its selected group and whether it's
- // active.
+ // active. String members are pointers to the underlying strings owned by the
+ // FieldTrial object. Does not use StringPiece to avoid conversions back to
+ // std::string.
struct BASE_EXPORT State {
- StringPiece trial_name;
- StringPiece group_name;
- bool activated;
+ const std::string* trial_name = nullptr;
+ const std::string* group_name = nullptr;
+ bool activated = false;
State();
State(const State& other);
« no previous file with comments | « no previous file | base/metrics/field_trial.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698