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

Side by Side Diff: chromecast/base/cast_features.h

Issue 2825873002: [Chromecast] Use base::FeatureList to control features. (Closed)
Patch Set: Rebase. Created 3 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
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROMECAST_BASE_CAST_FEATURES_H_
6 #define CHROMECAST_BASE_CAST_FEATURES_H_
7
8 #include <memory>
9 #include <unordered_set>
10
11 #include "base/feature_list.h"
12 #include "base/macros.h"
13
14 namespace base {
15 class DictionaryValue;
16 class ListValue;
17 }
18
19 namespace chromecast {
20
21 // Initialize the global base::FeatureListInstance, taking into account
22 // overrides from DCS and the command line. |features| is read from the
23 // PrefService in the browser. Thread-safe.
halliwell 2017/04/20 02:49:31 I'm not sure "Thread-safe" completely characterise
slan 2017/04/20 16:26:02 You're right. Done.
24 void InitializeFeatureList(const base::DictionaryValue& dcs_features,
25 const base::ListValue& dcs_experiment_ids,
26 const std::string& cmd_line_enable_features,
halliwell 2017/04/20 02:49:31 nit, include string
slan 2017/04/20 16:26:02 Done.
27 const std::string& cmd_line_disable_features);
28
29 // Given a dictionary of features, create a copy that is ready to be persisted
30 // to disk. Encodes all values as strings, which is how the FieldTrial
31 // classes expect the param data.
32 std::unique_ptr<base::DictionaryValue> GetOverriddenFeaturesForStorage(
33 const base::DictionaryValue& features);
34
35 // Query the set of experiment ids set for this run. Intended only for metrics
36 // reporting. Must be called after InitializeFeatureList. Thread-safe.
37 std::unordered_set<int32_t> GetDCSExperimentIds();
halliwell 2017/04/20 02:49:31 include <cstdint>
halliwell 2017/04/20 02:49:31 how big is this set? Are users expecting to modif
slan 2017/04/20 16:26:02 Done.
slan 2017/04/20 16:26:02 This set is read-only. It will only ever be as lar
38
39 // Reset static state to ensure clean unittests. For tests only!
40 void ResetCastFeaturesForTest();
41
42 } // namespace chromecast
43
44 #endif // CHROMECAST_BASE_CAST_FEATURES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698