| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |