| 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 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 } | 1013 } |
| 1014 | 1014 |
| 1015 // This is here for tests, which are still using p2p notifications. | 1015 // This is here for tests, which are still using p2p notifications. |
| 1016 // | 1016 // |
| 1017 // TODO(chron): Consider changing this back to track has_more_to_sync | 1017 // TODO(chron): Consider changing this back to track has_more_to_sync |
| 1018 // only notify peers if a successful commit has occurred. | 1018 // only notify peers if a successful commit has occurred. |
| 1019 bool is_notifiable_commit = | 1019 bool is_notifiable_commit = |
| 1020 (event.snapshot.model_neutral_state().num_successful_commits > 0); | 1020 (event.snapshot.model_neutral_state().num_successful_commits > 0); |
| 1021 if (is_notifiable_commit) { | 1021 if (is_notifiable_commit) { |
| 1022 if (invalidator_.get()) { | 1022 if (invalidator_.get()) { |
| 1023 const ModelTypeSet changed_types = | 1023 const ObjectIdStateMap& id_state_map = |
| 1024 ModelTypeStateMapToSet(event.snapshot.source().types); | 1024 ModelTypeStateMapToObjectIdStateMap(event.snapshot.source().types); |
| 1025 invalidator_->SendNotification(changed_types); | 1025 invalidator_->SendNotification(id_state_map); |
| 1026 } else { | 1026 } else { |
| 1027 DVLOG(1) << "Not sending notification: invalidator_ is NULL"; | 1027 DVLOG(1) << "Not sending notification: invalidator_ is NULL"; |
| 1028 } | 1028 } |
| 1029 } | 1029 } |
| 1030 } | 1030 } |
| 1031 | 1031 |
| 1032 if (event.what_happened == SyncEngineEvent::STOP_SYNCING_PERMANENTLY) { | 1032 if (event.what_happened == SyncEngineEvent::STOP_SYNCING_PERMANENTLY) { |
| 1033 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, | 1033 FOR_EACH_OBSERVER(SyncManager::Observer, observers_, |
| 1034 OnStopSyncingPermanently()); | 1034 OnStopSyncingPermanently()); |
| 1035 return; | 1035 return; |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1368 int SyncManagerImpl::GetDefaultNudgeDelay() { | 1368 int SyncManagerImpl::GetDefaultNudgeDelay() { |
| 1369 return kDefaultNudgeDelayMilliseconds; | 1369 return kDefaultNudgeDelayMilliseconds; |
| 1370 } | 1370 } |
| 1371 | 1371 |
| 1372 // static. | 1372 // static. |
| 1373 int SyncManagerImpl::GetPreferencesNudgeDelay() { | 1373 int SyncManagerImpl::GetPreferencesNudgeDelay() { |
| 1374 return kPreferencesNudgeDelayMilliseconds; | 1374 return kPreferencesNudgeDelayMilliseconds; |
| 1375 } | 1375 } |
| 1376 | 1376 |
| 1377 } // namespace syncer | 1377 } // namespace syncer |
| OLD | NEW |