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

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

Issue 8638001: [Sync] Made some sync session member functions const (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix latent bug in StatusController Created 9 years, 1 month 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/process_updates_command.cc
diff --git a/chrome/browser/sync/engine/process_updates_command.cc b/chrome/browser/sync/engine/process_updates_command.cc
index c6d41411be5659d36c5541a38417177a683e29f7..e6763bdc773eeebb88ebcc0b25bd15088a05d1b0 100644
--- a/chrome/browser/sync/engine/process_updates_command.cc
+++ b/chrome/browser/sync/engine/process_updates_command.cc
@@ -28,7 +28,7 @@ ProcessUpdatesCommand::~ProcessUpdatesCommand() {}
bool ProcessUpdatesCommand::ModelNeutralExecuteImpl(SyncSession* session) {
const GetUpdatesResponse& updates =
- session->status_controller()->updates_response().get_updates();
+ session->status_controller().updates_response().get_updates();
const int update_count = updates.entries_size();
// Don't bother processing updates if there were none.
@@ -43,13 +43,15 @@ void ProcessUpdatesCommand::ModelChangingExecuteImpl(SyncSession* session) {
return;
}
- StatusController* status = session->status_controller();
+ const sessions::UpdateProgress* progress =
+ session->status_controller().update_progress();
+ if (!progress)
+ return; // Nothing to do.
syncable::WriteTransaction trans(FROM_HERE, syncable::SYNCER, dir);
- const sessions::UpdateProgress& progress(status->update_progress());
vector<sessions::VerifiedUpdate>::const_iterator it;
- for (it = progress.VerifiedUpdatesBegin();
- it != progress.VerifiedUpdatesEnd();
+ for (it = progress->VerifiedUpdatesBegin();
+ it != progress->VerifiedUpdatesEnd();
++it) {
const sync_pb::SyncEntity& update = it->second;
@@ -65,10 +67,9 @@ void ProcessUpdatesCommand::ModelChangingExecuteImpl(SyncSession* session) {
}
}
+ StatusController* status = session->mutable_status_controller();
status->set_num_consecutive_errors(0);
-
status->mutable_update_progress()->ClearVerifiedUpdates();
- return;
}
namespace {

Powered by Google App Engine
This is Rietveld 408576698