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

Unified Diff: chrome/browser/sync/profile_sync_service.cc

Issue 317453002: sync: cut a few profile deps from DataTypeControllers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move OnUserShareReady Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/profile_sync_service.cc
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index b4ce8b1c1543127e992b9f823b2d8275c40db8df..2d11c213714b7a65a46c7d684ef4b20d1fe74e4c 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -1005,10 +1005,8 @@ void ProfileSyncService::UpdateBackendInitUMA(bool success) {
}
void ProfileSyncService::PostBackendInitialization() {
- if (backend_mode_ == BACKUP || backend_mode_ == ROLLBACK) {
- ConfigureDataTypeManager();
- return;
- }
+ // Never get here for backup / restore.
+ DCHECK_EQ(backend_mode_, SYNC);
if (protocol_event_observers_.might_have_observers()) {
backend_->RequestBufferedProtocolEventsAndEnableForwarding();
@@ -1084,7 +1082,18 @@ void ProfileSyncService::OnBackendInitialized(
sync_js_controller_.AttachJsBackend(js_backend);
debug_info_listener_ = debug_info_listener;
- PostBackendInitialization();
+ // Give the DataTypeControllers a handle to the now initialized backend
+ // as a UserShare.
+ for (DataTypeController::TypeMap::iterator it =
+ directory_data_type_controllers_.begin();
+ it != directory_data_type_controllers_.end(); ++it) {
+ it->second->OnUserShareReady(GetUserShare());
+ }
+
+ if (backend_mode_ == BACKUP || backend_mode_ == ROLLBACK)
+ ConfigureDataTypeManager();
+ else
+ PostBackendInitialization();
}
void ProfileSyncService::OnSyncCycleCompleted() {

Powered by Google App Engine
This is Rietveld 408576698