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

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: rebase 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
« no previous file with comments | « no previous file | chrome/browser/metrics/variations/variations_service.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 (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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 // Store the given seed data to the given local prefs. Note that |seed_data| 93 // Store the given seed data to the given local prefs. Note that |seed_data|
94 // is assumed to be the raw serialized protobuf data stored in a string. It 94 // is assumed to be the raw serialized protobuf data stored in a string. It
95 // will be Base64Encoded for storage. If the string is invalid or the encoding 95 // will be Base64Encoded for storage. If the string is invalid or the encoding
96 // fails, the |local_prefs| is left as is and the function returns false. 96 // fails, the |local_prefs| is left as is and the function returns false.
97 bool StoreSeedData(const std::string& seed_data, 97 bool StoreSeedData(const std::string& seed_data,
98 const base::Time& seed_date, 98 const base::Time& seed_date,
99 PrefService* local_prefs); 99 PrefService* local_prefs);
100 100
101 // Returns whether |study| should be disabled according to its restriction 101 // Returns whether |study| should be disabled according to its restriction
102 // parameters. Uses |version_info| for min / max version checks and 102 // parameters. Uses |version_info| for min / max version checks,
103 // |reference_date| for the start date check. 103 // |reference_date| for the start date check and |channel| for channel
104 // checks.
104 static bool ShouldAddStudy(const Study& study, 105 static bool ShouldAddStudy(const Study& study,
105 const chrome::VersionInfo& version_info, 106 const chrome::VersionInfo& version_info,
106 const base::Time& reference_date); 107 const base::Time& reference_date,
108 chrome::VersionInfo::Channel channel);
107 109
108 // Checks whether a study is applicable for the given |channel| per |filter|. 110 // Checks whether a study is applicable for the given |channel| per |filter|.
109 static bool CheckStudyChannel(const Study_Filter& filter, 111 static bool CheckStudyChannel(const Study_Filter& filter,
110 chrome::VersionInfo::Channel channel); 112 chrome::VersionInfo::Channel channel);
111 113
112 // Checks whether a study is applicable for the given |locale| per |filter|. 114 // Checks whether a study is applicable for the given |locale| per |filter|.
113 static bool CheckStudyLocale(const chrome_variations::Study_Filter& filter, 115 static bool CheckStudyLocale(const chrome_variations::Study_Filter& filter,
114 const std::string& locale); 116 const std::string& locale);
115 117
116 // Checks whether a study is applicable for the given |platform| per |filter|. 118 // Checks whether a study is applicable for the given |platform| per |filter|.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 scoped_ptr<ResourceRequestAllowedNotifier> resource_request_allowed_notifier_; 171 scoped_ptr<ResourceRequestAllowedNotifier> resource_request_allowed_notifier_;
170 172
171 // The start time of the last seed request. This is used to measure the 173 // The start time of the last seed request. This is used to measure the
172 // latency of seed requests. Initially zero. 174 // latency of seed requests. Initially zero.
173 base::TimeTicks last_request_started_time_; 175 base::TimeTicks last_request_started_time_;
174 }; 176 };
175 177
176 } // namespace chrome_variations 178 } // namespace chrome_variations
177 179
178 #endif // CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_ 180 #endif // CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/metrics/variations/variations_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698