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

Side by Side Diff: base/feature_list.h

Issue 1848523002: Changes to support using base/feature_list.h from gin/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 8 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
« no previous file with comments | « no previous file | base/feature_list.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef BASE_FEATURE_LIST_H_ 5 #ifndef BASE_FEATURE_LIST_H_
6 #define BASE_FEATURE_LIST_H_ 6 #define BASE_FEATURE_LIST_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // a feature with a given name must only have a single corresponding Feature 140 // a feature with a given name must only have a single corresponding Feature
141 // struct, which is checked in builds with DCHECKs enabled. 141 // struct, which is checked in builds with DCHECKs enabled.
142 static bool IsEnabled(const Feature& feature); 142 static bool IsEnabled(const Feature& feature);
143 143
144 // Splits a comma-separated string containing feature names into a vector. 144 // Splits a comma-separated string containing feature names into a vector.
145 static std::vector<std::string> SplitFeatureListString( 145 static std::vector<std::string> SplitFeatureListString(
146 const std::string& input); 146 const std::string& input);
147 147
148 // Initializes and sets an instance of FeatureList with feature overrides via 148 // Initializes and sets an instance of FeatureList with feature overrides via
149 // command-line flags |enable_features| and |disable_features| if one has not 149 // command-line flags |enable_features| and |disable_features| if one has not
150 // already been set from command-line flags. No-op otherwise. See 150 // already been set from command-line flags. Returns true if an instance did
151 // InitializeFromCommandLine for more details about |enable_features| and 151 // not previously exist. See InitializeFromCommandLine() for more details
152 // |disable_features| parameters. 152 // about |enable_features| and |disable_features| parameters.
153 static void InitializeInstance(const std::string& enable_features, 153 static bool InitializeInstance(const std::string& enable_features,
154 const std::string& disable_features); 154 const std::string& disable_features);
155 155
156 // Returns the singleton instance of FeatureList. Will return null until an 156 // Returns the singleton instance of FeatureList. Will return null until an
157 // instance is registered via SetInstance(). 157 // instance is registered via SetInstance().
158 static FeatureList* GetInstance(); 158 static FeatureList* GetInstance();
159 159
160 // Registers the given |instance| to be the singleton feature list for this 160 // Registers the given |instance| to be the singleton feature list for this
161 // process. This should only be called once and |instance| must not be null. 161 // process. This should only be called once and |instance| must not be null.
162 static void SetInstance(std::unique_ptr<FeatureList> instance); 162 static void SetInstance(std::unique_ptr<FeatureList> instance);
163 163
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 241
242 // Whether this object has been initialized from command line. 242 // Whether this object has been initialized from command line.
243 bool initialized_from_command_line_; 243 bool initialized_from_command_line_;
244 244
245 DISALLOW_COPY_AND_ASSIGN(FeatureList); 245 DISALLOW_COPY_AND_ASSIGN(FeatureList);
246 }; 246 };
247 247
248 } // namespace base 248 } // namespace base
249 249
250 #endif // BASE_FEATURE_LIST_H_ 250 #endif // BASE_FEATURE_LIST_H_
OLDNEW
« no previous file with comments | « no previous file | base/feature_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698