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/data_type_manager_impl.h

Issue 2388163002: [Sync] Move //components/sync to the syncer namespace, take 2. (Closed)
Patch Set: Rebase. 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
« no previous file with comments | « components/sync/driver/data_type_manager.cc ('k') | components/sync/driver/data_type_manager_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/driver/data_type_manager_impl.h
diff --git a/components/sync/driver/data_type_manager_impl.h b/components/sync/driver/data_type_manager_impl.h
index 571590874f3241885e705e176583e65d55e0bca1..0e98753f8d1af3b5f8a95c574eee39a2905934a8 100644
--- a/components/sync/driver/data_type_manager_impl.h
+++ b/components/sync/driver/data_type_manager_impl.h
@@ -16,32 +16,27 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
+#include "components/sync/base/weak_handle.h"
#include "components/sync/driver/backend_data_type_configurer.h"
#include "components/sync/driver/model_association_manager.h"
namespace syncer {
-struct DataTypeConfigurationStats;
-class DataTypeDebugInfoListener;
-template <typename T>
-class WeakHandle;
-}
-
-namespace sync_driver {
class DataTypeController;
+class DataTypeDebugInfoListener;
class DataTypeEncryptionHandler;
class DataTypeManagerObserver;
+struct DataTypeConfigurationStats;
// List of data types grouped by priority and ordered from high priority to
// low priority.
-typedef std::queue<syncer::ModelTypeSet> TypeSetPriorityList;
+typedef std::queue<ModelTypeSet> TypeSetPriorityList;
class DataTypeManagerImpl : public DataTypeManager,
public ModelAssociationManagerDelegate {
public:
DataTypeManagerImpl(
- const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>&
- debug_info_listener,
+ const WeakHandle<DataTypeDebugInfoListener>& debug_info_listener,
const DataTypeController::TypeMap* controllers,
const DataTypeEncryptionHandler* encryption_handler,
BackendDataTypeConfigurer* configurer,
@@ -49,14 +44,13 @@ class DataTypeManagerImpl : public DataTypeManager,
~DataTypeManagerImpl() override;
// DataTypeManager interface.
- void Configure(syncer::ModelTypeSet desired_types,
- syncer::ConfigureReason reason) override;
- void ReenableType(syncer::ModelType type) override;
+ void Configure(ModelTypeSet desired_types, ConfigureReason reason) override;
+ void ReenableType(ModelType type) override;
void ResetDataTypeErrors() override;
// Needed only for backend migration.
- void PurgeForMigration(syncer::ModelTypeSet undesired_types,
- syncer::ConfigureReason reason) override;
+ void PurgeForMigration(ModelTypeSet undesired_types,
+ ConfigureReason reason) override;
void Stop() override;
State state() const override;
@@ -64,12 +58,12 @@ class DataTypeManagerImpl : public DataTypeManager,
// |ModelAssociationManagerDelegate| implementation.
void OnAllDataTypesReadyForConfigure() override;
void OnSingleDataTypeAssociationDone(
- syncer::ModelType type,
- const syncer::DataTypeAssociationStats& association_stats) override;
+ ModelType type,
+ const DataTypeAssociationStats& association_stats) override;
void OnModelAssociationDone(
const DataTypeManager::ConfigureResult& result) override;
- void OnSingleDataTypeWillStop(syncer::ModelType type,
- const syncer::SyncError& error) override;
+ void OnSingleDataTypeWillStop(ModelType type,
+ const SyncError& error) override;
// Used by unit tests. TODO(sync) : This would go away if we made
// this class be able to do Dependency injection. crbug.com/129212.
@@ -99,19 +93,19 @@ class DataTypeManagerImpl : public DataTypeManager,
// Returns the priority types (control + priority user types).
// Virtual for overriding during tests.
- virtual syncer::ModelTypeSet GetPriorityTypes() const;
+ virtual ModelTypeSet GetPriorityTypes() const;
// Divide |types| into sets by their priorities and return the sets from
// high priority to low priority.
- TypeSetPriorityList PrioritizeTypes(const syncer::ModelTypeSet& types);
+ TypeSetPriorityList PrioritizeTypes(const ModelTypeSet& types);
// Post a task to reconfigure when no downloading or association are running.
void ProcessReconfigure();
- void Restart(syncer::ConfigureReason reason);
- void DownloadReady(syncer::ModelTypeSet types_to_download,
- syncer::ModelTypeSet first_sync_types,
- syncer::ModelTypeSet failed_configuration_types);
+ void Restart(ConfigureReason reason);
+ void DownloadReady(ModelTypeSet types_to_download,
+ ModelTypeSet first_sync_types,
+ ModelTypeSet failed_configuration_types);
// Notification from the SBH that download failed due to a transient
// error and it will be retried.
@@ -123,19 +117,18 @@ class DataTypeManagerImpl : public DataTypeManager,
// Restart().
void AddToConfigureTime();
- void ConfigureImpl(syncer::ModelTypeSet desired_types,
- syncer::ConfigureReason reason);
+ void ConfigureImpl(ModelTypeSet desired_types, ConfigureReason reason);
// Calls data type controllers of requested types to register with backend.
void RegisterTypesWithBackend();
BackendDataTypeConfigurer::DataTypeConfigStateMap BuildDataTypeConfigStateMap(
- const syncer::ModelTypeSet& types_being_configured) const;
+ const ModelTypeSet& types_being_configured) const;
// Start download of next set of types in |download_types_queue_| (if
// any exist, does nothing otherwise).
// Will kick off association of any new ready types.
- void StartNextDownload(syncer::ModelTypeSet high_priority_types_before);
+ void StartNextDownload(ModelTypeSet high_priority_types_before);
// Start association of next batch of data types after association of
// previous batch finishes. |group| controls which set of types within
@@ -146,18 +139,18 @@ class DataTypeManagerImpl : public DataTypeManager,
void StopImpl();
// Returns the currently enabled types.
- syncer::ModelTypeSet GetEnabledTypes() const;
+ ModelTypeSet GetEnabledTypes() const;
BackendDataTypeConfigurer* configurer_;
// Map of all data type controllers that are available for sync.
// This list is determined at startup by various command line flags.
const DataTypeController::TypeMap* controllers_;
State state_;
- syncer::ModelTypeSet last_requested_types_;
+ ModelTypeSet last_requested_types_;
// A set of types that were enabled at the time initialization with the
// |model_association_manager_| was last attempted.
- syncer::ModelTypeSet last_enabled_types_;
+ ModelTypeSet last_enabled_types_;
// Whether an attempt to reconfigure was made while we were busy configuring.
// The |last_requested_types_| will reflect the newest set of requested types.
@@ -165,7 +158,7 @@ class DataTypeManagerImpl : public DataTypeManager,
// The reason for the last reconfigure attempt. Note: this will be set to a
// valid value only when |needs_reconfigure_| is set.
- syncer::ConfigureReason last_configure_reason_;
+ ConfigureReason last_configure_reason_;
// The last time Restart() was called.
base::Time last_restart_time_;
@@ -176,8 +169,7 @@ class DataTypeManagerImpl : public DataTypeManager,
// Sync's datatype debug info listener, which we pass model association
// statistics to.
- const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>
- debug_info_listener_;
+ const WeakHandle<DataTypeDebugInfoListener> debug_info_listener_;
// The manager that handles the model association of the individual types.
ModelAssociationManager model_association_manager_;
@@ -200,14 +192,14 @@ class DataTypeManagerImpl : public DataTypeManager,
~AssociationTypesInfo();
// Types to associate.
- syncer::ModelTypeSet types;
+ ModelTypeSet types;
// Types that have just been downloaded and are being associated for the
// first time. This includes types that had previously encountered an error
// and had to be purged/unapplied from the sync db.
// This is a subset of |types|.
- syncer::ModelTypeSet first_sync_types;
+ ModelTypeSet first_sync_types;
// Types that were already ready for association at configuration time.
- syncer::ModelTypeSet ready_types;
+ ModelTypeSet ready_types;
// Time at which |types| began downloading.
base::Time download_start_time;
// Time at which |types| finished downloading.
@@ -219,9 +211,9 @@ class DataTypeManagerImpl : public DataTypeManager,
base::Time full_association_request_time;
// The set of types that are higher priority (and were therefore blocking)
// the association of |types|.
- syncer::ModelTypeSet high_priority_types_before;
+ ModelTypeSet high_priority_types_before;
// The subset of |types| that were successfully configured.
- syncer::ModelTypeSet configured_types;
+ ModelTypeSet configured_types;
};
std::queue<AssociationTypesInfo> association_types_queue_;
@@ -230,7 +222,7 @@ class DataTypeManagerImpl : public DataTypeManager,
const DataTypeEncryptionHandler* encryption_handler_;
// Association and time stats of data type configuration.
- std::vector<syncer::DataTypeConfigurationStats> configuration_stats_;
+ std::vector<DataTypeConfigurationStats> configuration_stats_;
// True iff we are in the process of catching up datatypes.
bool catch_up_in_progress_;
@@ -245,6 +237,6 @@ class DataTypeManagerImpl : public DataTypeManager,
DISALLOW_COPY_AND_ASSIGN(DataTypeManagerImpl);
};
-} // namespace sync_driver
+} // namespace syncer
#endif // COMPONENTS_SYNC_DRIVER_DATA_TYPE_MANAGER_IMPL_H__
« no previous file with comments | « components/sync/driver/data_type_manager.cc ('k') | components/sync/driver/data_type_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698