Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: components/sync/driver/glue/sync_backend_host.h

Issue 2388673002: Revert of [Sync] Move //components/sync to the syncer namespace. (patchset #5 id:40001 of https://co (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/sync/driver/glue/sync_backend_host.h
diff --git a/components/sync/driver/glue/sync_backend_host.h b/components/sync/driver/glue/sync_backend_host.h
index 69f115559025bf56a692f8d7f80dc3c2a1124153..e7b99bbfa0fa03880e7dbebe2e2746c0f18f95a9 100644
--- a/components/sync/driver/glue/sync_backend_host.h
+++ b/components/sync/driver/glue/sync_backend_host.h
@@ -25,26 +25,31 @@ class GURL;
namespace base {
class MessageLoop;
-} // namespace base
+}
namespace syncer {
-
class CancelationSignal;
-class ChangeProcessor;
class HttpPostProviderFactory;
-class SyncFrontend;
class SyncManagerFactory;
class UnrecoverableErrorHandler;
+}
+
+namespace sync_driver {
+class ChangeProcessor;
+class SyncFrontend;
+}
+
+namespace browser_sync {
// An API to "host" the top level SyncAPI element.
//
// This class handles dispatch of potentially blocking calls to appropriate
// threads and ensures that the SyncFrontend is only accessed on the UI loop.
-class SyncBackendHost : public BackendDataTypeConfigurer {
+class SyncBackendHost : public sync_driver::BackendDataTypeConfigurer {
public:
- typedef SyncStatus Status;
- typedef base::Callback<std::unique_ptr<HttpPostProviderFactory>(
- CancelationSignal*)>
+ typedef syncer::SyncStatus Status;
+ typedef base::Callback<std::unique_ptr<syncer::HttpPostProviderFactory>(
+ syncer::CancelationSignal*)>
HttpPostProviderFactoryGetter;
// Stubs used by implementing classes.
@@ -58,27 +63,29 @@ class SyncBackendHost : public BackendDataTypeConfigurer {
// |saved_nigori_state| is optional nigori state to restore from a previous
// backend instance. May be null.
virtual void Initialize(
- SyncFrontend* frontend,
+ sync_driver::SyncFrontend* frontend,
std::unique_ptr<base::Thread> sync_thread,
const scoped_refptr<base::SingleThreadTaskRunner>& db_thread,
const scoped_refptr<base::SingleThreadTaskRunner>& file_thread,
- const WeakHandle<JsEventHandler>& event_handler,
+ const syncer::WeakHandle<syncer::JsEventHandler>& event_handler,
const GURL& service_url,
const std::string& sync_user_agent,
- const SyncCredentials& credentials,
+ const syncer::SyncCredentials& credentials,
bool delete_sync_data_folder,
- std::unique_ptr<SyncManagerFactory> sync_manager_factory,
- const WeakHandle<UnrecoverableErrorHandler>& unrecoverable_error_handler,
+ std::unique_ptr<syncer::SyncManagerFactory> sync_manager_factory,
+ const syncer::WeakHandle<syncer::UnrecoverableErrorHandler>&
+ unrecoverable_error_handler,
const base::Closure& report_unrecoverable_error_function,
const HttpPostProviderFactoryGetter& http_post_provider_factory_getter,
- std::unique_ptr<SyncEncryptionHandler::NigoriState>
+ std::unique_ptr<syncer::SyncEncryptionHandler::NigoriState>
saved_nigori_state) = 0;
// Called on the frontend's thread to trigger a refresh.
- virtual void TriggerRefresh(const ModelTypeSet& types) = 0;
+ virtual void TriggerRefresh(const syncer::ModelTypeSet& types) = 0;
// Called on the frontend's thread to update SyncCredentials.
- virtual void UpdateCredentials(const SyncCredentials& credentials) = 0;
+ virtual void UpdateCredentials(
+ const syncer::SyncCredentials& credentials) = 0;
// This starts the SyncerThread running a Syncer object to communicate with
// sync servers. Until this is called, no changes will leave or enter this
@@ -125,7 +132,8 @@ class SyncBackendHost : public BackendDataTypeConfigurer {
// later, initialization of new backend is serialized on previous sync
// thread after cleanup of previous backend to avoid old/new backends
// interfere with each other.
- virtual std::unique_ptr<base::Thread> Shutdown(ShutdownReason reason) = 0;
+ virtual std::unique_ptr<base::Thread> Shutdown(
+ syncer::ShutdownReason reason) = 0;
// Removes all current registrations from the backend on the
// InvalidationService.
@@ -138,10 +146,11 @@ class SyncBackendHost : public BackendDataTypeConfigurer {
// Returns the set of types that are ready to start without needing any
// further sync activity.
// BackendDataTypeConfigurer implementation.
- ModelTypeSet ConfigureDataTypes(
- ConfigureReason reason,
+ syncer::ModelTypeSet ConfigureDataTypes(
+ syncer::ConfigureReason reason,
const DataTypeConfigStateMap& config_state_map,
- const base::Callback<void(ModelTypeSet, ModelTypeSet)>& ready_task,
+ const base::Callback<void(syncer::ModelTypeSet, syncer::ModelTypeSet)>&
+ ready_task,
const base::Callback<void()>& retry_callback) override = 0;
// Turns on encryption of all present and future sync data.
@@ -150,12 +159,12 @@ class SyncBackendHost : public BackendDataTypeConfigurer {
// Called on |frontend_loop_| to obtain a handle to the UserShare needed for
// creating transactions. Should not be called before we signal
// initialization is complete with OnBackendInitialized().
- virtual UserShare* GetUserShare() const = 0;
+ virtual syncer::UserShare* GetUserShare() const = 0;
// Called from any thread to obtain current status information in detailed or
// summarized form.
virtual Status GetDetailedStatus() = 0;
- virtual SyncCycleSnapshot GetLastCycleSnapshot() const = 0;
+ virtual syncer::SyncCycleSnapshot GetLastCycleSnapshot() const = 0;
// Determines if the underlying sync engine has made any local changes to
// items that have not yet been synced with the server.
@@ -167,7 +176,7 @@ class SyncBackendHost : public BackendDataTypeConfigurer {
// Returns the type of passphrase being used to encrypt data. See
// sync_encryption_handler.h.
- virtual PassphraseType GetPassphraseType() const = 0;
+ virtual syncer::PassphraseType GetPassphraseType() const = 0;
// If an explicit passphrase is in use, returns the time at which that
// passphrase was set (if available).
@@ -176,9 +185,11 @@ class SyncBackendHost : public BackendDataTypeConfigurer {
// True if the cryptographer has any keys available to attempt decryption.
// Could mean we've downloaded and loaded Nigori objects, or we bootstrapped
// using a token previously received.
- virtual bool IsCryptographerReady(const BaseTransaction* trans) const = 0;
+ virtual bool IsCryptographerReady(
+ const syncer::BaseTransaction* trans) const = 0;
- virtual void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out) const = 0;
+ virtual void GetModelSafeRoutingInfo(
+ syncer::ModelSafeRoutingInfo* out) const = 0;
// Send a message to the sync thread to persist the Directory to disk.
virtual void FlushDirectory() const = 0;
@@ -203,11 +214,11 @@ class SyncBackendHost : public BackendDataTypeConfigurer {
virtual base::MessageLoop* GetSyncLoopForTesting() = 0;
// Triggers sync cycle to update |types|.
- virtual void RefreshTypesForTest(ModelTypeSet types) = 0;
+ virtual void RefreshTypesForTest(syncer::ModelTypeSet types) = 0;
// See SyncManager::ClearServerData.
virtual void ClearServerData(
- const SyncManager::ClearServerDataCallback& callback) = 0;
+ const syncer::SyncManager::ClearServerDataCallback& callback) = 0;
// Notify the syncer that the cookie jar has changed.
// See SyncManager::OnCookieJarChanged.
@@ -217,6 +228,6 @@ class SyncBackendHost : public BackendDataTypeConfigurer {
DISALLOW_COPY_AND_ASSIGN(SyncBackendHost);
};
-} // namespace syncer
+} // namespace browser_sync
#endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_H_
« no previous file with comments | « components/sync/driver/glue/chrome_report_unrecoverable_error.cc ('k') | components/sync/driver/glue/sync_backend_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698