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

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: Move syncer_error.* to internal_api/includes Created 8 years, 11 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..cd99da9150315dffe7f5990731d80f156884b902 100644
--- a/chrome/browser/sync/engine/model_changing_syncer_command.cc
+++ b/chrome/browser/sync/engine/model_changing_syncer_command.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -9,15 +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 != SYNCER_OK)
+ return result;
const std::set<ModelSafeGroup>& groups_to_change =
GetGroupsToChange(*work_session_);
@@ -40,15 +41,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. See also: crbug.com/109422.
+ if (this_worker_result != SYNCER_OK)
+ result = this_worker_result;
}
+
+ return result;
}
-bool ModelChangingSyncerCommand::ModelNeutralExecuteImpl(
+SyncerError ModelChangingSyncerCommand::ModelNeutralExecuteImpl(
sessions::SyncSession* session) {
- return true;
+ return SYNCER_OK;
}
} // namespace browser_sync

Powered by Google App Engine
This is Rietveld 408576698