OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "components/variations/study_filtering.h" | 5 #include "components/variations/study_filtering.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 namespace chrome_variations { | 9 namespace variations { |
10 | 10 |
11 namespace { | 11 namespace { |
12 | 12 |
13 Study_Platform GetCurrentPlatform() { | 13 Study_Platform GetCurrentPlatform() { |
14 #if defined(OS_WIN) | 14 #if defined(OS_WIN) |
15 return Study_Platform_PLATFORM_WINDOWS; | 15 return Study_Platform_PLATFORM_WINDOWS; |
16 #elif defined(OS_IOS) | 16 #elif defined(OS_IOS) |
17 return Study_Platform_PLATFORM_IOS; | 17 return Study_Platform_PLATFORM_IOS; |
18 #elif defined(OS_MACOSX) | 18 #elif defined(OS_MACOSX) |
19 return Study_Platform_PLATFORM_MAC; | 19 return Study_Platform_PLATFORM_MAC; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 DVLOG(1) << "Filtered out study " << study.name() << | 198 DVLOG(1) << "Filtered out study " << study.name() << |
199 " due to start date."; | 199 " due to start date."; |
200 return false; | 200 return false; |
201 } | 201 } |
202 | 202 |
203 if (!CheckStudyHardwareClass(study.filter(), hardware_class)) { | 203 if (!CheckStudyHardwareClass(study.filter(), hardware_class)) { |
204 DVLOG(1) << "Filtered out study " << study.name() << | 204 DVLOG(1) << "Filtered out study " << study.name() << |
205 " due to hardware_class."; | 205 " due to hardware_class."; |
206 return false; | 206 return false; |
207 } | 207 } |
208 | |
209 } | 208 } |
210 | 209 |
211 DVLOG(1) << "Kept study " << study.name() << "."; | 210 DVLOG(1) << "Kept study " << study.name() << "."; |
212 return true; | 211 return true; |
213 } | 212 } |
214 | 213 |
215 } // namespace internal | 214 } // namespace internal |
216 | 215 |
217 void FilterAndValidateStudies( | 216 void FilterAndValidateStudies( |
218 const VariationsSeed& seed, | 217 const VariationsSeed& seed, |
(...skipping 29 matching lines...) Expand all Loading... |
248 } | 247 } |
249 | 248 |
250 for (size_t i = 0; i < expired_studies.size(); ++i) { | 249 for (size_t i = 0; i < expired_studies.size(); ++i) { |
251 if (!ContainsKey(created_studies, expired_studies[i]->name())) { | 250 if (!ContainsKey(created_studies, expired_studies[i]->name())) { |
252 ProcessedStudy::ValidateAndAppendStudy(expired_studies[i], true, | 251 ProcessedStudy::ValidateAndAppendStudy(expired_studies[i], true, |
253 filtered_studies); | 252 filtered_studies); |
254 } | 253 } |
255 } | 254 } |
256 } | 255 } |
257 | 256 |
258 } // namespace chrome_variations | 257 } // namespace variations |
OLD | NEW |