#include "components/sync/model/proxy_data_type_controller_delegate.h"
#include <utility>
#include "base/functional/bind.h"
#include "base/task/bind_post_task.h"
#include "base/task/sequenced_task_runner.h"
#include "components/sync/engine/data_type_activation_response.h"
#include "components/sync/model/data_type_activation_request.h"
#include "components/sync/model/type_entities_count.h"
namespace syncer {
namespace {
void OnSyncStartingHelperOnModelThread(
const DataTypeActivationRequest& request,
DataTypeControllerDelegate::StartCallback callback_bound_to_ui_thread,
base::WeakPtr<DataTypeControllerDelegate> delegate) { … }
void HasUnsyncedDataHelperOnModelThread(
base::OnceCallback<void(bool)> callback_bound_to_ui_thread,
base::WeakPtr<DataTypeControllerDelegate> delegate) { … }
void GetAllNodesForDebuggingHelperOnModelThread(
ProxyDataTypeControllerDelegate::AllNodesCallback
callback_bound_to_ui_thread,
base::WeakPtr<DataTypeControllerDelegate> delegate) { … }
void GetTypeEntitiesCountForDebuggingHelperOnModelThread(
base::OnceCallback<void(const TypeEntitiesCount&)>
callback_bound_to_ui_thread,
base::WeakPtr<DataTypeControllerDelegate> delegate) { … }
void StopSyncHelperOnModelThread(
SyncStopMetadataFate metadata_fate,
base::WeakPtr<DataTypeControllerDelegate> delegate) { … }
void RecordMemoryUsageAndCountsHistogramsHelperOnModelThread(
base::WeakPtr<DataTypeControllerDelegate> delegate) { … }
void ClearMetadataIfStoppedHelperOnModelThread(
base::WeakPtr<DataTypeControllerDelegate> delegate) { … }
void ReportBridgeErrorOnModelThreadForTest(
base::WeakPtr<DataTypeControllerDelegate> delegate) { … }
void RunModelTask(
const ProxyDataTypeControllerDelegate::DelegateProvider& delegate_provider,
base::OnceCallback<void(base::WeakPtr<DataTypeControllerDelegate>)> task) { … }
}
ProxyDataTypeControllerDelegate::ProxyDataTypeControllerDelegate(
const scoped_refptr<base::SequencedTaskRunner>& task_runner,
const DelegateProvider& delegate_provider)
: … { … }
ProxyDataTypeControllerDelegate::~ProxyDataTypeControllerDelegate() = default;
void ProxyDataTypeControllerDelegate::OnSyncStarting(
const DataTypeActivationRequest& request,
StartCallback callback) { … }
void ProxyDataTypeControllerDelegate::OnSyncStopping(
SyncStopMetadataFate metadata_fate) { … }
void ProxyDataTypeControllerDelegate::HasUnsyncedData(
base::OnceCallback<void(bool)> callback) { … }
void ProxyDataTypeControllerDelegate::GetAllNodesForDebugging(
AllNodesCallback callback) { … }
void ProxyDataTypeControllerDelegate::GetTypeEntitiesCountForDebugging(
base::OnceCallback<void(const TypeEntitiesCount&)> callback) const { … }
void ProxyDataTypeControllerDelegate::RecordMemoryUsageAndCountsHistograms() { … }
void ProxyDataTypeControllerDelegate::ClearMetadataIfStopped() { … }
void ProxyDataTypeControllerDelegate::ReportBridgeErrorForTest() { … }
void ProxyDataTypeControllerDelegate::PostTask(
const base::Location& location,
base::OnceCallback<void(base::WeakPtr<DataTypeControllerDelegate>)> task)
const { … }
}