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

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..4712857c8956bd2ee475b777f5877f69bd735f85 100644
--- a/sync/engine/download.cc
+++ b/sync/engine/download.cc
@@ -234,6 +234,7 @@ void BuildNormalDownloadUpdatesImpl(
// Set the new and improved version of source, too.
get_updates->set_get_updates_origin(sync_pb::SyncEnums::GU_TRIGGER);
+ get_updates->set_is_retry(nudge_tracker.IsRetryRequired());
rlarocque 2014/01/06 23:00:33 This is good, but I think this flag should also be
haitaol1 2014/01/07 19:03:37 origin == RETRY already indicates it's a retry GU,
rlarocque 2014/01/07 19:43:41 This would make the logic to detect retry GUs hard
haitaol1 2014/01/08 19:06:38 Done.
// Fill in the notification hints.
for (int i = 0; i < get_updates->from_progress_marker_size(); ++i) {
@@ -294,26 +295,32 @@ void BuildDownloadUpdatesForConfigureImpl(
get_updates->set_get_updates_origin(origin);
}
-void BuildDownloadUpdatesForPoll(
+void BuildSupplementDownloadUpdates(
SyncSession* session,
bool create_mobile_bookmarks_folder,
ModelTypeSet request_types,
+ sync_pb::SyncEnums::GetUpdatesOrigin gu_origin,
sync_pb::ClientToServerMessage* client_to_server_message) {
- DVLOG(1) << "Polling for types "
+ DVLOG(1) << "Polling/Retrying for types "
<< ModelTypeSetToString(request_types);
+ DCHECK(gu_origin == sync_pb::SyncEnums::PERIODIC ||
+ gu_origin == sync_pb::SyncEnums::RETRY);
+
InitDownloadUpdatesContext(
session,
create_mobile_bookmarks_folder,
client_to_server_message);
- BuildDownloadUpdatesForPollImpl(
+ BuildSupplementDownloadUpdatesImpl(
Intersection(request_types, ProtocolTypes()),
+ gu_origin,
session->context()->update_handler_map(),
client_to_server_message->mutable_get_updates());
}
-void BuildDownloadUpdatesForPollImpl(
+void BuildSupplementDownloadUpdatesImpl(
rlarocque 2014/01/06 23:00:33 I realize this is a bit subjective, but I think th
haitaol1 2014/01/07 19:03:37 Done.
ModelTypeSet proto_request_types,
+ sync_pb::SyncEnums::GetUpdatesOrigin gu_origin,
UpdateHandlerMap* update_handler_map,
sync_pb::GetUpdatesMessage* get_updates) {
DCHECK(!proto_request_types.Empty());
@@ -323,12 +330,16 @@ void BuildDownloadUpdatesForPollImpl(
update_handler_map,
get_updates);
- // Set legacy GetUpdatesMessage.GetUpdatesCallerInfo information.
- get_updates->mutable_caller_info()->set_source(
- sync_pb::GetUpdatesCallerInfo::PERIODIC);
-
- // Set the new and improved version of source, too.
- get_updates->set_get_updates_origin(sync_pb::SyncEnums::PERIODIC);
+ // Set the new and improved version of source as well as the legacy
+ // GetUpdatesMessage.GetUpdatesCallerInfo information.
+ get_updates->set_get_updates_origin(gu_origin);
+ if (gu_origin == sync_pb::SyncEnums::PERIODIC) {
+ get_updates->mutable_caller_info()->set_source(
+ sync_pb::GetUpdatesCallerInfo::PERIODIC);
+ } else {
+ get_updates->mutable_caller_info()->set_source(
+ sync_pb::GetUpdatesCallerInfo::RETRY);
+ }
}
SyncerError ExecuteDownloadUpdates(

Powered by Google App Engine
This is Rietveld 408576698