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

Unified Diff: sync/engine/syncer.cc

Issue 11192071: sync: Merge apply updates and resolve conflicts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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: sync/engine/syncer.cc
diff --git a/sync/engine/syncer.cc b/sync/engine/syncer.cc
index ffb2fcaf421d9c452ac9e7d8a146bfa27999562c..bdc5f3cd5c0e3e036d685b8d2c808c5051c64e46 100644
--- a/sync/engine/syncer.cc
+++ b/sync/engine/syncer.cc
@@ -19,7 +19,6 @@
#include "sync/engine/net/server_connection_manager.h"
#include "sync/engine/process_commit_response_command.h"
#include "sync/engine/process_updates_command.h"
-#include "sync/engine/resolve_conflicts_command.h"
#include "sync/engine/store_timestamps_command.h"
#include "sync/engine/syncer_types.h"
#include "sync/engine/throttled_data_type_tracker.h"
@@ -61,8 +60,6 @@ const char* SyncerStepToString(const SyncerStep step)
ENUM_CASE(STORE_TIMESTAMPS);
ENUM_CASE(APPLY_UPDATES);
ENUM_CASE(COMMIT);
- ENUM_CASE(RESOLVE_CONFLICTS);
tim (not reviewing) 2012/10/24 20:29:08 It's great to move this to after applying updates,
rlarocque 2012/10/24 21:21:22 Although I do think this looks nicer, that's not m
- ENUM_CASE(APPLY_UPDATES_TO_RESOLVE_CONFLICTS);
ENUM_CASE(SYNCER_END);
}
NOTREACHED();
@@ -172,43 +169,6 @@ void Syncer::SyncShare(sessions::SyncSession* session,
case COMMIT: {
session->mutable_status_controller()->set_commit_result(
BuildAndPostCommits(this, session));
- next_step = RESOLVE_CONFLICTS;
- break;
- }
- case RESOLVE_CONFLICTS: {
- StatusController* status = session->mutable_status_controller();
- status->reset_conflicts_resolved();
- ResolveConflictsCommand resolve_conflicts_command;
- resolve_conflicts_command.Execute(session);
-
- // Has ConflictingUpdates includes both resolvable and unresolvable
- // conflicts. If we have either, we want to attempt to reapply.
- if (status->HasConflictingUpdates())
- next_step = APPLY_UPDATES_TO_RESOLVE_CONFLICTS;
- else
- next_step = SYNCER_END;
- break;
- }
- case APPLY_UPDATES_TO_RESOLVE_CONFLICTS: {
- StatusController* status = session->mutable_status_controller();
- DVLOG(1) << "Applying updates to resolve conflicts";
- ApplyUpdatesCommand apply_updates;
-
- // We only care to resolve conflicts again if we made progress on the
- // simple conflicts.
- int before_blocking_conflicting_updates =
- status->num_simple_conflicts();
- apply_updates.Execute(session);
- int after_blocking_conflicting_updates =
- status->num_simple_conflicts();
- // If the following call sets the conflicts_resolved value to true,
- // SyncSession::HasMoreToSync() will send us into another sync cycle
- // after this one completes.
- //
- // TODO(rlarocque, 109072): Make conflict resolution not require
- // extra sync cycles/GetUpdates.
- status->update_conflicts_resolved(before_blocking_conflicting_updates >
- after_blocking_conflicting_updates);
next_step = SYNCER_END;
break;
}

Powered by Google App Engine
This is Rietveld 408576698