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

Unified Diff: chrome/browser/sync/glue/syncable_service_adapter.cc

Issue 7453014: [Sync] Refactor sync datatype error handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and fix final unit test <3 c++ 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/syncable_service_adapter.cc
diff --git a/chrome/browser/sync/glue/syncable_service_adapter.cc b/chrome/browser/sync/glue/syncable_service_adapter.cc
index 68dcfae9b0f69880a1cbb7259a0f2de7cb5f56d2..88b6ab1f753903e1b5454c101bf3efa68cdda58c 100644
--- a/chrome/browser/sync/glue/syncable_service_adapter.cc
+++ b/chrome/browser/sync/glue/syncable_service_adapter.cc
@@ -30,18 +30,26 @@ SyncableServiceAdapter::~SyncableServiceAdapter() {
}
}
-bool SyncableServiceAdapter::AssociateModels() {
+bool SyncableServiceAdapter::AssociateModels(SyncError* error) {
syncing_ = true;
SyncDataList initial_sync_data;
- if (!sync_processor_->GetSyncDataForType(type_, &initial_sync_data)) {
+ SyncError temp_error =
+ sync_processor_->GetSyncDataForType(type_, &initial_sync_data);
+ if (temp_error.IsSet()) {
+ *error = temp_error;
return false;
}
- return service_->MergeDataAndStartSyncing(type_,
- initial_sync_data,
- sync_processor_);
+ temp_error = service_->MergeDataAndStartSyncing(type_,
+ initial_sync_data,
+ sync_processor_);
+ if (temp_error.IsSet()) {
+ *error = temp_error;
+ return false;
+ }
+ return true;
}
-bool SyncableServiceAdapter::DisassociateModels() {
+bool SyncableServiceAdapter::DisassociateModels(SyncError* error) {
service_->StopSyncing(type_);
syncing_ = false;
return true;
« no previous file with comments | « chrome/browser/sync/glue/syncable_service_adapter.h ('k') | chrome/browser/sync/glue/theme_data_type_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698