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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 void SyncBackendHost::Core::HandleInitalizationCompletedOnFrontendLoop() { | 972 void SyncBackendHost::Core::HandleInitalizationCompletedOnFrontendLoop() { |
973 if (!host_) | 973 if (!host_) |
974 return; | 974 return; |
975 host_->HandleInitializationCompletedOnFrontendLoop(); | 975 host_->HandleInitializationCompletedOnFrontendLoop(); |
976 } | 976 } |
977 | 977 |
978 void SyncBackendHost::HandleInitializationCompletedOnFrontendLoop() { | 978 void SyncBackendHost::HandleInitializationCompletedOnFrontendLoop() { |
979 if (!frontend_) | 979 if (!frontend_) |
980 return; | 980 return; |
981 syncapi_initialized_ = true; | 981 syncapi_initialized_ = true; |
| 982 // Now that the syncapi is initialized, we can update the cryptographer (and |
| 983 // can handle any ON_PASSPHRASE_REQUIRED notifications that may arise). |
| 984 core_->syncapi()->RefreshEncryption(); |
982 frontend_->OnBackendInitialized(); | 985 frontend_->OnBackendInitialized(); |
983 } | 986 } |
984 | 987 |
985 bool SyncBackendHost::Core::IsCurrentThreadSafeForModel( | 988 bool SyncBackendHost::Core::IsCurrentThreadSafeForModel( |
986 syncable::ModelType model_type) { | 989 syncable::ModelType model_type) { |
987 base::AutoLock lock(host_->registrar_lock_); | 990 base::AutoLock lock(host_->registrar_lock_); |
988 | 991 |
989 browser_sync::ModelSafeRoutingInfo::const_iterator routing_it = | 992 browser_sync::ModelSafeRoutingInfo::const_iterator routing_it = |
990 host_->registrar_.routing_info.find(model_type); | 993 host_->registrar_.routing_info.find(model_type); |
991 if (routing_it == host_->registrar_.routing_info.end()) | 994 if (routing_it == host_->registrar_.routing_info.end()) |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1201 DCHECK_EQ(MessageLoop::current(), host_->sync_thread_.message_loop()); | 1204 DCHECK_EQ(MessageLoop::current(), host_->sync_thread_.message_loop()); |
1202 syncapi_->GetJsBackend()->ProcessMessage(name, args, sender); | 1205 syncapi_->GetJsBackend()->ProcessMessage(name, args, sender); |
1203 } | 1206 } |
1204 | 1207 |
1205 void SyncBackendHost::Core::DeferNudgeForCleanup() { | 1208 void SyncBackendHost::Core::DeferNudgeForCleanup() { |
1206 DCHECK_EQ(MessageLoop::current(), host_->sync_thread_.message_loop()); | 1209 DCHECK_EQ(MessageLoop::current(), host_->sync_thread_.message_loop()); |
1207 deferred_nudge_for_cleanup_requested_ = true; | 1210 deferred_nudge_for_cleanup_requested_ = true; |
1208 } | 1211 } |
1209 | 1212 |
1210 } // namespace browser_sync | 1213 } // namespace browser_sync |
OLD | NEW |