OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 SyncBackendHost::~SyncBackendHost() { | 96 SyncBackendHost::~SyncBackendHost() { |
97 DCHECK(!core_ && !frontend_) << "Must call Shutdown before destructor."; | 97 DCHECK(!core_ && !frontend_) << "Must call Shutdown before destructor."; |
98 DCHECK(!registrar_.get()); | 98 DCHECK(!registrar_.get()); |
99 } | 99 } |
100 | 100 |
101 void SyncBackendHost::Initialize( | 101 void SyncBackendHost::Initialize( |
102 SyncFrontend* frontend, | 102 SyncFrontend* frontend, |
103 const WeakHandle<JsEventHandler>& event_handler, | 103 const WeakHandle<JsEventHandler>& event_handler, |
104 const GURL& sync_service_url, | 104 const GURL& sync_service_url, |
105 const syncable::ModelTypeSet& initial_types, | 105 syncable::ModelEnumSet initial_types, |
106 const SyncCredentials& credentials, | 106 const SyncCredentials& credentials, |
107 bool delete_sync_data_folder) { | 107 bool delete_sync_data_folder) { |
108 if (!sync_thread_.Start()) | 108 if (!sync_thread_.Start()) |
109 return; | 109 return; |
110 | 110 |
111 frontend_ = frontend; | 111 frontend_ = frontend; |
112 DCHECK(frontend); | 112 DCHECK(frontend); |
113 | 113 |
114 syncable::ModelTypeSet initial_types_with_nigori(initial_types); | 114 syncable::ModelEnumSet initial_types_with_nigori(initial_types); |
115 CHECK(sync_prefs_.get()); | 115 CHECK(sync_prefs_.get()); |
116 if (sync_prefs_->HasSyncSetupCompleted()) { | 116 if (sync_prefs_->HasSyncSetupCompleted()) { |
117 initial_types_with_nigori.insert(syncable::NIGORI); | 117 initial_types_with_nigori.Put(syncable::NIGORI); |
118 } | 118 } |
119 | 119 |
120 registrar_.reset(new SyncBackendRegistrar(initial_types_with_nigori, | 120 registrar_.reset(new SyncBackendRegistrar(initial_types_with_nigori, |
121 name_, | 121 name_, |
122 profile_, | 122 profile_, |
123 sync_thread_.message_loop())); | 123 sync_thread_.message_loop())); |
124 initialization_state_ = CREATING_SYNC_MANAGER; | 124 initialization_state_ = CREATING_SYNC_MANAGER; |
125 InitCore(Core::DoInitializeOptions( | 125 InitCore(Core::DoInitializeOptions( |
126 sync_thread_.message_loop(), | 126 sync_thread_.message_loop(), |
127 registrar_.get(), | 127 registrar_.get(), |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 base::ThreadRestrictions::ScopedAllowIO allow_io; | 240 base::ThreadRestrictions::ScopedAllowIO allow_io; |
241 sync_thread_.Stop(); | 241 sync_thread_.Stop(); |
242 } | 242 } |
243 | 243 |
244 registrar_.reset(); | 244 registrar_.reset(); |
245 frontend_ = NULL; | 245 frontend_ = NULL; |
246 core_ = NULL; // Releases reference to core_. | 246 core_ = NULL; // Releases reference to core_. |
247 } | 247 } |
248 | 248 |
249 void SyncBackendHost::ConfigureDataTypes( | 249 void SyncBackendHost::ConfigureDataTypes( |
250 const syncable::ModelTypeSet& types_to_add, | 250 syncable::ModelEnumSet types_to_add, |
251 const syncable::ModelTypeSet& types_to_remove, | 251 syncable::ModelEnumSet types_to_remove, |
252 sync_api::ConfigureReason reason, | 252 sync_api::ConfigureReason reason, |
253 base::Callback<void(syncable::ModelEnumSet)> ready_task, | 253 base::Callback<void(syncable::ModelEnumSet)> ready_task, |
254 bool enable_nigori) { | 254 bool enable_nigori) { |
255 syncable::ModelTypeSet types_to_add_with_nigori = types_to_add; | 255 syncable::ModelEnumSet types_to_add_with_nigori = types_to_add; |
256 syncable::ModelTypeSet types_to_remove_with_nigori = types_to_remove; | 256 syncable::ModelEnumSet types_to_remove_with_nigori = types_to_remove; |
257 if (enable_nigori) { | 257 if (enable_nigori) { |
258 types_to_add_with_nigori.insert(syncable::NIGORI); | 258 types_to_add_with_nigori.Put(syncable::NIGORI); |
259 types_to_remove_with_nigori.erase(syncable::NIGORI); | 259 types_to_remove_with_nigori.Remove(syncable::NIGORI); |
260 } else { | 260 } else { |
261 types_to_add_with_nigori.erase(syncable::NIGORI); | 261 types_to_add_with_nigori.Remove(syncable::NIGORI); |
262 types_to_remove_with_nigori.insert(syncable::NIGORI); | 262 types_to_remove_with_nigori.Put(syncable::NIGORI); |
263 } | 263 } |
264 // Only one configure is allowed at a time. | 264 // Only one configure is allowed at a time. |
265 DCHECK(!pending_config_mode_state_.get()); | 265 DCHECK(!pending_config_mode_state_.get()); |
266 DCHECK(!pending_download_state_.get()); | 266 DCHECK(!pending_download_state_.get()); |
267 DCHECK_GT(initialization_state_, NOT_INITIALIZED); | 267 DCHECK_GT(initialization_state_, NOT_INITIALIZED); |
268 | 268 |
269 pending_config_mode_state_.reset(new PendingConfigureDataTypesState()); | 269 pending_config_mode_state_.reset(new PendingConfigureDataTypesState()); |
270 pending_config_mode_state_->ready_task = ready_task; | 270 pending_config_mode_state_->ready_task = ready_task; |
271 pending_config_mode_state_->types_to_add = types_to_add_with_nigori; | 271 pending_config_mode_state_->types_to_add = types_to_add_with_nigori; |
272 pending_config_mode_state_->added_types = | 272 pending_config_mode_state_->added_types = |
273 registrar_->ConfigureDataTypes(types_to_add_with_nigori, | 273 registrar_->ConfigureDataTypes(types_to_add_with_nigori, |
274 types_to_remove_with_nigori); | 274 types_to_remove_with_nigori); |
275 pending_config_mode_state_->reason = reason; | 275 pending_config_mode_state_->reason = reason; |
276 | 276 |
277 // Cleanup disabled types before starting configuration so that | 277 // Cleanup disabled types before starting configuration so that |
278 // callers can assume that the data types are cleaned up once | 278 // callers can assume that the data types are cleaned up once |
279 // configuration is done. | 279 // configuration is done. |
280 if (!types_to_remove_with_nigori.empty()) { | 280 if (!types_to_remove_with_nigori.Empty()) { |
281 sync_thread_.message_loop()->PostTask( | 281 sync_thread_.message_loop()->PostTask( |
282 FROM_HERE, | 282 FROM_HERE, |
283 base::Bind(&SyncBackendHost::Core::DoRequestCleanupDisabledTypes, | 283 base::Bind(&SyncBackendHost::Core::DoRequestCleanupDisabledTypes, |
284 core_.get())); | 284 core_.get())); |
285 } | 285 } |
286 | 286 |
287 StartConfiguration( | 287 StartConfiguration( |
288 base::Bind(&SyncBackendHost::Core::FinishConfigureDataTypes, | 288 base::Bind(&SyncBackendHost::Core::FinishConfigureDataTypes, |
289 core_.get())); | 289 core_.get())); |
290 } | 290 } |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 | 475 |
476 void SyncBackendHost::Core::OnClearServerDataSucceeded() { | 476 void SyncBackendHost::Core::OnClearServerDataSucceeded() { |
477 if (!sync_loop_) | 477 if (!sync_loop_) |
478 return; | 478 return; |
479 DCHECK_EQ(MessageLoop::current(), sync_loop_); | 479 DCHECK_EQ(MessageLoop::current(), sync_loop_); |
480 host_->frontend_loop_->PostTask(FROM_HERE, base::Bind( | 480 host_->frontend_loop_->PostTask(FROM_HERE, base::Bind( |
481 &Core::HandleClearServerDataSucceededOnFrontendLoop, this)); | 481 &Core::HandleClearServerDataSucceededOnFrontendLoop, this)); |
482 } | 482 } |
483 | 483 |
484 void SyncBackendHost::Core::OnEncryptedTypesChanged( | 484 void SyncBackendHost::Core::OnEncryptedTypesChanged( |
485 const syncable::ModelTypeSet& encrypted_types, | 485 syncable::ModelEnumSet encrypted_types, |
486 bool encrypt_everything) { | 486 bool encrypt_everything) { |
487 if (!sync_loop_) | 487 if (!sync_loop_) |
488 return; | 488 return; |
489 DCHECK_EQ(MessageLoop::current(), sync_loop_); | 489 DCHECK_EQ(MessageLoop::current(), sync_loop_); |
490 // NOTE: We're in a transaction. | 490 // NOTE: We're in a transaction. |
491 host_->frontend_loop_->PostTask( | 491 host_->frontend_loop_->PostTask( |
492 FROM_HERE, | 492 FROM_HERE, |
493 base::Bind(&Core::NotifyEncryptedTypesChanged, this, | 493 base::Bind(&Core::NotifyEncryptedTypesChanged, this, |
494 encrypted_types, encrypt_everything)); | 494 encrypted_types, encrypt_everything)); |
495 } | 495 } |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 return; | 787 return; |
788 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 788 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
789 TokenAvailableDetails details(GaiaConstants::kSyncService, token); | 789 TokenAvailableDetails details(GaiaConstants::kSyncService, token); |
790 content::NotificationService::current()->Notify( | 790 content::NotificationService::current()->Notify( |
791 chrome::NOTIFICATION_TOKEN_UPDATED, | 791 chrome::NOTIFICATION_TOKEN_UPDATED, |
792 content::Source<Profile>(host_->profile_), | 792 content::Source<Profile>(host_->profile_), |
793 content::Details<const TokenAvailableDetails>(&details)); | 793 content::Details<const TokenAvailableDetails>(&details)); |
794 } | 794 } |
795 | 795 |
796 void SyncBackendHost::Core::NotifyEncryptedTypesChanged( | 796 void SyncBackendHost::Core::NotifyEncryptedTypesChanged( |
797 const syncable::ModelTypeSet& encrypted_types, | 797 syncable::ModelEnumSet encrypted_types, |
798 bool encrypt_everything) { | 798 bool encrypt_everything) { |
799 if (!host_) | 799 if (!host_) |
800 return; | 800 return; |
801 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); | 801 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); |
802 host_->frontend_->OnEncryptedTypesChanged( | 802 host_->frontend_->OnEncryptedTypesChanged( |
803 encrypted_types, encrypt_everything); | 803 encrypted_types, encrypt_everything); |
804 } | 804 } |
805 | 805 |
806 void SyncBackendHost::Core::NotifyEncryptionComplete() { | 806 void SyncBackendHost::Core::NotifyEncryptionComplete() { |
807 if (!host_) | 807 if (!host_) |
808 return; | 808 return; |
809 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); | 809 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); |
810 host_->frontend_->OnEncryptionComplete(); | 810 host_->frontend_->OnEncryptionComplete(); |
811 } | 811 } |
812 | 812 |
813 void SyncBackendHost::Core::HandleSyncCycleCompletedOnFrontendLoop( | 813 void SyncBackendHost::Core::HandleSyncCycleCompletedOnFrontendLoop( |
814 SyncSessionSnapshot* snapshot) { | 814 SyncSessionSnapshot* snapshot) { |
815 if (!host_ || !host_->frontend_) | 815 if (!host_ || !host_->frontend_) |
816 return; | 816 return; |
817 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); | 817 DCHECK_EQ(MessageLoop::current(), host_->frontend_loop_); |
818 | 818 |
819 host_->last_snapshot_.reset(snapshot); | 819 host_->last_snapshot_.reset(snapshot); |
820 | 820 |
821 SVLOG(1) << "Got snapshot " << snapshot->ToString(); | 821 SVLOG(1) << "Got snapshot " << snapshot->ToString(); |
822 | 822 |
823 const syncable::ModelEnumSet to_migrate = | 823 const syncable::ModelEnumSet to_migrate = |
824 snapshot->syncer_status.types_needing_local_migration; | 824 snapshot->syncer_status.types_needing_local_migration; |
825 if (!to_migrate.Empty()) | 825 if (!to_migrate.Empty()) |
826 host_->frontend_->OnMigrationNeededForTypes( | 826 host_->frontend_->OnMigrationNeededForTypes(to_migrate); |
827 syncable::ModelEnumSetToSet(to_migrate)); | |
828 | 827 |
829 // Process any changes to the datatypes we're syncing. | 828 // Process any changes to the datatypes we're syncing. |
830 // TODO(sync): add support for removing types. | 829 // TODO(sync): add support for removing types. |
831 if (host_->initialized()) | 830 if (host_->initialized()) |
832 host_->AddExperimentalTypes(); | 831 host_->AddExperimentalTypes(); |
833 | 832 |
834 // If we are waiting for a configuration change, check here to see | 833 // If we are waiting for a configuration change, check here to see |
835 // if this sync cycle has initialized all of the types we've been | 834 // if this sync cycle has initialized all of the types we've been |
836 // waiting for. | 835 // waiting for. |
837 if (host_->pending_download_state_.get()) { | 836 if (host_->pending_download_state_.get()) { |
838 scoped_ptr<PendingConfigureDataTypesState> state( | 837 scoped_ptr<PendingConfigureDataTypesState> state( |
839 host_->pending_download_state_.release()); | 838 host_->pending_download_state_.release()); |
840 const syncable::ModelEnumSet types_to_add = | 839 const syncable::ModelEnumSet types_to_add = state->types_to_add; |
841 syncable::ModelTypeSetToEnumSet(state->types_to_add); | 840 const syncable::ModelEnumSet added_types = state->added_types; |
842 const syncable::ModelEnumSet added_types = | |
843 syncable::ModelTypeSetToEnumSet(state->added_types); | |
844 DCHECK(types_to_add.HasAll(added_types)); | 841 DCHECK(types_to_add.HasAll(added_types)); |
845 const syncable::ModelEnumSet initial_sync_ended = | 842 const syncable::ModelEnumSet initial_sync_ended = |
846 snapshot->initial_sync_ended; | 843 snapshot->initial_sync_ended; |
847 const syncable::ModelEnumSet failed_configuration_types = | 844 const syncable::ModelEnumSet failed_configuration_types = |
848 Difference(added_types, initial_sync_ended); | 845 Difference(added_types, initial_sync_ended); |
849 SVLOG(1) | 846 SVLOG(1) |
850 << "Added types: " | 847 << "Added types: " |
851 << syncable::ModelEnumSetToString(added_types) | 848 << syncable::ModelEnumSetToString(added_types) |
852 << ", configured types: " | 849 << ", configured types: " |
853 << syncable::ModelEnumSetToString(initial_sync_ended) | 850 << syncable::ModelEnumSetToString(initial_sync_ended) |
(...skipping 25 matching lines...) Expand all Loading... |
879 return; | 876 return; |
880 host_->frontend_->OnClearServerDataFailed(); | 877 host_->frontend_->OnClearServerDataFailed(); |
881 } | 878 } |
882 | 879 |
883 void SyncBackendHost::Core::FinishConfigureDataTypesOnFrontendLoop() { | 880 void SyncBackendHost::Core::FinishConfigureDataTypesOnFrontendLoop() { |
884 host_->FinishConfigureDataTypesOnFrontendLoop(); | 881 host_->FinishConfigureDataTypesOnFrontendLoop(); |
885 } | 882 } |
886 | 883 |
887 void SyncBackendHost::AddExperimentalTypes() { | 884 void SyncBackendHost::AddExperimentalTypes() { |
888 CHECK(initialized()); | 885 CHECK(initialized()); |
889 syncable::ModelTypeSet to_add; | 886 syncable::ModelEnumSet to_add; |
890 if (core_->sync_manager()->ReceivedExperimentalTypes(&to_add)) | 887 if (core_->sync_manager()->ReceivedExperimentalTypes(&to_add)) |
891 frontend_->OnDataTypesChanged(to_add); | 888 frontend_->OnDataTypesChanged(to_add); |
892 } | 889 } |
893 | 890 |
894 void SyncBackendHost::HandleInitializationCompletedOnFrontendLoop( | 891 void SyncBackendHost::HandleInitializationCompletedOnFrontendLoop( |
895 const WeakHandle<JsBackend>& js_backend, bool success) { | 892 const WeakHandle<JsBackend>& js_backend, bool success) { |
896 DCHECK_NE(NOT_ATTEMPTED, initialization_state_); | 893 DCHECK_NE(NOT_ATTEMPTED, initialization_state_); |
897 if (!frontend_) | 894 if (!frontend_) |
898 return; | 895 return; |
899 | 896 |
(...skipping 15 matching lines...) Expand all Loading... |
915 if (sync_prefs_->HasSyncSetupCompleted() && | 912 if (sync_prefs_->HasSyncSetupCompleted() && |
916 initialization_state_ < DOWNLOADING_NIGORI) { | 913 initialization_state_ < DOWNLOADING_NIGORI) { |
917 initialization_state_ = DOWNLOADING_NIGORI; | 914 initialization_state_ = DOWNLOADING_NIGORI; |
918 } | 915 } |
919 | 916 |
920 // Run initialization state machine. | 917 // Run initialization state machine. |
921 switch (initialization_state_) { | 918 switch (initialization_state_) { |
922 case NOT_INITIALIZED: | 919 case NOT_INITIALIZED: |
923 initialization_state_ = DOWNLOADING_NIGORI; | 920 initialization_state_ = DOWNLOADING_NIGORI; |
924 ConfigureDataTypes( | 921 ConfigureDataTypes( |
925 syncable::ModelTypeSet(), | 922 syncable::ModelEnumSet(), |
926 syncable::ModelTypeSet(), | 923 syncable::ModelEnumSet(), |
927 sync_api::CONFIGURE_REASON_NEW_CLIENT, | 924 sync_api::CONFIGURE_REASON_NEW_CLIENT, |
928 // Calls back into this function. | 925 // Calls back into this function. |
929 base::Bind( | 926 base::Bind( |
930 &SyncBackendHost::Core:: | 927 &SyncBackendHost::Core:: |
931 HandleNigoriConfigurationCompletedOnFrontendLoop, | 928 HandleNigoriConfigurationCompletedOnFrontendLoop, |
932 core_.get(), js_backend), | 929 core_.get(), js_backend), |
933 true); | 930 true); |
934 break; | 931 break; |
935 case DOWNLOADING_NIGORI: | 932 case DOWNLOADING_NIGORI: |
936 initialization_state_ = REFRESHING_ENCRYPTION; | 933 initialization_state_ = REFRESHING_ENCRYPTION; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 // | 967 // |
971 // In the case of additions, on the next sync cycle, the syncer should | 968 // In the case of additions, on the next sync cycle, the syncer should |
972 // notice that the routing info has changed and start the process of | 969 // notice that the routing info has changed and start the process of |
973 // downloading updates for newly added data types. Once this is | 970 // downloading updates for newly added data types. Once this is |
974 // complete, the configure_state_.ready_task_ is run via an | 971 // complete, the configure_state_.ready_task_ is run via an |
975 // OnInitializationComplete notification. | 972 // OnInitializationComplete notification. |
976 | 973 |
977 SVLOG(1) << "Syncer in config mode. SBH executing " | 974 SVLOG(1) << "Syncer in config mode. SBH executing " |
978 << "FinishConfigureDataTypesOnFrontendLoop"; | 975 << "FinishConfigureDataTypesOnFrontendLoop"; |
979 | 976 |
980 if (pending_config_mode_state_->added_types.empty() && | 977 if (pending_config_mode_state_->added_types.Empty() && |
981 !core_->sync_manager()->InitialSyncEndedForAllEnabledTypes()) { | 978 !core_->sync_manager()->InitialSyncEndedForAllEnabledTypes()) { |
982 | 979 |
983 syncable::ModelTypeSet enabled_types; | 980 syncable::ModelEnumSet enabled_types; |
984 ModelSafeRoutingInfo routing_info; | 981 ModelSafeRoutingInfo routing_info; |
985 registrar_->GetModelSafeRoutingInfo(&routing_info); | 982 registrar_->GetModelSafeRoutingInfo(&routing_info); |
986 for (ModelSafeRoutingInfo::const_iterator i = routing_info.begin(); | 983 for (ModelSafeRoutingInfo::const_iterator i = routing_info.begin(); |
987 i != routing_info.end(); ++i) { | 984 i != routing_info.end(); ++i) { |
988 enabled_types.insert(i->first); | 985 enabled_types.Put(i->first); |
989 } | 986 } |
990 | 987 |
991 // TODO(tim): Log / UMA / count this somehow? | 988 // TODO(tim): Log / UMA / count this somehow? |
992 // Add only the types with empty progress markers. Note: it is possible | 989 // Add only the types with empty progress markers. Note: it is possible |
993 // that some types have their initial_sync_ended be false but with non | 990 // that some types have their initial_sync_ended be false but with non |
994 // empty progress marker. Which is ok as the rest of the changes would | 991 // empty progress marker. Which is ok as the rest of the changes would |
995 // be downloaded on a regular nudge and initial_sync_ended should be set | 992 // be downloaded on a regular nudge and initial_sync_ended should be set |
996 // to true. However this is a very corner case. So it is not explicitly | 993 // to true. However this is a very corner case. So it is not explicitly |
997 // handled. | 994 // handled. |
998 pending_config_mode_state_->added_types = | 995 pending_config_mode_state_->added_types = |
999 sync_api::GetTypesWithEmptyProgressMarkerToken(enabled_types, | 996 sync_api::GetTypesWithEmptyProgressMarkerToken(enabled_types, |
1000 GetUserShare()); | 997 GetUserShare()); |
1001 } | 998 } |
1002 | 999 |
1003 // If we've added types, we always want to request a nudge/config (even if | 1000 // If we've added types, we always want to request a nudge/config (even if |
1004 // the initial sync is ended), in case we could not decrypt the data. | 1001 // the initial sync is ended), in case we could not decrypt the data. |
1005 if (pending_config_mode_state_->added_types.empty()) { | 1002 if (pending_config_mode_state_->added_types.Empty()) { |
1006 SVLOG(1) << "No new types added; calling ready_task directly"; | 1003 SVLOG(1) << "No new types added; calling ready_task directly"; |
1007 // No new types - just notify the caller that the types are available. | 1004 // No new types - just notify the caller that the types are available. |
1008 const syncable::ModelEnumSet failed_configuration_types; | 1005 const syncable::ModelEnumSet failed_configuration_types; |
1009 pending_config_mode_state_->ready_task.Run(failed_configuration_types); | 1006 pending_config_mode_state_->ready_task.Run(failed_configuration_types); |
1010 } else { | 1007 } else { |
1011 pending_download_state_.reset(pending_config_mode_state_.release()); | 1008 pending_download_state_.reset(pending_config_mode_state_.release()); |
1012 | 1009 |
1013 // Always configure nigori if it's enabled. | 1010 // Always configure nigori if it's enabled. |
1014 syncable::ModelEnumSet types_to_config = | 1011 syncable::ModelEnumSet types_to_config = |
1015 syncable::ModelTypeSetToEnumSet( | 1012 pending_download_state_->added_types; |
1016 pending_download_state_->added_types); | |
1017 if (IsNigoriEnabled()) { | 1013 if (IsNigoriEnabled()) { |
1018 // Note: Nigori is the only type that gets added with a nonempty | 1014 // Note: Nigori is the only type that gets added with a nonempty |
1019 // progress marker during config. If the server returns a migration | 1015 // progress marker during config. If the server returns a migration |
1020 // error then we will go into unrecoverable error. We dont handle it | 1016 // error then we will go into unrecoverable error. We dont handle it |
1021 // explicitly because server might help us out here by not sending a | 1017 // explicitly because server might help us out here by not sending a |
1022 // migraiton error for nigori during config. | 1018 // migraiton error for nigori during config. |
1023 types_to_config.Put(syncable::NIGORI); | 1019 types_to_config.Put(syncable::NIGORI); |
1024 } | 1020 } |
1025 SVLOG(1) << "Types " | 1021 SVLOG(1) << "Types " |
1026 << syncable::ModelEnumSetToString(types_to_config) | 1022 << syncable::ModelEnumSetToString(types_to_config) |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 FROM_HERE, | 1073 FROM_HERE, |
1078 base::Bind(&SyncBackendHost::Core::DoRefreshEncryption, | 1074 base::Bind(&SyncBackendHost::Core::DoRefreshEncryption, |
1079 core_.get(), sync_thread_done_callback)); | 1075 core_.get(), sync_thread_done_callback)); |
1080 } | 1076 } |
1081 | 1077 |
1082 #undef SVLOG | 1078 #undef SVLOG |
1083 | 1079 |
1084 #undef SLOG | 1080 #undef SLOG |
1085 | 1081 |
1086 } // namespace browser_sync | 1082 } // namespace browser_sync |
OLD | NEW |