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

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: Rename some variables 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
Index: sync/engine/syncer.cc
diff --git a/sync/engine/syncer.cc b/sync/engine/syncer.cc
index 9b1adb3791e0c84f5ea4a0c26d54a5f88a91cb5b..daeaf354c8fa16deedbfab6287cf2597338100e7 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()->should_fetch_updates_before_commit()) {
+ 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);

Powered by Google App Engine
This is Rietveld 408576698