OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "sync/engine/sync_scheduler_impl.h" | 5 #include "sync/engine/sync_scheduler_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cstring> | 8 #include <cstring> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 OnActionableError(sync_protocol_error)); | 899 OnActionableError(sync_protocol_error)); |
900 } | 900 } |
901 } | 901 } |
902 | 902 |
903 void SyncSchedulerImpl::OnReceivedGuRetryDelay(const base::TimeDelta& delay) { | 903 void SyncSchedulerImpl::OnReceivedGuRetryDelay(const base::TimeDelta& delay) { |
904 nudge_tracker_.SetNextRetryTime(TimeTicks::Now() + delay); | 904 nudge_tracker_.SetNextRetryTime(TimeTicks::Now() + delay); |
905 retry_timer_.Start(FROM_HERE, delay, this, | 905 retry_timer_.Start(FROM_HERE, delay, this, |
906 &SyncSchedulerImpl::RetryTimerCallback); | 906 &SyncSchedulerImpl::RetryTimerCallback); |
907 } | 907 } |
908 | 908 |
| 909 void SyncSchedulerImpl::OnReceivedMigrationRequest(ModelTypeSet types) { |
| 910 FOR_EACH_OBSERVER(SyncEngineEventListener, |
| 911 *session_context_->listeners(), |
| 912 OnMigrationRequested(types)); |
| 913 } |
| 914 |
909 void SyncSchedulerImpl::SetNotificationsEnabled(bool notifications_enabled) { | 915 void SyncSchedulerImpl::SetNotificationsEnabled(bool notifications_enabled) { |
910 DCHECK(CalledOnValidThread()); | 916 DCHECK(CalledOnValidThread()); |
911 session_context_->set_notifications_enabled(notifications_enabled); | 917 session_context_->set_notifications_enabled(notifications_enabled); |
912 if (notifications_enabled) | 918 if (notifications_enabled) |
913 nudge_tracker_.OnInvalidationsEnabled(); | 919 nudge_tracker_.OnInvalidationsEnabled(); |
914 else | 920 else |
915 nudge_tracker_.OnInvalidationsDisabled(); | 921 nudge_tracker_.OnInvalidationsDisabled(); |
916 } | 922 } |
917 | 923 |
918 base::TimeDelta SyncSchedulerImpl::GetSessionsCommitDelay() const { | 924 base::TimeDelta SyncSchedulerImpl::GetSessionsCommitDelay() const { |
919 DCHECK(CalledOnValidThread()); | 925 DCHECK(CalledOnValidThread()); |
920 return sessions_commit_delay_; | 926 return sessions_commit_delay_; |
921 } | 927 } |
922 | 928 |
923 #undef SDVLOG_LOC | 929 #undef SDVLOG_LOC |
924 | 930 |
925 #undef SDVLOG | 931 #undef SDVLOG |
926 | 932 |
927 #undef SLOG | 933 #undef SLOG |
928 | 934 |
929 #undef ENUM_CASE | 935 #undef ENUM_CASE |
930 | 936 |
931 } // namespace syncer | 937 } // namespace syncer |
OLD | NEW |