Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: chrome/browser/sync/glue/sync_backend_host.cc

Issue 7108067: [Sync] Ensure cryptographer ready before encrypting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Split bootstrap encryption and add ReloadNigori method Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 void SyncBackendHost::Core::HandleInitalizationCompletedOnFrontendLoop() { 971 void SyncBackendHost::Core::HandleInitalizationCompletedOnFrontendLoop() {
972 if (!host_) 972 if (!host_)
973 return; 973 return;
974 host_->HandleInitializationCompletedOnFrontendLoop(); 974 host_->HandleInitializationCompletedOnFrontendLoop();
975 } 975 }
976 976
977 void SyncBackendHost::HandleInitializationCompletedOnFrontendLoop() { 977 void SyncBackendHost::HandleInitializationCompletedOnFrontendLoop() {
978 if (!frontend_) 978 if (!frontend_)
979 return; 979 return;
980 syncapi_initialized_ = true; 980 syncapi_initialized_ = true;
981 // Now that the syncapi is intiialized, we can update the cryptographer (and
982 // can handle any ON_PASSPHRASE_REQUIRED notifications that may arise).
983 core_->syncapi()->ReloadNigori();
tim (not reviewing) 2011/06/14 01:32:58 Im trying to think of a better name for this... M
Nicolas Zea 2011/06/14 16:52:38 Done.
981 frontend_->OnBackendInitialized(); 984 frontend_->OnBackendInitialized();
982 } 985 }
983 986
984 bool SyncBackendHost::Core::IsCurrentThreadSafeForModel( 987 bool SyncBackendHost::Core::IsCurrentThreadSafeForModel(
985 syncable::ModelType model_type) { 988 syncable::ModelType model_type) {
986 base::AutoLock lock(host_->registrar_lock_); 989 base::AutoLock lock(host_->registrar_lock_);
987 990
988 browser_sync::ModelSafeRoutingInfo::const_iterator routing_it = 991 browser_sync::ModelSafeRoutingInfo::const_iterator routing_it =
989 host_->registrar_.routing_info.find(model_type); 992 host_->registrar_.routing_info.find(model_type);
990 if (routing_it == host_->registrar_.routing_info.end()) 993 if (routing_it == host_->registrar_.routing_info.end())
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 DCHECK_EQ(MessageLoop::current(), host_->core_thread_.message_loop()); 1203 DCHECK_EQ(MessageLoop::current(), host_->core_thread_.message_loop());
1201 syncapi_->GetJsBackend()->ProcessMessage(name, args, sender); 1204 syncapi_->GetJsBackend()->ProcessMessage(name, args, sender);
1202 } 1205 }
1203 1206
1204 void SyncBackendHost::Core::DeferNudgeForCleanup() { 1207 void SyncBackendHost::Core::DeferNudgeForCleanup() {
1205 DCHECK_EQ(MessageLoop::current(), host_->core_thread_.message_loop()); 1208 DCHECK_EQ(MessageLoop::current(), host_->core_thread_.message_loop());
1206 deferred_nudge_for_cleanup_requested_ = true; 1209 deferred_nudge_for_cleanup_requested_ = true;
1207 } 1210 }
1208 1211
1209 } // namespace browser_sync 1212 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698