#include "components/segmentation_platform/internal/selection/request_handler.h"
#include "base/memory/raw_ref.h"
#include "base/memory/scoped_refptr.h"
#include "base/task/single_thread_task_runner.h"
#include "components/segmentation_platform/internal/post_processor/post_processor.h"
#include "components/segmentation_platform/internal/selection/segment_result_provider.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/input_context.h"
#include "components/segmentation_platform/public/prediction_options.h"
#include "components/segmentation_platform/public/result.h"
#include "components/segmentation_platform/public/trigger.h"
namespace segmentation_platform {
namespace {
class RequestHandlerImpl : public RequestHandler { … };
RequestHandlerImpl::RequestHandlerImpl(
const Config& config,
std::unique_ptr<SegmentResultProvider> result_provider,
ExecutionService* execution_service,
StorageService* storage_service)
: … { … }
RequestHandlerImpl::~RequestHandlerImpl() = default;
void RequestHandlerImpl::GetPredictionResult(
const PredictionOptions& options,
scoped_refptr<InputContext> input_context,
RawResultCallback callback) { … }
void RequestHandlerImpl::GetModelResult(
const PredictionOptions& options,
scoped_refptr<InputContext> input_context,
SegmentResultProvider::SegmentResultCallback callback) { … }
void RequestHandlerImpl::OnGetPredictionResult(
const PredictionOptions& options,
scoped_refptr<InputContext> input_context,
RawResultCallback callback,
std::unique_ptr<SegmentResultProvider::SegmentResult> segment_result) { … }
TrainingRequestId RequestHandlerImpl::CollectTrainingData(
scoped_refptr<InputContext> input_context,
ModelProvider::Request inputs) { … }
}
std::unique_ptr<RequestHandler> RequestHandler::Create(
const Config& config,
std::unique_ptr<SegmentResultProvider> result_provider,
ExecutionService* execution_service,
StorageService* storage_service) { … }
}