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

Unified Diff: components/sync_driver/backend_data_type_configurer.h

Issue 2203673002: [Sync] Move //components/sync_driver to //components/sync/driver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sd-a
Patch Set: Full change rebased on static lib. Created 4 years, 4 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/backend_data_type_configurer.h
diff --git a/components/sync_driver/backend_data_type_configurer.h b/components/sync_driver/backend_data_type_configurer.h
deleted file mode 100644
index 2fb935c158eb48efb6fd10986720663e5dd95feb..0000000000000000000000000000000000000000
--- a/components/sync_driver/backend_data_type_configurer.h
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_SYNC_DRIVER_BACKEND_DATA_TYPE_CONFIGURER_H_
-#define COMPONENTS_SYNC_DRIVER_BACKEND_DATA_TYPE_CONFIGURER_H_
-
-#include <map>
-#include <memory>
-
-#include "base/callback.h"
-#include "components/sync/base/model_type.h"
-#include "components/sync/core/configure_reason.h"
-#include "components/sync/engine/model_safe_worker.h"
-
-namespace syncer_v2 {
-struct ActivationContext;
-}
-
-namespace sync_driver {
-
-class ChangeProcessor;
-
-// The DataTypeConfigurer interface abstracts out the action of
-// configuring a set of new data types and cleaning up after a set of
-// removed data types.
-class BackendDataTypeConfigurer {
- public:
- enum DataTypeConfigState {
- CONFIGURE_ACTIVE, // Actively being configured. Data of such types
- // will be downloaded if not present locally.
- CONFIGURE_INACTIVE, // Already configured or to be configured in future.
- // Data of such types is left as it is, no
- // downloading or purging.
- CONFIGURE_CLEAN, // Actively being configured but requiring unapply
- // and GetUpdates first (e.g. for persistence errors).
- DISABLED, // Not syncing. Disabled by user.
- FATAL, // Not syncing due to unrecoverable error.
- CRYPTO, // Not syncing due to a cryptographer error.
- UNREADY, // Not syncing due to transient error.
- };
- typedef std::map<syncer::ModelType, DataTypeConfigState>
- DataTypeConfigStateMap;
-
- // Configures sync for data types in config_state_map according to the states.
- // |ready_task| is called on the same thread as ConfigureDataTypes
- // is called when configuration is done with the set of data types
- // that succeeded/failed configuration (i.e., configuration succeeded iff
- // the failed set is empty).
- // Returns: the set of types that are already configured and are ready to
- // start.
- //
- // TODO(akalin): Use a Delegate class with
- // OnConfigureSuccess/OnConfigureFailure/OnConfigureRetry instead of
- // a pair of callbacks. The awkward part is handling when
- // SyncBackendHost calls ConfigureDataTypes on itself to configure
- // Nigori.
- virtual syncer::ModelTypeSet ConfigureDataTypes(
- syncer::ConfigureReason reason,
- const DataTypeConfigStateMap& config_state_map,
- const base::Callback<void(syncer::ModelTypeSet, syncer::ModelTypeSet)>&
- ready_task,
- const base::Callback<void()>& retry_callback) = 0;
-
- // Return model types in |state_map| that match |state|.
- static syncer::ModelTypeSet GetDataTypesInState(
- DataTypeConfigState state, const DataTypeConfigStateMap& state_map);
-
- // Activates change processing for the given directory data type. This must
- // be called synchronously with the data type's model association so
- // no changes are dropped between model association and change
- // processor activation.
- virtual void ActivateDirectoryDataType(syncer::ModelType type,
- syncer::ModelSafeGroup group,
- ChangeProcessor* change_processor) = 0;
-
- // Deactivates change processing for the given data type.
- virtual void DeactivateDirectoryDataType(syncer::ModelType type) = 0;
-
- // Activates change processing for the given non-blocking data type.
- // This must be called before initial sync for data type.
- virtual void ActivateNonBlockingDataType(
- syncer::ModelType type,
- std::unique_ptr<syncer_v2::ActivationContext> activation_context) = 0;
-
- // Deactivates change processing for the given non-blocking data type.
- virtual void DeactivateNonBlockingDataType(syncer::ModelType type) = 0;
-
- // Set state of |types| in |state_map| to |state|.
- static void SetDataTypesState(DataTypeConfigState state,
- syncer::ModelTypeSet types,
- DataTypeConfigStateMap* state_map);
-
- protected:
- virtual ~BackendDataTypeConfigurer() {}
-};
-
-} // namespace sync_driver
-
-#endif // COMPONENTS_SYNC_DRIVER_BACKEND_DATA_TYPE_CONFIGURER_H_
« no previous file with comments | « components/sync_driver/about_sync_util_unittest.cc ('k') | components/sync_driver/backend_data_type_configurer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698