#include "components/segmentation_platform/internal/execution/processing/sync_device_info_observer.h"
#include <optional>
#include "base/feature_list.h"
#include "base/metrics/field_trial_params.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/stringprintf.h"
#include "base/task/sequenced_task_runner.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "components/segmentation_platform/internal/execution/processing/feature_processor_state.h"
#include "components/segmentation_platform/public/types/processed_value.h"
#include "components/sync_device_info/device_info.h"
#include "components/sync_device_info/device_info_tracker.h"
namespace segmentation_platform::processing {
OsType;
FormFactor;
namespace {
constexpr int kActiveDaysThresholdForMetrics = …;
constexpr int kActiveDayThresholdForInputDelegate = …;
#define AS_FLOAT_VAL(x) …
base::TimeDelta GetActivePeriodForMetrics() { … }
base::TimeDelta Age(base::Time last_update, base::Time now) { … }
bool IsDeviceActive(base::Time last_update,
base::Time now,
std::optional<base::TimeDelta> active_threshold) { … }
const char* ConvertOsTypeToString(OsType os_type) { … }
}
BASE_FEATURE(…);
SyncDeviceInfoObserver::SyncDeviceInfoObserver(
syncer::DeviceInfoTracker* device_info_tracker)
: … { … }
SyncDeviceInfoObserver::~SyncDeviceInfoObserver() { … }
void SyncDeviceInfoObserver::OnDeviceInfoChange() { … }
std::map<OsType, int> SyncDeviceInfoObserver::CountActiveDevicesByOsType(
base::TimeDelta active_threshold) const { … }
void SyncDeviceInfoObserver::Process(
const proto::CustomInput& input,
FeatureProcessorState& feature_processor_state,
ProcessedCallback callback) { … }
void SyncDeviceInfoObserver::ReadyToFinishProcessing(
const proto::CustomInput& input,
scoped_refptr<InputContext> input_context,
ProcessedCallback callback,
bool success) { … }
void SyncDeviceInfoObserver::OnTimeout() { … }
}