Commit f886cf3a authored by Mikel Astiz's avatar Mikel Astiz Committed by Commit Bot

Rename SyncBackendHostCore->SyncEngineBackend

Trivially rename the class in accordance to more modern naming
conventions, in particular SyncEngineImpl.

Bug: 950852
Change-Id: Iea1761ef3866bcf25e1373e6bb3a83a2fac29fdf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1559312Reviewed-by: default avatarJan Krcal <jkrcal@chromium.org>
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649031}
parent 00048bfa
......@@ -13,7 +13,7 @@
#include "base/run_loop.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "components/browser_sync/test_http_bridge_factory.h"
#include "components/sync/driver/glue/sync_backend_host_core.h"
#include "components/sync/driver/glue/sync_engine_backend.h"
#include "components/sync/driver/sync_api_component_factory_mock.h"
#include "components/sync/driver/test_profile_sync_service.h"
#include "components/sync/engine/sync_manager_factory_for_profile_sync_test.h"
......
......@@ -128,8 +128,8 @@ jumbo_static_library("sync") {
"driver/generic_change_processor.h",
"driver/generic_change_processor_factory.cc",
"driver/generic_change_processor_factory.h",
"driver/glue/sync_backend_host_core.cc",
"driver/glue/sync_backend_host_core.h",
"driver/glue/sync_engine_backend.cc",
"driver/glue/sync_engine_backend.h",
"driver/glue/sync_engine_impl.cc",
"driver/glue/sync_engine_impl.h",
"driver/model_association_manager.cc",
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_
#define COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_
#ifndef COMPONENTS_SYNC_DRIVER_GLUE_SYNC_ENGINE_BACKEND_H_
#define COMPONENTS_SYNC_DRIVER_GLUE_SYNC_ENGINE_BACKEND_H_
#include <stdint.h>
......@@ -33,15 +33,14 @@ namespace syncer {
class SyncEngineImpl;
class SyncBackendHostCore
: public base::RefCountedThreadSafe<SyncBackendHostCore>,
public base::trace_event::MemoryDumpProvider,
public SyncManager::Observer,
public TypeDebugInfoObserver {
class SyncEngineBackend : public base::RefCountedThreadSafe<SyncEngineBackend>,
public base::trace_event::MemoryDumpProvider,
public SyncManager::Observer,
public TypeDebugInfoObserver {
public:
SyncBackendHostCore(const std::string& name,
const base::FilePath& sync_data_folder,
const base::WeakPtr<SyncEngineImpl>& host);
SyncEngineBackend(const std::string& name,
const base::FilePath& sync_data_folder,
const base::WeakPtr<SyncEngineImpl>& host);
// MemoryDumpProvider implementation.
bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
......@@ -179,9 +178,9 @@ class SyncBackendHostCore
bool HasUnsyncedItemsForTest() const;
private:
friend class base::RefCountedThreadSafe<SyncBackendHostCore>;
friend class base::RefCountedThreadSafe<SyncEngineBackend>;
~SyncBackendHostCore() override;
~SyncEngineBackend() override;
// For the olg tango based invalidations method returns true if the
// invalidation has version lower than last seen version for this datatype.
......@@ -228,7 +227,7 @@ class SyncBackendHostCore
// and ServerConnectionManager without having to wait for those classes to
// finish initializing first.
//
// See comments in SyncBackendHostCore::ShutdownOnUIThread() for more details.
// See comments in SyncEngineBackend::ShutdownOnUIThread() for more details.
CancelationSignal release_request_context_signal_;
CancelationSignal stop_syncing_signal_;
......@@ -247,11 +246,11 @@ class SyncBackendHostCore
// Checks that we are on the sync thread.
SEQUENCE_CHECKER(sequence_checker_);
base::WeakPtrFactory<SyncBackendHostCore> weak_ptr_factory_;
base::WeakPtrFactory<SyncEngineBackend> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(SyncBackendHostCore);
DISALLOW_COPY_AND_ASSIGN(SyncEngineBackend);
};
} // namespace syncer
#endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_
#endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_ENGINE_BACKEND_H_
......@@ -38,7 +38,7 @@ class InvalidationService;
namespace syncer {
class ChangeProcessor;
class SyncBackendHostCore;
class SyncEngineBackend;
class SyncBackendRegistrar;
class SyncPrefs;
......@@ -162,13 +162,13 @@ class SyncEngineImpl : public SyncEngine, public InvalidationHandler {
SyncEngineHost* host() { return host_; }
private:
friend class SyncBackendHostCore;
friend class SyncEngineBackend;
// Handles backend initialization failure.
void HandleInitializationFailureOnFrontendLoop();
// Called from Core::OnSyncCycleCompleted to handle updating frontend
// thread components.
// Called from SyncEngineBackend::OnSyncCycleCompleted to handle updating
// frontend thread components.
void HandleSyncCycleCompletedOnFrontendLoop(
const SyncCycleSnapshot& snapshot);
......@@ -191,10 +191,10 @@ class SyncEngineImpl : public SyncEngine, public InvalidationHandler {
// Name used for debugging (set from profile_->GetDebugName()).
const std::string name_;
// Our core, which communicates directly to the syncapi. Use refptr instead
// of WeakHandle because |core_| is created on UI loop but released on
// Our backend, which communicates directly to the syncapi. Use refptr instead
// of WeakHandle because |backend_| is created on UI loop but released on
// sync loop.
scoped_refptr<SyncBackendHostCore> core_;
scoped_refptr<SyncEngineBackend> backend_;
// A handle referencing the main interface for non-blocking sync types. This
// object is owned because in production code it is a proxy object.
......@@ -208,7 +208,7 @@ class SyncEngineImpl : public SyncEngine, public InvalidationHandler {
// out in StopSyncingForShutdown().
SyncEngineHost* host_ = nullptr;
// A pointer to the registrar; owned by |core_|.
// A pointer to the registrar; owned by |backend_|.
SyncBackendRegistrar* registrar_ = nullptr;
invalidation::InvalidationService* invalidator_;
......
......@@ -719,7 +719,7 @@ TEST_F(SyncEngineImplTest, DownloadControlTypesRestart) {
fake_manager_->GetAndResetConfigureReason());
}
// It is SyncBackendHostCore responsibility to cleanup Sync Data folder if sync
// It is SyncEngineBackend's responsibility to cleanup Sync Data folder if sync
// setup hasn't been completed. This test ensures that cleanup happens.
TEST_F(SyncEngineImplTest, TestStartupWithOldSyncData) {
const char* nonsense = "slon";
......
......@@ -798,7 +798,7 @@ void ProfileSyncService::OnUnrecoverableErrorImpl(
// This is the equivalent for Directory::DeleteDirectoryFiles(), guaranteed
// to be called, either directly in ShutdownImpl(), or later in
// SyncBackendHostCore::DoShutdown().
// SyncEngineBackend::DoShutdown().
// TODO(crbug.com/923285): This doesn't seem to belong here, or if it does,
// all preferences should be cleared via SyncPrefs::ClearPreferences(),
// which is done by some of the callers (but not all). Care must be taken
......@@ -1025,7 +1025,7 @@ void ProfileSyncService::OnActionableError(const SyncProtocolError& error) {
ShutdownImpl(DISABLE_SYNC);
// This is the equivalent for Directory::DeleteDirectoryFiles(),
// guaranteed to be called, either directly in ShutdownImpl(), or later in
// SyncBackendHostCore::DoShutdown().
// SyncEngineBackend::DoShutdown().
// TODO(crbug.com/923285): This doesn't seem to belong here, or if it
// does, all preferences should be cleared via
// SyncPrefs::ClearPreferences(), which is done by some of the callers
......@@ -1037,7 +1037,7 @@ void ProfileSyncService::OnActionableError(const SyncProtocolError& error) {
ShutdownImpl(DISABLE_SYNC);
// This is the equivalent for Directory::DeleteDirectoryFiles(),
// guaranteed to be called, either directly in ShutdownImpl(), or later in
// SyncBackendHostCore::DoShutdown().
// SyncEngineBackend::DoShutdown().
// TODO(crbug.com/923285): This doesn't seem to belong here, or if it
// does, all preferences should be cleared via
// SyncPrefs::ClearPreferences(), which is done by some of the callers
......
......@@ -308,7 +308,7 @@ void HttpBridge::MakeAsynchronousPost() {
// SimpleURLLoader supports it.
//
// This calls |BindFetcherToDataTracker| in
// components/sync/driver/glue/sync_backend_host_core.cc which used to
// components/sync/driver/glue/sync_engine_backend.cc which used to
// data_use_measurement::DataUseUserData::AttachToFetcher.
// if (!bind_to_tracker_callback_.is_null())
// bind_to_tracker_callback_.Run(fetch_state_.url_poster);
......
......@@ -43,7 +43,7 @@ class SyncBackendRegistrar : public SyncManager::ChangeDelegate {
// UI thread:
//
// 1) Call SyncBackendRegistrar::RequestWorkerStopOnUIThread().
// 2) Post a SyncBackendHostCore::DoShutdown() task to the sync thread. This
// 2) Post a SyncEngineBackend::DoShutdown() task to the sync thread. This
// task destroys SyncManager which holds a SyncBackendRegistrar pointer.
// 3) Take ownership of the sync thread.
// 4) Post a task to delete the SyncBackendRegistrar on the sync thread.
......
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