#include "components/sync/service/model_load_manager.h"
#include <map>
#include <utility>
#include "base/barrier_closure.h"
#include "base/debug/alias.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/not_fatal_until.h"
#include "base/timer/elapsed_timer.h"
#include "components/sync/base/data_type.h"
#include "components/sync/base/features.h"
#include "components/sync/base/sync_stop_metadata_fate.h"
#include "components/sync/model/sync_error.h"
#include "components/sync/service/data_type_controller.h"
namespace syncer {
namespace {
bool ModelIsLoadedOrFailed(const DataTypeController& mtc) { … }
}
const base::TimeDelta kSyncLoadModelsTimeoutDuration = …;
ModelLoadManager::ModelLoadManager(
const DataTypeController::TypeMap* controllers,
ModelLoadManagerDelegate* processor)
: … { … }
ModelLoadManager::~ModelLoadManager() = default;
void ModelLoadManager::Configure(DataTypeSet preferred_types_without_errors,
DataTypeSet preferred_types,
const ConfigureContext& context) { … }
void ModelLoadManager::StopDatatype(DataType type,
SyncStopMetadataFate metadata_fate,
SyncError error) { … }
void ModelLoadManager::StopDatatypeImpl(
const SyncError& error,
SyncStopMetadataFate metadata_fate,
DataTypeController* dtc,
DataTypeController::StopCallback callback) { … }
void ModelLoadManager::LoadDesiredTypes() { … }
void ModelLoadManager::Stop(SyncStopMetadataFate metadata_fate) { … }
void ModelLoadManager::ModelLoadCallback(DataType type,
const SyncError& error) { … }
void ModelLoadManager::NotifyDelegateIfReadyForConfigure() { … }
void ModelLoadManager::OnLoadModelsTimeout() { … }
void ModelLoadManager::LoadModelsForType(DataTypeController* dtc) { … }
}