Commit 8c00c3df authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

Remove unused SyncClient param from SyncEngineImpl

Bug: none
Change-Id: I0d9651396226a6fb7f82a73b23c5e4a151eff26f
Reviewed-on: https://chromium-review.googlesource.com/c/1436236
Auto-Submit: Marc Treib <treib@chromium.org>
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626486}
parent 04e22f87
...@@ -41,7 +41,6 @@ class SyncEngineForProfileSyncTest : public SyncEngineImpl { ...@@ -41,7 +41,6 @@ class SyncEngineForProfileSyncTest : public SyncEngineImpl {
public: public:
SyncEngineForProfileSyncTest( SyncEngineForProfileSyncTest(
const base::FilePath& temp_dir, const base::FilePath& temp_dir,
syncer::SyncClient* sync_client,
invalidation::InvalidationService* invalidator, invalidation::InvalidationService* invalidator,
const base::WeakPtr<syncer::SyncPrefs>& sync_prefs, const base::WeakPtr<syncer::SyncPrefs>& sync_prefs,
base::OnceClosure callback); base::OnceClosure callback);
...@@ -62,13 +61,11 @@ class SyncEngineForProfileSyncTest : public SyncEngineImpl { ...@@ -62,13 +61,11 @@ class SyncEngineForProfileSyncTest : public SyncEngineImpl {
SyncEngineForProfileSyncTest::SyncEngineForProfileSyncTest( SyncEngineForProfileSyncTest::SyncEngineForProfileSyncTest(
const base::FilePath& temp_dir, const base::FilePath& temp_dir,
syncer::SyncClient* sync_client,
invalidation::InvalidationService* invalidator, invalidation::InvalidationService* invalidator,
const base::WeakPtr<syncer::SyncPrefs>& sync_prefs, const base::WeakPtr<syncer::SyncPrefs>& sync_prefs,
base::OnceClosure callback) base::OnceClosure callback)
: SyncEngineImpl( : SyncEngineImpl(
"dummy_debug_name", "dummy_debug_name",
sync_client,
invalidator, invalidator,
sync_prefs, sync_prefs,
temp_dir.Append(base::FilePath(FILE_PATH_LITERAL("test")))), temp_dir.Append(base::FilePath(FILE_PATH_LITERAL("test")))),
...@@ -142,7 +139,7 @@ void AbstractProfileSyncServiceTest::CreateSyncService( ...@@ -142,7 +139,7 @@ void AbstractProfileSyncServiceTest::CreateSyncService(
syncer::SyncApiComponentFactoryMock* components = syncer::SyncApiComponentFactoryMock* components =
profile_sync_service_bundle_.component_factory(); profile_sync_service_bundle_.component_factory();
auto engine = std::make_unique<SyncEngineForProfileSyncTest>( auto engine = std::make_unique<SyncEngineForProfileSyncTest>(
temp_dir_.GetPath(), sync_service_->GetSyncClientForTest(), temp_dir_.GetPath(),
profile_sync_service_bundle_.fake_invalidation_service(), profile_sync_service_bundle_.fake_invalidation_service(),
sync_service_->sync_prefs()->AsWeakPtr(), sync_service_->sync_prefs()->AsWeakPtr(),
std::move(initialization_success_callback)); std::move(initialization_success_callback));
......
...@@ -442,8 +442,8 @@ ProfileSyncComponentsFactoryImpl::CreateSyncEngine( ...@@ -442,8 +442,8 @@ ProfileSyncComponentsFactoryImpl::CreateSyncEngine(
invalidation::InvalidationService* invalidator, invalidation::InvalidationService* invalidator,
const base::WeakPtr<syncer::SyncPrefs>& sync_prefs, const base::WeakPtr<syncer::SyncPrefs>& sync_prefs,
const base::FilePath& sync_data_folder) { const base::FilePath& sync_data_folder) {
return std::make_unique<syncer::SyncEngineImpl>( return std::make_unique<syncer::SyncEngineImpl>(name, invalidator, sync_prefs,
name, sync_client_, invalidator, sync_prefs, sync_data_folder); sync_data_folder);
} }
syncer::SyncApiComponentFactory::SyncComponents syncer::SyncApiComponentFactory::SyncComponents
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "components/sync/base/invalidation_helper.h" #include "components/sync/base/invalidation_helper.h"
#include "components/sync/base/sync_prefs.h" #include "components/sync/base/sync_prefs.h"
#include "components/sync/driver/glue/sync_backend_host_core.h" #include "components/sync/driver/glue/sync_backend_host_core.h"
#include "components/sync/driver/sync_client.h"
#include "components/sync/driver/sync_driver_switches.h" #include "components/sync/driver/sync_driver_switches.h"
#include "components/sync/engine/data_type_activation_response.h" #include "components/sync/engine/data_type_activation_response.h"
#include "components/sync/engine/engine_components_factory.h" #include "components/sync/engine/engine_components_factory.h"
...@@ -33,22 +32,13 @@ ...@@ -33,22 +32,13 @@
#include "components/sync/engine/sync_string_conversions.h" #include "components/sync/engine/sync_string_conversions.h"
#include "components/sync/syncable/base_transaction.h" #include "components/sync/syncable/base_transaction.h"
// Helper macros to log with the syncer thread name; useful when there
// are multiple syncers involved.
#define SLOG(severity) LOG(severity) << name_ << ": "
#define SDVLOG(verbose_level) DVLOG(verbose_level) << name_ << ": "
namespace syncer { namespace syncer {
SyncEngineImpl::SyncEngineImpl(const std::string& name, SyncEngineImpl::SyncEngineImpl(const std::string& name,
SyncClient* sync_client,
invalidation::InvalidationService* invalidator, invalidation::InvalidationService* invalidator,
const base::WeakPtr<SyncPrefs>& sync_prefs, const base::WeakPtr<SyncPrefs>& sync_prefs,
const base::FilePath& sync_data_folder) const base::FilePath& sync_data_folder)
: sync_client_(sync_client), : name_(name),
name_(name),
sync_prefs_(sync_prefs), sync_prefs_(sync_prefs),
invalidator_(invalidator), invalidator_(invalidator),
weak_ptr_factory_(this) { weak_ptr_factory_(this) {
...@@ -101,7 +91,7 @@ void SyncEngineImpl::StartConfiguration() { ...@@ -101,7 +91,7 @@ void SyncEngineImpl::StartConfiguration() {
} }
void SyncEngineImpl::StartSyncingWithServer() { void SyncEngineImpl::StartSyncingWithServer() {
SDVLOG(1) << "SyncEngineImpl::StartSyncingWithServer called."; DVLOG(1) << name_ << ": SyncEngineImpl::StartSyncingWithServer called.";
base::Time last_poll_time = sync_prefs_->GetLastPollTime(); base::Time last_poll_time = sync_prefs_->GetLastPollTime();
// If there's no known last poll time (e.g. on initial start-up), we treat // If there's no known last poll time (e.g. on initial start-up), we treat
// this as if a poll just happened. // this as if a poll just happened.
...@@ -496,7 +486,3 @@ void SyncEngineImpl::OnCookieJarChangedDoneOnFrontendLoop( ...@@ -496,7 +486,3 @@ void SyncEngineImpl::OnCookieJarChangedDoneOnFrontendLoop(
} }
} // namespace syncer } // namespace syncer
#undef SDVLOG
#undef SLOG
...@@ -40,7 +40,6 @@ namespace syncer { ...@@ -40,7 +40,6 @@ namespace syncer {
class ChangeProcessor; class ChangeProcessor;
class SyncBackendHostCore; class SyncBackendHostCore;
class SyncBackendRegistrar; class SyncBackendRegistrar;
class SyncClient;
class SyncPrefs; class SyncPrefs;
// The only real implementation of the SyncEngine. See that interface's // The only real implementation of the SyncEngine. See that interface's
...@@ -50,7 +49,6 @@ class SyncEngineImpl : public SyncEngine, public InvalidationHandler { ...@@ -50,7 +49,6 @@ class SyncEngineImpl : public SyncEngine, public InvalidationHandler {
using Status = SyncStatus; using Status = SyncStatus;
SyncEngineImpl(const std::string& name, SyncEngineImpl(const std::string& name,
SyncClient* sync_client,
invalidation::InvalidationService* invalidator, invalidation::InvalidationService* invalidator,
const base::WeakPtr<SyncPrefs>& sync_prefs, const base::WeakPtr<SyncPrefs>& sync_prefs,
const base::FilePath& sync_data_folder); const base::FilePath& sync_data_folder);
...@@ -196,8 +194,6 @@ class SyncEngineImpl : public SyncEngine, public InvalidationHandler { ...@@ -196,8 +194,6 @@ class SyncEngineImpl : public SyncEngine, public InvalidationHandler {
void OnCookieJarChangedDoneOnFrontendLoop(const base::Closure& callback); void OnCookieJarChangedDoneOnFrontendLoop(const base::Closure& callback);
SyncClient* const sync_client_;
// The task runner where all the sync engine operations happen. // The task runner where all the sync engine operations happen.
scoped_refptr<base::SequencedTaskRunner> sync_task_runner_; scoped_refptr<base::SequencedTaskRunner> sync_task_runner_;
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include "components/sync/base/sync_prefs.h" #include "components/sync/base/sync_prefs.h"
#include "components/sync/base/test_unrecoverable_error_handler.h" #include "components/sync/base/test_unrecoverable_error_handler.h"
#include "components/sync/device_info/device_info.h" #include "components/sync/device_info/device_info.h"
#include "components/sync/driver/fake_sync_client.h"
#include "components/sync/engine/cycle/commit_counters.h" #include "components/sync/engine/cycle/commit_counters.h"
#include "components/sync/engine/cycle/status_counters.h" #include "components/sync/engine/cycle/status_counters.h"
#include "components/sync/engine/cycle/update_counters.h" #include "components/sync/engine/cycle/update_counters.h"
...@@ -65,6 +64,15 @@ namespace { ...@@ -65,6 +64,15 @@ namespace {
static const base::FilePath::CharType kTestSyncDir[] = static const base::FilePath::CharType kTestSyncDir[] =
FILE_PATH_LITERAL("sync-test"); FILE_PATH_LITERAL("sync-test");
scoped_refptr<ModelSafeWorker> CreateModelWorkerForGroup(ModelSafeGroup group) {
switch (group) {
case GROUP_PASSIVE:
return new PassiveModelWorker();
default:
return nullptr;
}
}
class TestSyncEngineHost : public SyncEngineHostStub { class TestSyncEngineHost : public SyncEngineHostStub {
public: public:
explicit TestSyncEngineHost( explicit TestSyncEngineHost(
...@@ -137,19 +145,6 @@ class FakeSyncManagerFactory : public SyncManagerFactory { ...@@ -137,19 +145,6 @@ class FakeSyncManagerFactory : public SyncManagerFactory {
FakeSyncManager** fake_manager_; FakeSyncManager** fake_manager_;
}; };
class BackendSyncClient : public FakeSyncClient {
public:
scoped_refptr<ModelSafeWorker> CreateModelWorkerForGroup(
ModelSafeGroup group) override {
switch (group) {
case GROUP_PASSIVE:
return new PassiveModelWorker();
default:
return nullptr;
}
}
};
class NullEncryptionObserver : public SyncEncryptionHandler::Observer { class NullEncryptionObserver : public SyncEncryptionHandler::Observer {
public: public:
void OnPassphraseRequired( void OnPassphraseRequired(
...@@ -211,8 +206,7 @@ class SyncEngineImplTest : public testing::Test { ...@@ -211,8 +206,7 @@ class SyncEngineImplTest : public testing::Test {
UpdateRegisteredInvalidationIds(testing::_, testing::_)) UpdateRegisteredInvalidationIds(testing::_, testing::_))
.WillByDefault(testing::Return(true)); .WillByDefault(testing::Return(true));
backend_ = std::make_unique<SyncEngineImpl>( backend_ = std::make_unique<SyncEngineImpl>(
"dummyDebugName", &sync_client_, &invalidator_, "dummyDebugName", &invalidator_, sync_prefs_->AsWeakPtr(),
sync_prefs_->AsWeakPtr(),
temp_dir_.GetPath().Append(base::FilePath(kTestSyncDir))); temp_dir_.GetPath().Append(base::FilePath(kTestSyncDir)));
credentials_.account_id = "user@example.com"; credentials_.account_id = "user@example.com";
credentials_.email = "user@example.com"; credentials_.email = "user@example.com";
...@@ -259,8 +253,7 @@ class SyncEngineImplTest : public testing::Test { ...@@ -259,8 +253,7 @@ class SyncEngineImplTest : public testing::Test {
params.sync_task_runner = sync_thread_.task_runner(); params.sync_task_runner = sync_thread_.task_runner();
params.host = &host_; params.host = &host_;
params.registrar = std::make_unique<SyncBackendRegistrar>( params.registrar = std::make_unique<SyncBackendRegistrar>(
std::string(), base::Bind(&SyncClient::CreateModelWorkerForGroup, std::string(), base::Bind(&CreateModelWorkerForGroup));
base::Unretained(&sync_client_)));
params.encryption_observer_proxies.push_back( params.encryption_observer_proxies.push_back(
std::make_unique<NullEncryptionObserver>()); std::make_unique<NullEncryptionObserver>());
params.http_factory_getter = std::move(http_post_provider_factory_getter); params.http_factory_getter = std::move(http_post_provider_factory_getter);
...@@ -336,7 +329,6 @@ class SyncEngineImplTest : public testing::Test { ...@@ -336,7 +329,6 @@ class SyncEngineImplTest : public testing::Test {
base::Thread sync_thread_; base::Thread sync_thread_;
TestSyncEngineHost host_; TestSyncEngineHost host_;
SyncCredentials credentials_; SyncCredentials credentials_;
BackendSyncClient sync_client_;
TestUnrecoverableErrorHandler test_unrecoverable_error_handler_; TestUnrecoverableErrorHandler test_unrecoverable_error_handler_;
std::unique_ptr<SyncPrefs> sync_prefs_; std::unique_ptr<SyncPrefs> sync_prefs_;
std::unique_ptr<SyncEngineImpl> backend_; std::unique_ptr<SyncEngineImpl> backend_;
......
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