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

Unified Diff: sync/engine/syncer.cc

Issue 19309002: sync: Add pre-commit update avoidance mode + flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits Created 7 years, 5 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
« no previous file with comments | « sync/engine/sync_scheduler_unittest.cc ('k') | sync/engine/syncer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/syncer.cc
diff --git a/sync/engine/syncer.cc b/sync/engine/syncer.cc
index 9b1adb3791e0c84f5ea4a0c26d54a5f88a91cb5b..1be4c7a338932bd6a2e00672e12969c399bf9329 100644
--- a/sync/engine/syncer.cc
+++ b/sync/engine/syncer.cc
@@ -64,14 +64,17 @@ bool Syncer::NormalSyncShare(ModelTypeSet request_types,
SyncSession* session) {
HandleCycleBegin(session);
VLOG(1) << "Downloading types " << ModelTypeSetToString(request_types);
- if (!DownloadAndApplyUpdates(
- session,
- base::Bind(&NormalDownloadUpdates,
- session,
- kCreateMobileBookmarksFolder,
- request_types,
- base::ConstRef(nudge_tracker)))) {
- return HandleCycleEnd(session);
+ if (nudge_tracker.IsGetUpdatesRequired() ||
+ session->context()->ShouldFetchUpdatesBeforeCommit()) {
+ if (!DownloadAndApplyUpdates(
+ session,
+ base::Bind(&NormalDownloadUpdates,
+ session,
+ kCreateMobileBookmarksFolder,
+ request_types,
+ base::ConstRef(nudge_tracker)))) {
+ return HandleCycleEnd(session);
+ }
}
VLOG(1) << "Committing from types " << ModelTypeSetToString(request_types);
« no previous file with comments | « sync/engine/sync_scheduler_unittest.cc ('k') | sync/engine/syncer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698