diff options
author | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-08 23:25:22 +0000 |
---|---|---|
committer | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-08 23:25:22 +0000 |
commit | 42fff674909f23a7ad89318444884c64b1b67182 (patch) | |
tree | f709e6578ad6a8a9e451b5f0a922d946d6129439 /sync/sessions/sync_session.cc | |
parent | 531e63525c32fc235daed199db1dcec02c0629ad (diff) | |
download | chromium_src-42fff674909f23a7ad89318444884c64b1b67182.zip chromium_src-42fff674909f23a7ad89318444884c64b1b67182.tar.gz chromium_src-42fff674909f23a7ad89318444884c64b1b67182.tar.bz2 |
Refactor following sync commit loop change
This change includes some cleanups of the code introduced in r139519.
They have been kept separate from that CL in the hopes of making both
CLs easiser to read.
This commit moves some error-detection functionality from
ProcessCommitResponse's ModelNeutralExecuteImpl() into
BuildAndPostCommits(). This simplifies some of the error handling and
allows us to remove ModelChangingSyncerCommand's
ModelNeutralExecuteImpl().
This CL also combines both commit error indicators into a single
variable.
BUG=91696,36594
TEST=
Review URL: https://chromiumcodereview.appspot.com/10523003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141321 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/sessions/sync_session.cc')
-rw-r--r-- | sync/sessions/sync_session.cc | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/sync/sessions/sync_session.cc b/sync/sessions/sync_session.cc index ac874d1..36bc2ca 100644 --- a/sync/sessions/sync_session.cc +++ b/sync/sessions/sync_session.cc @@ -235,12 +235,8 @@ bool IsError(SyncerError error) { bool HadErrors(const ErrorCounters& error) { const bool download_updates_error = IsError(error.last_download_updates_result); - const bool post_commit_error = IsError(error.last_post_commit_result); - const bool process_commit_response_error = - IsError(error.last_process_commit_response_result); - return download_updates_error || - post_commit_error || - process_commit_response_error; + const bool commit_error = IsError(error.commit_result); + return download_updates_error || commit_error; } } // namespace @@ -251,9 +247,7 @@ bool SyncSession::Succeeded() const { bool SyncSession::SuccessfullyReachedServer() const { const ErrorCounters& error = status_controller_->error(); - bool reached_server = error.last_download_updates_result == SYNCER_OK || - error.last_post_commit_result == SYNCER_OK || - error.last_process_commit_response_result == SYNCER_OK; + bool reached_server = error.last_download_updates_result == SYNCER_OK; // It's possible that we reached the server on one attempt, then had an error // on the next (or didn't perform some of the server-communicating commands). // We want to verify that, for all commands attempted, we successfully spoke |