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

Unified Diff: sync/engine/download.cc

Issue 124083002: Client-side changes to support retry GU. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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/download.cc
diff --git a/sync/engine/download.cc b/sync/engine/download.cc
index 2bc7f7a0a9d35be4e85e68ce60420826057f5458..8b1990daabb1a8d077d3d5731cb4532b07038464 100644
--- a/sync/engine/download.cc
+++ b/sync/engine/download.cc
@@ -331,6 +331,43 @@ void BuildDownloadUpdatesForPollImpl(
get_updates->set_get_updates_origin(sync_pb::SyncEnums::PERIODIC);
}
+void BuildDownloadUpdatesForRetry(
+ SyncSession* session,
+ bool create_mobile_bookmarks_folder,
+ ModelTypeSet request_types,
+ sync_pb::ClientToServerMessage* client_to_server_message) {
+ DVLOG(1) << "Retrying for types "
+ << ModelTypeSetToString(request_types);
+
+ InitDownloadUpdatesContext(
+ session,
+ create_mobile_bookmarks_folder,
+ client_to_server_message);
+ BuildDownloadUpdatesForRetryImpl(
+ Intersection(request_types, ProtocolTypes()),
+ session->context()->update_handler_map(),
+ client_to_server_message->mutable_get_updates());
+}
+
+void BuildDownloadUpdatesForRetryImpl(
+ ModelTypeSet proto_request_types,
+ UpdateHandlerMap* update_handler_map,
+ sync_pb::GetUpdatesMessage* get_updates) {
+ DCHECK(!proto_request_types.Empty());
+
+ InitDownloadUpdatesProgress(
+ proto_request_types,
+ update_handler_map,
+ get_updates);
+
+ // Set legacy GetUpdatesMessage.GetUpdatesCallerInfo information.
+ get_updates->mutable_caller_info()->set_source(
+ sync_pb::GetUpdatesCallerInfo::RETRY);
+
+ // Set the new and improved version of source, too.
+ get_updates->set_get_updates_origin(sync_pb::SyncEnums::RETRY);
+}
+
SyncerError ExecuteDownloadUpdates(
ModelTypeSet request_types,
SyncSession* session,

Powered by Google App Engine
This is Rietveld 408576698