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

Unified Diff: chrome/browser/sync/glue/failed_data_types_handler.h

Issue 15701022: [Sync] Add support for sync Persistence Errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move bookmark change into separate patch Created 7 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: chrome/browser/sync/glue/failed_data_types_handler.h
diff --git a/chrome/browser/sync/glue/failed_data_types_handler.h b/chrome/browser/sync/glue/failed_data_types_handler.h
index 1998cd808be56a630eada87d09cf05acdd4e0d8c..3d8b211b26777da0a65daa486131be1612e1fd8d 100644
--- a/chrome/browser/sync/glue/failed_data_types_handler.h
+++ b/chrome/browser/sync/glue/failed_data_types_handler.h
@@ -14,25 +14,14 @@ namespace browser_sync {
// Class to keep track of data types that have encountered an error during sync.
class FailedDataTypesHandler {
public:
- enum FailureType {
- // The dataype failed at startup.
- STARTUP,
-
- // The datatype encountered a runtime error.
- RUNTIME,
-
- // The datatype encountered a cryptographer related error.
- CRYPTO
- };
typedef std::map<syncer::ModelType, syncer::SyncError> TypeErrorMap;
explicit FailedDataTypesHandler();
~FailedDataTypesHandler();
- // Called with the result of sync configuration. The types with errors
- // are obtained from the |result|.
- bool UpdateFailedDataTypes(const TypeErrorMap& errors,
- FailureType failure_type);
+ // Update the failed datatypes. Types will be added to their corresponding
+ // error map based on their |error_type()|.
+ bool UpdateFailedDataTypes(const TypeErrorMap& errors);
// Resets the current set of data type errors.
void Reset();
@@ -40,6 +29,9 @@ class FailedDataTypesHandler {
// Resets the set of types with cryptographer errors.
void ResetCryptoErrors();
+ // Resets the set of types with persistence errors.
+ void ResetPersistenceErrors();
+
// Returns a list of all the errors this class has recorded.
TypeErrorMap GetAllErrors() const;
@@ -52,19 +44,24 @@ class FailedDataTypesHandler {
// Returns the types that are failing due to cryptographer errors.
syncer::ModelTypeSet GetCryptoErrorTypes() const;
+ // Returns the types that are failing due to persistence errors.
+ syncer::ModelTypeSet GetPersistenceErrorTypes() 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.
- TypeErrorMap startup_errors_;
-
- // List of data types that failed at runtime.
- TypeErrorMap runtime_errors_;
+ // 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 the cryptographer not being ready.
TypeErrorMap crypto_errors_;
+ // List of data type that failed because sync did not persist the newest
+ // version of their data.
+ TypeErrorMap persistence_errors_;
+
DISALLOW_COPY_AND_ASSIGN(FailedDataTypesHandler);
};
« no previous file with comments | « chrome/browser/sync/glue/data_type_manager_impl.cc ('k') | chrome/browser/sync/glue/failed_data_types_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698