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

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

Issue 7453014: [Sync] Refactor sync datatype error handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit test Created 9 years, 5 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/data_type_manager.h
diff --git a/chrome/browser/sync/glue/data_type_manager.h b/chrome/browser/sync/glue/data_type_manager.h
index eef71a16d0cae10bc5cad0668e7c11b649a076b1..907c9a1fcae28c5bf60793b1162084c25b077b85 100644
--- a/chrome/browser/sync/glue/data_type_manager.h
+++ b/chrome/browser/sync/glue/data_type_manager.h
@@ -36,7 +36,7 @@ class DataTypeManager {
// Update NotifyDone() in data_type_manager_impl.cc if you update
// this.
- enum ConfigureResult {
+ enum ConfigureStatus {
OK, // Configuration finished without error.
ASSOCIATION_FAILED, // An error occurred during model association.
ABORTED, // Start was aborted by calling Stop() before
@@ -47,33 +47,21 @@ class DataTypeManager {
typedef std::set<syncable::ModelType> TypeSet;
- // In case of an error the location is filled with the location the
- // error originated from. In case of a success the error location value
- // is to be not used.
- // TODO(tim): We should rename this / ConfigureResult to something more
- // flexible like SyncConfigureDoneDetails.
- struct ConfigureResultWithErrorLocation {
- ConfigureResult result;
+ // Note: location and failed_types are only filled when status is not OK.
+ struct ConfigureResult {
+ ConfigureResult();
+ ConfigureResult(ConfigureStatus status,
+ TypeSet requested_types);
+ ConfigureResult(ConfigureStatus status,
+ TypeSet requested_types,
+ TypeSet failed_types,
+ const tracked_objects::Location& location);
+ ConfigureStatus status;
TypeSet requested_types;
- scoped_ptr<tracked_objects::Location> location;
-
- ConfigureResultWithErrorLocation();
- ConfigureResultWithErrorLocation(const ConfigureResult& result,
- const tracked_objects::Location& location,
- const TypeSet& requested_types)
- : result(result),
- requested_types(requested_types) {
- this->location.reset(new tracked_objects::Location(
- location.function_name(),
- location.file_name(),
- location.line_number(),
- location.program_counter()));
- }
-
- ~ConfigureResultWithErrorLocation();
+ TypeSet failed_types;
+ tracked_objects::Location location;
};
-
virtual ~DataTypeManager() {}
// Begins asynchronous configuration of data types. Any currently

Powered by Google App Engine
This is Rietveld 408576698