#include "components/variations/study_filtering.h"
#include <stddef.h>
#include <stdint.h>
#include <cstdint>
#include <functional>
#include <set>
#include <string_view>
#include "base/containers/contains.h"
#include "base/logging.h"
#include "base/strings/string_util.h"
#include "components/variations/variations_layers.h"
#include "components/variations/variations_seed_processor.h"
namespace variations {
namespace {
base::Time ConvertStudyDateToBaseTime(int64_t date_time) { … }
template <typename Collection>
bool ContainsStringIgnoreCaseASCII(const Collection& collection,
const std::string& value) { … }
}
namespace internal {
bool CheckStudyChannel(const Study::Filter& filter, Study::Channel channel) { … }
bool CheckStudyFormFactor(const Study::Filter& filter,
Study::FormFactor form_factor) { … }
bool CheckStudyCpuArchitecture(const Study::Filter& filter,
Study::CpuArchitecture cpu_architecture) { … }
bool CheckStudyHardwareClass(const Study::Filter& filter,
const std::string& hardware_class) { … }
bool CheckStudyLocale(const Study::Filter& filter, const std::string& locale) { … }
bool CheckStudyCountry(const Study::Filter& filter,
const std::string& country) { … }
bool CheckStudyPlatform(const Study::Filter& filter, Study::Platform platform) { … }
bool CheckStudyLowEndDevice(const Study::Filter& filter,
bool is_low_end_device) { … }
bool CheckStudyPolicyRestriction(const Study::Filter& filter,
RestrictionPolicy policy_restriction) { … }
bool CheckStudyStartDate(const Study::Filter& filter,
const base::Time& date_time) { … }
bool CheckStudyEndDate(const Study::Filter& filter,
const base::Time& date_time) { … }
bool CheckStudyVersion(const Study::Filter& filter,
const base::Version& version) { … }
bool CheckStudyOSVersion(const Study::Filter& filter,
const base::Version& version) { … }
bool CheckStudyEnterprise(const Study::Filter& filter,
const ClientFilterableState& client_state) { … }
bool CheckStudyGoogleGroup(const Study::Filter& filter,
const ClientFilterableState& client_state) { … }
const std::string& GetClientCountryForStudy(
const Study& study,
const ClientFilterableState& client_state) { … }
bool ShouldAddStudy(const ProcessedStudy& processed_study,
const ClientFilterableState& client_state,
const VariationsLayers& layers) { … }
}
std::vector<ProcessedStudy> FilterAndValidateStudies(
const VariationsSeed& seed,
const ClientFilterableState& client_state,
const VariationsLayers& layers) { … }
}