| 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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 return false; | 564 return false; |
| 565 | 565 |
| 566 return true; | 566 return true; |
| 567 } | 567 } |
| 568 | 568 |
| 569 bool SyncManagerImpl::PurgePartiallySyncedTypes() { | 569 bool SyncManagerImpl::PurgePartiallySyncedTypes() { |
| 570 ModelTypeSet partially_synced_types = ModelTypeSet::All(); | 570 ModelTypeSet partially_synced_types = ModelTypeSet::All(); |
| 571 partially_synced_types.RemoveAll(InitialSyncEndedTypes()); | 571 partially_synced_types.RemoveAll(InitialSyncEndedTypes()); |
| 572 partially_synced_types.RemoveAll(GetTypesWithEmptyProgressMarkerToken( | 572 partially_synced_types.RemoveAll(GetTypesWithEmptyProgressMarkerToken( |
| 573 ModelTypeSet::All())); | 573 ModelTypeSet::All())); |
| 574 partially_synced_types.RemoveAll(LocalTypes()); |
| 574 | 575 |
| 575 DVLOG(1) << "Purging partially synced types " | 576 DVLOG(1) << "Purging partially synced types " |
| 576 << ModelTypeSetToString(partially_synced_types); | 577 << ModelTypeSetToString(partially_synced_types); |
| 577 UMA_HISTOGRAM_COUNTS("Sync.PartiallySyncedTypes", | 578 UMA_HISTOGRAM_COUNTS("Sync.PartiallySyncedTypes", |
| 578 partially_synced_types.Size()); | 579 partially_synced_types.Size()); |
| 579 if (partially_synced_types.Empty()) | 580 if (partially_synced_types.Empty()) |
| 580 return true; | 581 return true; |
| 581 return directory()->PurgeEntriesWithTypeIn(partially_synced_types); | 582 return directory()->PurgeEntriesWithTypeIn(partially_synced_types); |
| 582 } | 583 } |
| 583 | 584 |
| 584 bool SyncManagerImpl::PurgeDisabledTypes( | 585 bool SyncManagerImpl::PurgeDisabledTypes( |
| 585 ModelTypeSet previously_enabled_types, | 586 ModelTypeSet previously_enabled_types, |
| 586 ModelTypeSet currently_enabled_types) { | 587 ModelTypeSet currently_enabled_types) { |
| 587 ModelTypeSet disabled_types = Difference(previously_enabled_types, | 588 ModelTypeSet disabled_types = Difference(previously_enabled_types, |
| 588 currently_enabled_types); | 589 currently_enabled_types); |
| 590 disabled_types.RemoveAll(LocalTypes()); |
| 589 if (disabled_types.Empty()) | 591 if (disabled_types.Empty()) |
| 590 return true; | 592 return true; |
| 591 | 593 |
| 592 DVLOG(1) << "Purging disabled types " | 594 DVLOG(1) << "Purging disabled types " |
| 593 << ModelTypeSetToString(disabled_types); | 595 << ModelTypeSetToString(disabled_types); |
| 594 return directory()->PurgeEntriesWithTypeIn(disabled_types); | 596 return directory()->PurgeEntriesWithTypeIn(disabled_types); |
| 595 } | 597 } |
| 596 | 598 |
| 597 void SyncManagerImpl::UpdateCredentials( | 599 void SyncManagerImpl::UpdateCredentials( |
| 598 const SyncCredentials& credentials) { | 600 const SyncCredentials& credentials) { |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1356 int SyncManagerImpl::GetDefaultNudgeDelay() { | 1358 int SyncManagerImpl::GetDefaultNudgeDelay() { |
| 1357 return kDefaultNudgeDelayMilliseconds; | 1359 return kDefaultNudgeDelayMilliseconds; |
| 1358 } | 1360 } |
| 1359 | 1361 |
| 1360 // static. | 1362 // static. |
| 1361 int SyncManagerImpl::GetPreferencesNudgeDelay() { | 1363 int SyncManagerImpl::GetPreferencesNudgeDelay() { |
| 1362 return kPreferencesNudgeDelayMilliseconds; | 1364 return kPreferencesNudgeDelayMilliseconds; |
| 1363 } | 1365 } |
| 1364 | 1366 |
| 1365 } // namespace syncer | 1367 } // namespace syncer |
| OLD | NEW |