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

Side by Side Diff: chrome/browser/metrics/variations/variations_service.h

Issue 11737025: Add a switch for faking channels for Variations filtering. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: parameterize the channel Created 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_ 5 #ifndef CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_
6 #define CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_ 6 #define CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 // Store the given seed data to the given local prefs. Note that |seed_data| 88 // Store the given seed data to the given local prefs. Note that |seed_data|
89 // is assumed to be the raw serialized protobuf data stored in a string. It 89 // is assumed to be the raw serialized protobuf data stored in a string. It
90 // will be Base64Encoded for storage. If the string is invalid or the encoding 90 // will be Base64Encoded for storage. If the string is invalid or the encoding
91 // fails, the |local_prefs| is left as is and the function returns false. 91 // fails, the |local_prefs| is left as is and the function returns false.
92 bool StoreSeedData(const std::string& seed_data, 92 bool StoreSeedData(const std::string& seed_data,
93 const base::Time& seed_date, 93 const base::Time& seed_date,
94 PrefService* local_prefs); 94 PrefService* local_prefs);
95 95
96 // Returns whether |study| should be disabled according to its restriction 96 // Returns whether |study| should be disabled according to its restriction
97 // parameters. Uses |version_info| for min / max version checks and 97 // parameters. Uses |version_info| for min / max version checks,
98 // |reference_date| for the start date check. 98 // |reference_date| for the start date check and |channel| for channel
99 // checks.
99 static bool ShouldAddStudy(const Study& study, 100 static bool ShouldAddStudy(const Study& study,
100 const chrome::VersionInfo& version_info, 101 const chrome::VersionInfo& version_info,
101 const base::Time& reference_date); 102 const base::Time& reference_date,
103 chrome::VersionInfo::Channel channel);
102 104
103 // Checks whether a study is applicable for the given |channel| per |filter|. 105 // Checks whether a study is applicable for the given |channel| per |filter|.
104 static bool CheckStudyChannel(const Study_Filter& filter, 106 static bool CheckStudyChannel(const Study_Filter& filter,
105 chrome::VersionInfo::Channel channel); 107 chrome::VersionInfo::Channel channel);
106 108
107 // Checks whether a study is applicable for the given |locale| per |filter|. 109 // Checks whether a study is applicable for the given |locale| per |filter|.
108 static bool CheckStudyLocale(const chrome_variations::Study_Filter& filter, 110 static bool CheckStudyLocale(const chrome_variations::Study_Filter& filter,
109 const std::string& locale); 111 const std::string& locale);
110 112
111 // Checks whether a study is applicable for the given |platform| per |filter|. 113 // Checks whether a study is applicable for the given |platform| per |filter|.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 scoped_ptr<ResourceRequestAllowedNotifier> resource_request_allowed_notifier_; 166 scoped_ptr<ResourceRequestAllowedNotifier> resource_request_allowed_notifier_;
165 167
166 // The start time of the last seed request. This is used to measure the 168 // The start time of the last seed request. This is used to measure the
167 // latency of seed requests. Initially zero. 169 // latency of seed requests. Initially zero.
168 base::TimeTicks last_request_started_time_; 170 base::TimeTicks last_request_started_time_;
169 }; 171 };
170 172
171 } // namespace chrome_variations 173 } // namespace chrome_variations
172 174
173 #endif // CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_ 175 #endif // CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698