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

Unified Diff: chrome/browser/sync/engine/model_changing_syncer_command.cc

Issue 9113024: Add return values to SyncerCommand (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update for review comments Created 8 years, 12 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/engine/model_changing_syncer_command.cc
diff --git a/chrome/browser/sync/engine/model_changing_syncer_command.cc b/chrome/browser/sync/engine/model_changing_syncer_command.cc
index 1c392cbd20877ecfc27fa47abddc076dd2627361..da59a5117b361c0537de28a4922fbaf3528c8f61 100644
--- a/chrome/browser/sync/engine/model_changing_syncer_command.cc
+++ b/chrome/browser/sync/engine/model_changing_syncer_command.cc
@@ -9,14 +9,16 @@
#include "base/bind_helpers.h"
#include "chrome/browser/sync/sessions/status_controller.h"
#include "chrome/browser/sync/sessions/sync_session.h"
-#include "chrome/browser/sync/util/unrecoverable_error_info.h"
namespace browser_sync {
-void ModelChangingSyncerCommand::ExecuteImpl(sessions::SyncSession* session) {
+SyncerError ModelChangingSyncerCommand::ExecuteImpl(
+ sessions::SyncSession* session) {
work_session_ = session;
- if (!ModelNeutralExecuteImpl(work_session_)) {
- return;
+ SyncerError result = ModelNeutralExecuteImpl(work_session_);
+
+ if (result != NO_ERROR) {
tim (not reviewing) 2012/01/06 16:33:42 In general most of the sync code uses no-brace-on-
rlarocque 2012/01/06 19:44:21 Done. Removed braces from this if statement.
+ return result;
}
const std::set<ModelSafeGroup>& groups_to_change =
@@ -40,15 +42,19 @@ void ModelChangingSyncerCommand::ExecuteImpl(sessions::SyncSession* session) {
// unretained.
base::Unretained(this));
- // TODO(lipalani): Check the return value for an unrecoverable error.
- ignore_result(worker->DoWorkAndWaitUntilDone(c));
-
+ SyncerError this_worker_result = worker->DoWorkAndWaitUntilDone(c);
+ // TODO(rlarocque): Figure out a better way to deal with errors from
+ // multiple models at once.
tim (not reviewing) 2012/01/06 16:33:42 Indeed. Can you file a bug to track this?
rlarocque 2012/01/06 19:44:21 Done. I've opened crbug.com/109422 to track this.
+ if (this_worker_result != NO_ERROR)
+ result = this_worker_result;
}
+
+ return result;
}
-bool ModelChangingSyncerCommand::ModelNeutralExecuteImpl(
+SyncerError ModelChangingSyncerCommand::ModelNeutralExecuteImpl(
sessions::SyncSession* session) {
- return true;
+ return NO_ERROR;
}
} // namespace browser_sync

Powered by Google App Engine
This is Rietveld 408576698