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

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

Issue 6874018: make new syncer thread the default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Send for CR. Created 9 years, 8 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/browser/extensions/extension_service.h" 6 #include "chrome/browser/extensions/extension_service.h"
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/sync/glue/app_data_type_controller.h" 8 #include "chrome/browser/sync/glue/app_data_type_controller.h"
9 #include "chrome/browser/sync/glue/autofill_change_processor.h" 9 #include "chrome/browser/sync/glue/autofill_change_processor.h"
10 #include "chrome/browser/sync/glue/autofill_data_type_controller.h" 10 #include "chrome/browser/sync/glue/autofill_data_type_controller.h"
11 #include "chrome/browser/sync/glue/autofill_model_associator.h" 11 #include "chrome/browser/sync/glue/autofill_model_associator.h"
12 #include "chrome/browser/sync/glue/autofill_profile_change_processor.h" 12 #include "chrome/browser/sync/glue/autofill_profile_change_processor.h"
13 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h" 13 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h"
14 #include "chrome/browser/sync/glue/autofill_profile_model_associator.h" 14 #include "chrome/browser/sync/glue/autofill_profile_model_associator.h"
15 #include "chrome/browser/sync/glue/bookmark_change_processor.h" 15 #include "chrome/browser/sync/glue/bookmark_change_processor.h"
16 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h" 16 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h"
17 #include "chrome/browser/sync/glue/bookmark_model_associator.h" 17 #include "chrome/browser/sync/glue/bookmark_model_associator.h"
18 #include "chrome/browser/sync/glue/data_type_manager_impl.h" 18 #include "chrome/browser/sync/glue/data_type_manager_impl.h"
19 #include "chrome/browser/sync/glue/data_type_manager_impl2.h"
20 #include "chrome/browser/sync/glue/extension_change_processor.h" 19 #include "chrome/browser/sync/glue/extension_change_processor.h"
21 #include "chrome/browser/sync/glue/extension_data_type_controller.h" 20 #include "chrome/browser/sync/glue/extension_data_type_controller.h"
22 #include "chrome/browser/sync/glue/extension_model_associator.h" 21 #include "chrome/browser/sync/glue/extension_model_associator.h"
23 #include "chrome/browser/sync/glue/extension_sync_traits.h" 22 #include "chrome/browser/sync/glue/extension_sync_traits.h"
24 #include "chrome/browser/sync/glue/password_change_processor.h" 23 #include "chrome/browser/sync/glue/password_change_processor.h"
25 #include "chrome/browser/sync/glue/password_data_type_controller.h" 24 #include "chrome/browser/sync/glue/password_data_type_controller.h"
26 #include "chrome/browser/sync/glue/password_model_associator.h" 25 #include "chrome/browser/sync/glue/password_model_associator.h"
27 #include "chrome/browser/sync/glue/preference_change_processor.h" 26 #include "chrome/browser/sync/glue/preference_change_processor.h"
28 #include "chrome/browser/sync/glue/preference_data_type_controller.h" 27 #include "chrome/browser/sync/glue/preference_data_type_controller.h"
29 #include "chrome/browser/sync/glue/preference_model_associator.h" 28 #include "chrome/browser/sync/glue/preference_model_associator.h"
(...skipping 18 matching lines...) Expand all
48 using browser_sync::AutofillDataTypeController; 47 using browser_sync::AutofillDataTypeController;
49 using browser_sync::AutofillProfileDataTypeController; 48 using browser_sync::AutofillProfileDataTypeController;
50 using browser_sync::AutofillModelAssociator; 49 using browser_sync::AutofillModelAssociator;
51 using browser_sync::AutofillProfileModelAssociator; 50 using browser_sync::AutofillProfileModelAssociator;
52 using browser_sync::BookmarkChangeProcessor; 51 using browser_sync::BookmarkChangeProcessor;
53 using browser_sync::BookmarkDataTypeController; 52 using browser_sync::BookmarkDataTypeController;
54 using browser_sync::BookmarkModelAssociator; 53 using browser_sync::BookmarkModelAssociator;
55 using browser_sync::DataTypeController; 54 using browser_sync::DataTypeController;
56 using browser_sync::DataTypeManager; 55 using browser_sync::DataTypeManager;
57 using browser_sync::DataTypeManagerImpl; 56 using browser_sync::DataTypeManagerImpl;
58 using browser_sync::DataTypeManagerImpl2;
59 using browser_sync::ExtensionChangeProcessor; 57 using browser_sync::ExtensionChangeProcessor;
60 using browser_sync::ExtensionDataTypeController; 58 using browser_sync::ExtensionDataTypeController;
61 using browser_sync::ExtensionModelAssociator; 59 using browser_sync::ExtensionModelAssociator;
62 using browser_sync::PasswordChangeProcessor; 60 using browser_sync::PasswordChangeProcessor;
63 using browser_sync::PasswordDataTypeController; 61 using browser_sync::PasswordDataTypeController;
64 using browser_sync::PasswordModelAssociator; 62 using browser_sync::PasswordModelAssociator;
65 using browser_sync::PreferenceChangeProcessor; 63 using browser_sync::PreferenceChangeProcessor;
66 using browser_sync::PreferenceDataTypeController; 64 using browser_sync::PreferenceDataTypeController;
67 using browser_sync::PreferenceModelAssociator; 65 using browser_sync::PreferenceModelAssociator;
68 using browser_sync::SessionChangeProcessor; 66 using browser_sync::SessionChangeProcessor;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 if (!command_line_->HasSwitch(switches::kDisableSyncAutofillProfile)) { 152 if (!command_line_->HasSwitch(switches::kDisableSyncAutofillProfile)) {
155 pss->RegisterDataTypeController(new AutofillProfileDataTypeController( 153 pss->RegisterDataTypeController(new AutofillProfileDataTypeController(
156 this, profile_, pss)); 154 this, profile_, pss));
157 } 155 }
158 return pss; 156 return pss;
159 } 157 }
160 158
161 DataTypeManager* ProfileSyncFactoryImpl::CreateDataTypeManager( 159 DataTypeManager* ProfileSyncFactoryImpl::CreateDataTypeManager(
162 SyncBackendHost* backend, 160 SyncBackendHost* backend,
163 const DataTypeController::TypeMap& controllers) { 161 const DataTypeController::TypeMap& controllers) {
164 if (command_line_->HasSwitch(switches::kNewSyncerThread)) 162 return new DataTypeManagerImpl(backend, controllers);
165 return new DataTypeManagerImpl2(backend, controllers);
166 else
167 return new DataTypeManagerImpl(backend, controllers);
168 } 163 }
169 164
170 ProfileSyncFactory::SyncComponents 165 ProfileSyncFactory::SyncComponents
171 ProfileSyncFactoryImpl::CreateAppSyncComponents( 166 ProfileSyncFactoryImpl::CreateAppSyncComponents(
172 ProfileSyncService* profile_sync_service, 167 ProfileSyncService* profile_sync_service,
173 UnrecoverableErrorHandler* error_handler) { 168 UnrecoverableErrorHandler* error_handler) {
174 browser_sync::ExtensionSyncTraits traits = browser_sync::GetAppSyncTraits(); 169 browser_sync::ExtensionSyncTraits traits = browser_sync::GetAppSyncTraits();
175 // For now we simply use extensions sync objects with the app sync 170 // For now we simply use extensions sync objects with the app sync
176 // traits. If apps become more than simply extensions, we may have 171 // traits. If apps become more than simply extensions, we may have
177 // to write our own apps model associator and/or change processor. 172 // to write our own apps model associator and/or change processor.
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 ProfileSyncFactory::SyncComponents 307 ProfileSyncFactory::SyncComponents
313 ProfileSyncFactoryImpl::CreateSessionSyncComponents( 308 ProfileSyncFactoryImpl::CreateSessionSyncComponents(
314 ProfileSyncService* profile_sync_service, 309 ProfileSyncService* profile_sync_service,
315 UnrecoverableErrorHandler* error_handler) { 310 UnrecoverableErrorHandler* error_handler) {
316 SessionModelAssociator* model_associator = 311 SessionModelAssociator* model_associator =
317 new SessionModelAssociator(profile_sync_service); 312 new SessionModelAssociator(profile_sync_service);
318 SessionChangeProcessor* change_processor = 313 SessionChangeProcessor* change_processor =
319 new SessionChangeProcessor(error_handler, model_associator); 314 new SessionChangeProcessor(error_handler, model_associator);
320 return SyncComponents(model_associator, change_processor); 315 return SyncComponents(model_associator, change_processor);
321 } 316 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698