chromium/components/sync/service/non_ui_syncable_service_based_data_type_controller.cc

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/sync/service/non_ui_syncable_service_based_data_type_controller.h"

#include <memory>
#include <string>
#include <utility>

#include "base/check_is_test.h"
#include "base/functional/bind.h"
#include "base/memory/weak_ptr.h"
#include "base/task/sequenced_task_runner.h"
#include "components/sync/base/data_type.h"
#include "components/sync/model/client_tag_based_data_type_processor.h"
#include "components/sync/model/forwarding_data_type_controller_delegate.h"
#include "components/sync/model/proxy_data_type_controller_delegate.h"
#include "components/sync/model/syncable_service_based_bridge.h"

namespace syncer {

namespace {

// DataTypeSyncBridge implementation for test-only code-path :(
// This is required to allow calling
// DataTypeController::ClearMetadataWhileStopped() in browser tests.
// TODO(crbug.com/40894683): Remove test-only code-path.
class FakeSyncableServiceBasedBridge : public DataTypeSyncBridge {};

// Helper object that allows constructing and destructing the
// SyncableServiceBasedBridge on the model thread. Gets constructed on the UI
// thread, but all other operations including destruction happen on the model
// thread.
class BridgeBuilder {};

// This is a slightly adapted version of base::OnTaskRunnerDeleter: The one
// difference is that if the destruction request already happens on the target
// sequence, then this avoids posting a task, and instead deletes the given
// object immediately. See https://crbug.com/970354#c19.
struct CustomOnTaskRunnerDeleter {};

ProxyDataTypeControllerDelegate::DelegateProvider BuildDelegateProvider(
    DataType type,
    OnceDataTypeStoreFactory store_factory,
    NonUiSyncableServiceBasedDataTypeController::SyncableServiceProvider
        syncable_service_provider,
    const base::RepeatingClosure& dump_stack,
    scoped_refptr<base::SequencedTaskRunner> task_runner) {}

}  // namespace

NonUiSyncableServiceBasedDataTypeController::
    NonUiSyncableServiceBasedDataTypeController(
        DataType type,
        OnceDataTypeStoreFactory store_factory,
        SyncableServiceProvider syncable_service_provider,
        const base::RepeatingClosure& dump_stack,
        scoped_refptr<base::SequencedTaskRunner> task_runner,
        DelegateMode delegate_mode)
    :{}

NonUiSyncableServiceBasedDataTypeController::
    ~NonUiSyncableServiceBasedDataTypeController() = default;

}  // namespace syncer