Chromium Code Reviews| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "chrome/browser/sync/glue/sync_backend_host.h" | 7 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 720 syncer::ModelTypeSet previous_types = registrar_->GetLastConfiguredTypes(); | 720 syncer::ModelTypeSet previous_types = registrar_->GetLastConfiguredTypes(); |
| 721 | 721 |
| 722 syncer::ModelTypeSet disabled_types = | 722 syncer::ModelTypeSet disabled_types = |
| 723 GetDataTypesInState(DISABLED, config_state_map); | 723 GetDataTypesInState(DISABLED, config_state_map); |
| 724 syncer::ModelTypeSet fatal_types = | 724 syncer::ModelTypeSet fatal_types = |
| 725 GetDataTypesInState(FATAL, config_state_map); | 725 GetDataTypesInState(FATAL, config_state_map); |
| 726 syncer::ModelTypeSet crypto_types = | 726 syncer::ModelTypeSet crypto_types = |
| 727 GetDataTypesInState(CRYPTO, config_state_map); | 727 GetDataTypesInState(CRYPTO, config_state_map); |
| 728 disabled_types.PutAll(fatal_types); | 728 disabled_types.PutAll(fatal_types); |
| 729 disabled_types.PutAll(crypto_types); | 729 disabled_types.PutAll(crypto_types); |
| 730 syncer::ModelTypeSet active_types = | |
| 731 GetDataTypesInState(CONFIGURE_ACTIVE, config_state_map); | |
| 732 syncer::ModelTypeSet clean_first_types = | |
| 733 GetDataTypesInState(CONFIGURE_CLEAN, config_state_map); | |
| 730 syncer::ModelTypeSet types_to_download = registrar_->ConfigureDataTypes( | 734 syncer::ModelTypeSet types_to_download = registrar_->ConfigureDataTypes( |
| 731 GetDataTypesInState(CONFIGURE_ACTIVE, config_state_map), | 735 syncer::Union(active_types, clean_first_types), |
| 732 disabled_types); | 736 disabled_types); |
| 737 types_to_download.PutAll(clean_first_types); | |
|
tim (not reviewing)
2013/07/01 21:10:18
In what cases does the registrar decide to remove
Nicolas Zea
2013/07/01 23:27:45
I'm not sure I understand the question? The regist
tim (not reviewing)
2013/07/02 18:54:18
I guess it wasn't clear what was happening with cl
| |
| 733 types_to_download.RemoveAll(syncer::ProxyTypes()); | 738 types_to_download.RemoveAll(syncer::ProxyTypes()); |
| 734 if (!types_to_download.Empty()) | 739 if (!types_to_download.Empty()) |
| 735 types_to_download.Put(syncer::NIGORI); | 740 types_to_download.Put(syncer::NIGORI); |
| 736 | 741 |
| 737 // TODO(sync): crbug.com/137550. | 742 // TODO(sync): crbug.com/137550. |
| 738 // It's dangerous to configure types that have progress markers. Types with | 743 // It's dangerous to configure types that have progress markers. Types with |
| 739 // progress markers can trigger a MIGRATION_DONE response. We are not | 744 // progress markers can trigger a MIGRATION_DONE response. We are not |
| 740 // prepared to handle a migration during a configure, so we must ensure that | 745 // prepared to handle a migration during a configure, so we must ensure that |
| 741 // all our types_to_download actually contain no data before we sync them. | 746 // all our types_to_download actually contain no data before we sync them. |
| 742 // | 747 // |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 782 // - Types which have encountered a cryptographer error (crypto_types) are | 787 // - Types which have encountered a cryptographer error (crypto_types) are |
| 783 // unapplied (local state is purged but sync state is not). | 788 // unapplied (local state is purged but sync state is not). |
| 784 // - All other types not in the routing info (types just disabled) are deleted | 789 // - All other types not in the routing info (types just disabled) are deleted |
| 785 // from the directory. | 790 // from the directory. |
| 786 // - Everything else (enabled types and already disabled types) is not | 791 // - Everything else (enabled types and already disabled types) is not |
| 787 // touched. | 792 // touched. |
| 788 RequestConfigureSyncer(reason, | 793 RequestConfigureSyncer(reason, |
| 789 types_to_download, | 794 types_to_download, |
| 790 types_to_purge, | 795 types_to_purge, |
| 791 fatal_types, | 796 fatal_types, |
| 792 crypto_types, | 797 syncer::Union(crypto_types, clean_first_types), |
| 793 inactive_types, | 798 inactive_types, |
| 794 routing_info, | 799 routing_info, |
| 795 ready_task, | 800 ready_task, |
| 796 retry_callback); | 801 retry_callback); |
| 797 } | 802 } |
| 798 | 803 |
| 799 void SyncBackendHost::EnableEncryptEverything() { | 804 void SyncBackendHost::EnableEncryptEverything() { |
| 800 sync_thread_.message_loop()->PostTask(FROM_HERE, | 805 sync_thread_.message_loop()->PostTask(FROM_HERE, |
| 801 base::Bind(&SyncBackendHost::Core::DoEnableEncryptEverything, | 806 base::Bind(&SyncBackendHost::Core::DoEnableEncryptEverything, |
| 802 core_.get())); | 807 core_.get())); |
| (...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1737 DVLOG(1) << "Connection status changed: " | 1742 DVLOG(1) << "Connection status changed: " |
| 1738 << syncer::ConnectionStatusToString(status); | 1743 << syncer::ConnectionStatusToString(status); |
| 1739 frontend_->OnConnectionStatusChange(status); | 1744 frontend_->OnConnectionStatusChange(status); |
| 1740 } | 1745 } |
| 1741 | 1746 |
| 1742 #undef SDVLOG | 1747 #undef SDVLOG |
| 1743 | 1748 |
| 1744 #undef SLOG | 1749 #undef SLOG |
| 1745 | 1750 |
| 1746 } // namespace browser_sync | 1751 } // namespace browser_sync |
| OLD | NEW |