| 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/internal_api/sync_manager_impl.h" | 5 #include "sync/internal_api/sync_manager_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 } | 1002 } |
| 1003 | 1003 |
| 1004 // This is here for tests, which are still using p2p notifications. | 1004 // This is here for tests, which are still using p2p notifications. |
| 1005 // | 1005 // |
| 1006 // TODO(chron): Consider changing this back to track has_more_to_sync | 1006 // TODO(chron): Consider changing this back to track has_more_to_sync |
| 1007 // only notify peers if a successful commit has occurred. | 1007 // only notify peers if a successful commit has occurred. |
| 1008 bool is_notifiable_commit = | 1008 bool is_notifiable_commit = |
| 1009 (event.snapshot.model_neutral_state().num_successful_commits > 0); | 1009 (event.snapshot.model_neutral_state().num_successful_commits > 0); |
| 1010 if (is_notifiable_commit) { | 1010 if (is_notifiable_commit) { |
| 1011 if (invalidator_.get()) { | 1011 if (invalidator_.get()) { |
| 1012 const ModelTypeSet changed_types = | 1012 const ObjectIdStateMap& id_state_map = |
| 1013 ModelTypeStateMapToSet(event.snapshot.source().types); | 1013 ModelTypeStateMapToObjectIdStateMap(event.snapshot.source().types); |
| 1014 invalidator_->SendNotification(changed_types); | 1014 invalidator_->SendNotification(id_state_map); |
| 1015 } else { | 1015 } else { |
| 1016 DVLOG(1) << "Not sending notification: invalidator_ is NULL"; | 1016 DVLOG(1) << "Not sending notification: invalidator_ is NULL"; |
| 1017 } | 1017 } |
| 1018 } | 1018 } |
| 1019 } | 1019 } |
| 1020 | 1020 |
| 1021 if (event.what_happened == SyncEngineEvent::STOP_SYNCING_PERMANENTLY) { | 1021 if (event.what_happened == SyncEngineEvent::STOP_SYNCING_PERMANENTLY) { |
| 1022 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, | 1022 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, |
| 1023 OnStopSyncingPermanently()); | 1023 OnStopSyncingPermanently()); |
| 1024 return; | 1024 return; |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1357 int SyncManagerImpl::GetDefaultNudgeDelay() { | 1357 int SyncManagerImpl::GetDefaultNudgeDelay() { |
| 1358 return kDefaultNudgeDelayMilliseconds; | 1358 return kDefaultNudgeDelayMilliseconds; |
| 1359 } | 1359 } |
| 1360 | 1360 |
| 1361 // static. | 1361 // static. |
| 1362 int SyncManagerImpl::GetPreferencesNudgeDelay() { | 1362 int SyncManagerImpl::GetPreferencesNudgeDelay() { |
| 1363 return kPreferencesNudgeDelayMilliseconds; | 1363 return kPreferencesNudgeDelayMilliseconds; |
| 1364 } | 1364 } |
| 1365 | 1365 |
| 1366 } // namespace syncer | 1366 } // namespace syncer |
| OLD | NEW |