Commit 5b7a7d8c authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

Remove unused SyncClient param from GenericChangeProcessor

TBRing trivial test call site updates
TBR=sebsg,vasilii

Bug: none
Change-Id: I555fb199aa9fd7391dcd557659e19f7cd1edc1a1
Reviewed-on: https://chromium-review.googlesource.com/c/1436237
Commit-Queue: Marc Treib <treib@chromium.org>
Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626475}
parent 9aced7b4
......@@ -121,7 +121,7 @@ class AutofillWalletDataTypeControllerTest : public testing::Test,
autofill_wallet_dtc_->SetGenericChangeProcessorFactoryForTest(
std::make_unique<syncer::FakeGenericChangeProcessorFactory>(
std::make_unique<syncer::FakeGenericChangeProcessor>(
syncer::AUTOFILL_WALLET_DATA, this)));
syncer::AUTOFILL_WALLET_DATA)));
}
void Start() {
......
......@@ -67,10 +67,9 @@ class SyncSearchEngineDataTypeControllerTest : public testing::Test,
void SetStartExpectations() {
search_engine_dtc_.SetGenericChangeProcessorFactoryForTest(
base::WrapUnique<syncer::GenericChangeProcessorFactory>(
new syncer::FakeGenericChangeProcessorFactory(
std::make_unique<syncer::FakeGenericChangeProcessor>(
syncer::SEARCH_ENGINES, this))));
std::make_unique<syncer::FakeGenericChangeProcessorFactory>(
std::make_unique<syncer::FakeGenericChangeProcessor>(
syncer::SEARCH_ENGINES)));
EXPECT_CALL(model_load_callback_, Run(_, _));
}
......
......@@ -12,14 +12,12 @@
namespace syncer {
FakeGenericChangeProcessor::FakeGenericChangeProcessor(ModelType type,
SyncClient* sync_client)
FakeGenericChangeProcessor::FakeGenericChangeProcessor(ModelType type)
: GenericChangeProcessor(type,
nullptr,
base::WeakPtr<SyncableService>(),
base::WeakPtr<SyncMergeResult>(),
nullptr,
sync_client),
nullptr),
sync_model_has_user_created_nodes_(true),
sync_model_has_user_created_nodes_success_(true) {}
......@@ -75,8 +73,7 @@ FakeGenericChangeProcessorFactory::CreateGenericChangeProcessor(
UserShare* user_share,
std::unique_ptr<DataTypeErrorHandler> error_handler,
const base::WeakPtr<SyncableService>& local_service,
const base::WeakPtr<SyncMergeResult>& merge_result,
SyncClient* sync_client) {
const base::WeakPtr<SyncMergeResult>& merge_result) {
return std::move(processor_);
}
......
......@@ -20,7 +20,7 @@ namespace syncer {
// A fake GenericChangeProcessor that can return arbitrary values.
class FakeGenericChangeProcessor : public GenericChangeProcessor {
public:
FakeGenericChangeProcessor(ModelType type, SyncClient* sync_client);
explicit FakeGenericChangeProcessor(ModelType type);
~FakeGenericChangeProcessor() override;
// Setters for GenericChangeProcessor implementation results.
......@@ -52,8 +52,7 @@ class FakeGenericChangeProcessorFactory : public GenericChangeProcessorFactory {
UserShare* user_share,
std::unique_ptr<DataTypeErrorHandler> error_handler,
const base::WeakPtr<SyncableService>& local_service,
const base::WeakPtr<SyncMergeResult>& merge_result,
SyncClient* sync_client) override;
const base::WeakPtr<SyncMergeResult>& merge_result) override;
private:
std::unique_ptr<FakeGenericChangeProcessor> processor_;
......
......@@ -15,7 +15,6 @@
#include "base/threading/sequenced_task_runner_handle.h"
#include "components/sync/base/unrecoverable_error_handler.h"
#include "components/sync/driver/sync_api_component_factory.h"
#include "components/sync/driver/sync_client.h"
#include "components/sync/model/local_change_observer.h"
#include "components/sync/model/sync_change.h"
#include "components/sync/model/sync_error.h"
......@@ -80,8 +79,7 @@ GenericChangeProcessor::GenericChangeProcessor(
std::unique_ptr<DataTypeErrorHandler> error_handler,
const base::WeakPtr<SyncableService>& local_service,
const base::WeakPtr<SyncMergeResult>& merge_result,
UserShare* user_share,
SyncClient* sync_client)
UserShare* user_share)
: ChangeProcessor(std::move(error_handler)),
type_(type),
local_service_(local_service),
......
......@@ -23,7 +23,6 @@
namespace syncer {
class SyncClient;
class SyncData;
class SyncableService;
class WriteNode;
......@@ -51,8 +50,7 @@ class GenericChangeProcessor : public ChangeProcessor,
std::unique_ptr<DataTypeErrorHandler> error_handler,
const base::WeakPtr<SyncableService>& local_service,
const base::WeakPtr<SyncMergeResult>& merge_result,
UserShare* user_share,
SyncClient* sync_client);
UserShare* user_share);
~GenericChangeProcessor() override;
// ChangeProcessor interface.
......
......@@ -21,12 +21,10 @@ GenericChangeProcessorFactory::CreateGenericChangeProcessor(
UserShare* user_share,
std::unique_ptr<DataTypeErrorHandler> error_handler,
const base::WeakPtr<SyncableService>& local_service,
const base::WeakPtr<SyncMergeResult>& merge_result,
SyncClient* sync_client) {
const base::WeakPtr<SyncMergeResult>& merge_result) {
DCHECK(user_share);
return std::make_unique<GenericChangeProcessor>(
type, std::move(error_handler), local_service, merge_result, user_share,
sync_client);
type, std::move(error_handler), local_service, merge_result, user_share);
}
} // namespace syncer
......@@ -15,7 +15,6 @@
namespace syncer {
class GenericChangeProcessor;
class SyncClient;
class SyncMergeResult;
class SyncableService;
struct UserShare;
......@@ -36,8 +35,7 @@ class GenericChangeProcessorFactory {
UserShare* user_share,
std::unique_ptr<DataTypeErrorHandler> error_handler,
const base::WeakPtr<SyncableService>& local_service,
const base::WeakPtr<SyncMergeResult>& merge_result,
SyncClient* sync_client);
const base::WeakPtr<SyncMergeResult>& merge_result);
private:
DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessorFactory);
......
......@@ -14,7 +14,6 @@
#include "components/sync/base/model_type.h"
#include "components/sync/device_info/local_device_info_provider.h"
#include "components/sync/driver/data_type_manager.h"
#include "components/sync/driver/fake_sync_client.h"
#include "components/sync/driver/sync_api_component_factory_mock.h"
#include "components/sync/engine/sync_encryption_handler.h"
#include "components/sync/engine/sync_engine.h"
......@@ -43,8 +42,7 @@ class SyncGenericChangeProcessorTest : public testing::Test {
SyncGenericChangeProcessorTest()
: scoped_task_environment_(
base::test::ScopedTaskEnvironment::MainThreadType::UI),
syncable_service_ptr_factory_(&fake_syncable_service_),
sync_client_(&sync_factory_) {}
syncable_service_ptr_factory_(&fake_syncable_service_) {}
void SetUp() override {
// Use kType by default, but allow test cases to re-initialize with whatever
......@@ -82,8 +80,8 @@ class SyncGenericChangeProcessorTest : public testing::Test {
change_processor_ = std::make_unique<GenericChangeProcessor>(
type, std::make_unique<DataTypeErrorHandlerMock>(),
syncable_service_ptr_factory_.GetWeakPtr(),
merge_result_ptr_factory_->GetWeakPtr(), test_user_share_->user_share(),
&sync_client_);
merge_result_ptr_factory_->GetWeakPtr(),
test_user_share_->user_share());
}
void BuildChildNodes(ModelType type, int n) {
......@@ -114,7 +112,6 @@ class SyncGenericChangeProcessorTest : public testing::Test {
base::WeakPtrFactory<FakeSyncableService> syncable_service_ptr_factory_;
std::unique_ptr<TestUserShare> test_user_share_;
FakeSyncClient sync_client_;
testing::NiceMock<SyncApiComponentFactoryMock> sync_factory_;
std::unique_ptr<GenericChangeProcessor> change_processor_;
......
......@@ -153,7 +153,7 @@ base::WeakPtr<SyncableService> SharedChangeProcessor::Connect(
generic_change_processor_ = processor_factory
->CreateGenericChangeProcessor(
type_, user_share, error_handler_->Copy(),
local_service, merge_result, sync_client)
local_service, merge_result)
.release();
return local_service;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment