diff options
author | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-20 09:48:51 +0000 |
---|---|---|
committer | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-20 09:48:51 +0000 |
commit | 6376f2f7eedd33afd7bb22eb05dfc890bd3b36b9 (patch) | |
tree | 4b1f15560f578d9bf85c11988ba03e30f5ec6377 /sync/api | |
parent | a4e4c6a53d43bbdf2b6ea8b839f16d1b0a01379b (diff) | |
download | chromium_src-6376f2f7eedd33afd7bb22eb05dfc890bd3b36b9.zip chromium_src-6376f2f7eedd33afd7bb22eb05dfc890bd3b36b9.tar.gz chromium_src-6376f2f7eedd33afd7bb22eb05dfc890bd3b36b9.tar.bz2 |
[Sync] Add support for dynamically enabling/disabling types
The notion of Unready types is also introduced for those types which control whether
they should run, and therefore for which a configuration (which might
involve network access) should not even be performed.
BUG=368834
Review URL: https://codereview.chromium.org/312163004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278658 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/api')
-rw-r--r-- | sync/api/sync_error.cc | 9 | ||||
-rw-r--r-- | sync/api/sync_error.h | 8 |
2 files changed, 12 insertions, 5 deletions
diff --git a/sync/api/sync_error.cc b/sync/api/sync_error.cc index ee6885c..1100a11 100644 --- a/sync/api/sync_error.cc +++ b/sync/api/sync_error.cc @@ -34,9 +34,12 @@ SyncError::SyncError(const tracked_objects::Location& location, case CRYPTO_ERROR: type_message = "cryptographer error was encountered: "; break; - default: - NOTREACHED(); - type_message = "invalid error: "; + case UNREADY_ERROR: + type_message = "unready error was encountered: "; + break; + case UNSET: + NOTREACHED() << "Invalid error type"; + return; } Init(location, type_message + custom_message, model_type, error_type); PrintLogError(); diff --git a/sync/api/sync_error.h b/sync/api/sync_error.h index 306ed83..f6ffa87 100644 --- a/sync/api/sync_error.h +++ b/sync/api/sync_error.h @@ -29,13 +29,17 @@ class SYNC_EXPORT SyncError { enum ErrorType { UNSET, // No error. UNRECOVERABLE_ERROR, // An unrecoverable runtime error was encountered, and - // sync should be disabled completely. + // sync should be disabled and purged completely. DATATYPE_ERROR, // A datatype error was encountered, and the datatype - // should be disabled. + // should be disabled and purged completely. Note that + // datatype errors may be reset, triggering a + // re-enable. PERSISTENCE_ERROR, // A persistence error was detected, and the // datataype should be associated after a sync update. CRYPTO_ERROR, // A cryptographer error was detected, and the // datatype should be associated after it is resolved. + UNREADY_ERROR, // The type is not ready to start yet, so should be + // neither purged nor enabled until it is ready. }; // Default constructor refers to "no error", and IsSet() will return false. |