diff options
Diffstat (limited to 'sync/engine/syncer_proto_util.cc')
-rw-r--r-- | sync/engine/syncer_proto_util.cc | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/sync/engine/syncer_proto_util.cc b/sync/engine/syncer_proto_util.cc index fe2a875..44ac321 100644 --- a/sync/engine/syncer_proto_util.cc +++ b/sync/engine/syncer_proto_util.cc @@ -420,9 +420,10 @@ SyncerError SyncerProtoUtil::PostClientToServerMessage( } if (command.has_sessions_commit_delay_seconds()) { - session->delegate()->OnReceivedSessionsCommitDelay( - base::TimeDelta::FromSeconds( - command.sessions_commit_delay_seconds())); + std::map<ModelType, base::TimeDelta> delay_map; + delay_map[SESSIONS] = + base::TimeDelta::FromSeconds(command.sessions_commit_delay_seconds()); + session->delegate()->OnReceivedCustomNudgeDelays(delay_map); } if (command.has_client_invalidation_hint_buffer_size()) { @@ -434,6 +435,22 @@ SyncerError SyncerProtoUtil::PostClientToServerMessage( session->delegate()->OnReceivedGuRetryDelay( base::TimeDelta::FromSeconds(command.gu_retry_delay_seconds())); } + + if (command.custom_nudge_delays_size() > 0) { + // Note that because this happens after the sessions_commit_delay_seconds + // handling, any SESSIONS value in this map will override the one in + // sessions_commit_delay_seconds. + std::map<ModelType, base::TimeDelta> delay_map; + for (int i = 0; i < command.custom_nudge_delays_size(); ++i) { + ModelType type = GetModelTypeFromSpecificsFieldNumber( + command.custom_nudge_delays(i).datatype_id()); + if (ProtocolTypes().Has(type)) { + delay_map[type] = base::TimeDelta::FromMilliseconds( + command.custom_nudge_delays(i).delay_ms()); + } + } + session->delegate()->OnReceivedCustomNudgeDelays(delay_map); + } } // Now do any special handling for the error type and decide on the return |