#include "components/segmentation_platform/internal/selection/result_refresh_manager.h"
#include "base/metrics/field_trial_params.h"
#include "components/segmentation_platform/internal/selection/selection_utils.h"
#include "components/segmentation_platform/internal/stats.h"
#include "components/segmentation_platform/public/config.h"
#include "components/segmentation_platform/public/constants.h"
#include "components/segmentation_platform/public/features.h"
namespace segmentation_platform {
namespace {
const int kModelInitializationTimeoutMs = …;
int GetModelInitializationTimeoutMs() { … }
bool SupportMultiOutput(SegmentResultProvider::SegmentResult* result) { … }
void CollectTrainingDataIfNeeded(const Config* config,
ExecutionService* execution_service) { … }
}
ResultRefreshManager::ResultRefreshManager(
const ConfigHolder* config_holder,
CachedResultWriter* cached_result_writer,
const PlatformOptions& platform_options)
: … { … }
ResultRefreshManager::~ResultRefreshManager() = default;
void ResultRefreshManager::Initialize(
std::map<std::string, std::unique_ptr<SegmentResultProvider>>
result_providers,
ExecutionService* execution_service) { … }
void ResultRefreshManager::RefreshModelResults(bool is_startup) { … }
void ResultRefreshManager::RefreshModelResultsInternal() { … }
void ResultRefreshManager::GetCachedResultOrRunModel(const Config* config) { … }
void ResultRefreshManager::OnModelUpdated(proto::SegmentInfo* segment_info) { … }
void ResultRefreshManager::OnGetCachedResultOrRunModel(
SegmentResultProvider* segment_result_provider,
const Config* config,
std::unique_ptr<SegmentResultProvider::SegmentResult> result) { … }
}