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

Side by Side Diff: components/sync/engine_impl/get_updates_delegate.cc

Issue 2475043002: [Sync] Sync client should to exponential backoff when receive partial failure (Closed)
Patch Set: rebase Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/sync/engine_impl/get_updates_delegate.h" 5 #include "components/sync/engine_impl/get_updates_delegate.h"
6 6
7 #include "components/sync/engine_impl/directory_update_handler.h" 7 #include "components/sync/engine_impl/directory_update_handler.h"
8 #include "components/sync/engine_impl/events/configure_get_updates_request_event .h" 8 #include "components/sync/engine_impl/events/configure_get_updates_request_event .h"
9 #include "components/sync/engine_impl/events/normal_get_updates_request_event.h" 9 #include "components/sync/engine_impl/events/normal_get_updates_request_event.h"
10 #include "components/sync/engine_impl/events/poll_get_updates_request_event.h" 10 #include "components/sync/engine_impl/events/poll_get_updates_request_event.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 if (nudge_tracker_.GetLegacySource() == sync_pb::GetUpdatesCallerInfo::RETRY) 62 if (nudge_tracker_.GetLegacySource() == sync_pb::GetUpdatesCallerInfo::RETRY)
63 get_updates->set_get_updates_origin(sync_pb::SyncEnums::RETRY); 63 get_updates->set_get_updates_origin(sync_pb::SyncEnums::RETRY);
64 64
65 // Fill in the notification hints. 65 // Fill in the notification hints.
66 for (int i = 0; i < get_updates->from_progress_marker_size(); ++i) { 66 for (int i = 0; i < get_updates->from_progress_marker_size(); ++i) {
67 sync_pb::DataTypeProgressMarker* progress_marker = 67 sync_pb::DataTypeProgressMarker* progress_marker =
68 get_updates->mutable_from_progress_marker(i); 68 get_updates->mutable_from_progress_marker(i);
69 ModelType type = 69 ModelType type =
70 GetModelTypeFromSpecificsFieldNumber(progress_marker->data_type_id()); 70 GetModelTypeFromSpecificsFieldNumber(progress_marker->data_type_id());
71 71
72 DCHECK(!nudge_tracker_.IsTypeThrottled(type)) 72 DCHECK(!nudge_tracker_.IsTypeBlocked(type))
73 << "Throttled types should have been removed from the request_types."; 73 << "Throttled types should have been removed from the request_types.";
74 74
75 nudge_tracker_.SetLegacyNotificationHint(type, progress_marker); 75 nudge_tracker_.SetLegacyNotificationHint(type, progress_marker);
76 nudge_tracker_.FillProtoMessage( 76 nudge_tracker_.FillProtoMessage(
77 type, progress_marker->mutable_get_update_triggers()); 77 type, progress_marker->mutable_get_update_triggers());
78 } 78 }
79 } 79 }
80 80
81 void NormalGetUpdatesDelegate::ApplyUpdates( 81 void NormalGetUpdatesDelegate::ApplyUpdates(
82 ModelTypeSet gu_types, 82 ModelTypeSet gu_types,
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 162 }
163 163
164 std::unique_ptr<ProtocolEvent> PollGetUpdatesDelegate::GetNetworkRequestEvent( 164 std::unique_ptr<ProtocolEvent> PollGetUpdatesDelegate::GetNetworkRequestEvent(
165 base::Time timestamp, 165 base::Time timestamp,
166 const sync_pb::ClientToServerMessage& request) const { 166 const sync_pb::ClientToServerMessage& request) const {
167 return std::unique_ptr<ProtocolEvent>( 167 return std::unique_ptr<ProtocolEvent>(
168 new PollGetUpdatesRequestEvent(timestamp, request)); 168 new PollGetUpdatesRequestEvent(timestamp, request));
169 } 169 }
170 170
171 } // namespace syncer 171 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/engine_impl/cycle/test_util.cc ('k') | components/sync/engine_impl/get_updates_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698