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

Side by Side Diff: chrome/browser/sync/profile_sync_service.cc

Issue 1314903004: Sync: Refactoring DataTypeController to make the design shareable with USS datatypes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing build on Android Created 5 years, 3 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
OLDNEW
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 "chrome/browser/sync/profile_sync_service.h" 5 #include "chrome/browser/sync/profile_sync_service.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 DCHECK(signin_client); 1148 DCHECK(signin_client);
1149 std::string signin_scoped_device_id = 1149 std::string signin_scoped_device_id =
1150 signin_client->GetSigninScopedDeviceId(); 1150 signin_client->GetSigninScopedDeviceId();
1151 1151
1152 // Initialize local device info. 1152 // Initialize local device info.
1153 local_device_->Initialize(cache_guid, signin_scoped_device_id); 1153 local_device_->Initialize(cache_guid, signin_scoped_device_id);
1154 1154
1155 DVLOG(1) << "Setting preferred types for non-blocking DTM"; 1155 DVLOG(1) << "Setting preferred types for non-blocking DTM";
1156 non_blocking_data_type_manager_.SetPreferredTypes(GetPreferredDataTypes()); 1156 non_blocking_data_type_manager_.SetPreferredTypes(GetPreferredDataTypes());
1157 1157
1158 // Give the DataTypeControllers a handle to the now initialized backend
1159 // as a UserShare.
1160 for (DataTypeController::TypeMap::iterator it =
1161 directory_data_type_controllers_.begin();
1162 it != directory_data_type_controllers_.end(); ++it) {
1163 it->second->OnUserShareReady(GetUserShare());
1164 }
1165
1166 if (backend_mode_ == BACKUP || backend_mode_ == ROLLBACK) 1158 if (backend_mode_ == BACKUP || backend_mode_ == ROLLBACK)
1167 ConfigureDataTypeManager(); 1159 ConfigureDataTypeManager();
1168 else 1160 else
1169 PostBackendInitialization(); 1161 PostBackendInitialization();
1170 } 1162 }
1171 1163
1172 void ProfileSyncService::OnSyncCycleCompleted() { 1164 void ProfileSyncService::OnSyncCycleCompleted() {
1173 UpdateLastSyncedTime(); 1165 UpdateLastSyncedTime();
1174 if (IsDataTypeControllerRunning(syncer::SESSIONS)) { 1166 if (IsDataTypeControllerRunning(syncer::SESSIONS)) {
1175 // Trigger garbage collection of old sessions now that we've downloaded 1167 // Trigger garbage collection of old sessions now that we've downloaded
(...skipping 1624 matching lines...) Expand 10 before | Expand all | Expand 10 after
2800 } 2792 }
2801 2793
2802 std::string ProfileSyncService::unrecoverable_error_message() const { 2794 std::string ProfileSyncService::unrecoverable_error_message() const {
2803 return unrecoverable_error_message_; 2795 return unrecoverable_error_message_;
2804 } 2796 }
2805 2797
2806 tracked_objects::Location ProfileSyncService::unrecoverable_error_location() 2798 tracked_objects::Location ProfileSyncService::unrecoverable_error_location()
2807 const { 2799 const {
2808 return unrecoverable_error_location_; 2800 return unrecoverable_error_location_;
2809 } 2801 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698