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

Unified Diff: sync/engine/get_updates_delegate.cc

Issue 171813013: sync: Merge GU retry logic into normal GU (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 10 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/get_updates_delegate.h ('k') | sync/engine/get_updates_processor_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/get_updates_delegate.cc
diff --git a/sync/engine/get_updates_delegate.cc b/sync/engine/get_updates_delegate.cc
index d0c7a173ad9898c5e33c4ef53033ff85ed3dcdcf..4697485b52f9de2cad1af415edf1bad5b6098bbf 100644
--- a/sync/engine/get_updates_delegate.cc
+++ b/sync/engine/get_updates_delegate.cc
@@ -46,12 +46,17 @@ void NormalGetUpdatesDelegate::HelpPopulateGuMessage(
sync_pb::GetUpdatesMessage* get_updates) const {
// Set legacy GetUpdatesMessage.GetUpdatesCallerInfo information.
get_updates->mutable_caller_info()->set_source(
- nudge_tracker_.updates_source());
+ nudge_tracker_.GetLegacySource());
// 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());
+ // Special case: A GU performed for no other reason than retry will have its
+ // origin set to RETRY.
+ if (nudge_tracker_.GetLegacySource() == sync_pb::GetUpdatesCallerInfo::RETRY)
+ get_updates->set_get_updates_origin(sync_pb::SyncEnums::RETRY);
+
// Fill in the notification hints.
for (int i = 0; i < get_updates->from_progress_marker_size(); ++i) {
sync_pb::DataTypeProgressMarker* progress_marker =
@@ -75,27 +80,6 @@ void NormalGetUpdatesDelegate::ApplyUpdates(
NonPassiveApplyUpdates(status_controller, update_handler_map);
}
-RetryGetUpdatesDelegate::RetryGetUpdatesDelegate() {}
-
-RetryGetUpdatesDelegate::~RetryGetUpdatesDelegate() {}
-
-void RetryGetUpdatesDelegate::HelpPopulateGuMessage(
- sync_pb::GetUpdatesMessage* get_updates) const {
- // 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);
- get_updates->set_is_retry(true);
-}
-
-void RetryGetUpdatesDelegate::ApplyUpdates(
- sessions::StatusController* status_controller,
- UpdateHandlerMap* update_handler_map) const {
- NonPassiveApplyUpdates(status_controller, update_handler_map);
-}
-
ConfigureGetUpdatesDelegate::ConfigureGetUpdatesDelegate(
sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source) : source_(source) {}
« no previous file with comments | « sync/engine/get_updates_delegate.h ('k') | sync/engine/get_updates_processor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698