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

Unified Diff: components/sync_driver/failed_data_types_handler.h

Issue 312163004: [Sync] Add support for dynamically enabling/disabling types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 6 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/failed_data_types_handler.h
diff --git a/components/sync_driver/failed_data_types_handler.h b/components/sync_driver/failed_data_types_handler.h
index bff7b15e5330a7723ca29376b526b84e1bc9f9ef..301f9d08e627d434b7274246a7f4d1f1f7ad967f 100644
--- a/components/sync_driver/failed_data_types_handler.h
+++ b/components/sync_driver/failed_data_types_handler.h
@@ -32,13 +32,24 @@ class FailedDataTypesHandler {
// Resets those persistence errors that intersect with |purged_types|.
void ResetPersistenceErrorsFrom(syncer::ModelTypeSet purged_types);
+ // Removes |type| from the data_type_errors_ set. Returns true if the type
+ // was removed from the error set, false if the type did not have a data type
+ // error to begin with.
+ bool ResetDataTypeErrorFor(syncer::ModelType type);
+
+ // Removes |type| from the unread_errors_ set. Returns true if the type
+ // was removed from the error set, false if the type did not have an unready
+ // error to begin with.
+ bool ResetUnreadyErrorFor(syncer::ModelType type);
+
// Returns a list of all the errors this class has recorded.
TypeErrorMap GetAllErrors() const;
- // Returns all types with errors.
+ // Returns all types with failure errors. This includes, fatal, crypto, and
+ // unready types.`
syncer::ModelTypeSet GetFailedTypes() const;
- // Returns the types that are failing due to startup or runtime errors.
+ // Returns the types that are failing due to unrecoverable or datatype errors.
syncer::ModelTypeSet GetFatalErrorTypes() const;
// Returns the types that are failing due to cryptographer errors.
@@ -47,21 +58,33 @@ class FailedDataTypesHandler {
// Returns the types that are failing due to persistence errors.
syncer::ModelTypeSet GetPersistenceErrorTypes() const;
+ // Returns the types that cannot be configured due to not being ready.
+ syncer::ModelTypeSet GetUnreadyErrorTypes() const;
+
private:
// Returns true if there are any types with errors.
bool AnyFailedDataType() const;
- // List of data types that failed at startup due to association errors or
- // runtime due to data type errors.
- TypeErrorMap fatal_errors_;
+ // List of data types that failed due to unrecoverable errors and should
+ // be disabled.
+ TypeErrorMap unrecoverable_errors_;
+
+ // List of data types that failed due to runtime errors and should be
+ // disabled. These are different from unrecoverable_errors_ in that
+ // ResetDataTypeError can remove them from this list.
+ TypeErrorMap data_type_errors_;
// List of data types that failed due to the cryptographer not being ready.
TypeErrorMap crypto_errors_;
- // List of data type that failed because sync did not persist the newest
+ // List of data types that failed because sync did not persist the newest
// version of their data.
TypeErrorMap persistence_errors_;
+ // List of data types that could not start due to not being ready. These can
+ // be marked as ready by calling ResetDataTypeErrorFor(..).
stanisc 2014/06/10 21:21:42 ResetDataTypeErrorFor or ResetUnreadyErrorFor?
Nicolas Zea 2014/06/19 00:04:22 Done.
+ TypeErrorMap unready_errors_;
+
DISALLOW_COPY_AND_ASSIGN(FailedDataTypesHandler);
};

Powered by Google App Engine
This is Rietveld 408576698