OLD | NEW |
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 <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
19 #include "base/message_loop.h" | 19 #include "base/message_loop.h" |
20 #include "base/metrics/histogram.h" | 20 #include "base/metrics/histogram.h" |
21 #include "base/string16.h" | 21 #include "base/string16.h" |
22 #include "base/stringprintf.h" | 22 #include "base/stringprintf.h" |
23 #include "base/threading/thread_restrictions.h" | 23 #include "base/threading/thread_restrictions.h" |
24 #include "build/build_config.h" | 24 #include "build/build_config.h" |
25 #include "chrome/browser/about_flags.h" | 25 #include "chrome/browser/about_flags.h" |
26 #include "chrome/browser/browser_process.h" | 26 #include "chrome/browser/browser_process.h" |
27 #include "chrome/browser/defaults.h" | 27 #include "chrome/browser/defaults.h" |
28 #include "chrome/browser/net/chrome_cookie_notification_details.h" | 28 #include "chrome/browser/net/chrome_cookie_notification_details.h" |
29 #include "chrome/browser/prefs/pref_service.h" | 29 #include "chrome/browser/prefs/pref_registry_syncable.h" |
| 30 #include "chrome/browser/prefs/pref_service_syncable.h" |
30 #include "chrome/browser/profiles/profile.h" | 31 #include "chrome/browser/profiles/profile.h" |
31 #include "chrome/browser/signin/signin_manager.h" | 32 #include "chrome/browser/signin/signin_manager.h" |
32 #include "chrome/browser/signin/signin_manager_factory.h" | 33 #include "chrome/browser/signin/signin_manager_factory.h" |
33 #include "chrome/browser/signin/token_service.h" | 34 #include "chrome/browser/signin/token_service.h" |
34 #include "chrome/browser/signin/token_service_factory.h" | 35 #include "chrome/browser/signin/token_service_factory.h" |
35 #include "chrome/browser/sync/backend_migrator.h" | 36 #include "chrome/browser/sync/backend_migrator.h" |
36 #include "chrome/browser/sync/glue/change_processor.h" | 37 #include "chrome/browser/sync/glue/change_processor.h" |
37 #include "chrome/browser/sync/glue/chrome_encryptor.h" | 38 #include "chrome/browser/sync/glue/chrome_encryptor.h" |
38 #include "chrome/browser/sync/glue/chrome_report_unrecoverable_error.h" | 39 #include "chrome/browser/sync/glue/chrome_report_unrecoverable_error.h" |
39 #include "chrome/browser/sync/glue/data_type_controller.h" | 40 #include "chrome/browser/sync/glue/data_type_controller.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 ProfileSyncService::ProfileSyncService(ProfileSyncComponentsFactory* factory, | 131 ProfileSyncService::ProfileSyncService(ProfileSyncComponentsFactory* factory, |
131 Profile* profile, | 132 Profile* profile, |
132 SigninManager* signin_manager, | 133 SigninManager* signin_manager, |
133 StartBehavior start_behavior) | 134 StartBehavior start_behavior) |
134 : last_auth_error_(AuthError::None()), | 135 : last_auth_error_(AuthError::None()), |
135 passphrase_required_reason_(syncer::REASON_PASSPHRASE_NOT_REQUIRED), | 136 passphrase_required_reason_(syncer::REASON_PASSPHRASE_NOT_REQUIRED), |
136 factory_(factory), | 137 factory_(factory), |
137 profile_(profile), | 138 profile_(profile), |
138 // |profile| may be NULL in unit tests. | 139 // |profile| may be NULL in unit tests. |
139 sync_prefs_(profile_ ? profile_->GetPrefs() : NULL), | 140 sync_prefs_(profile_ ? profile_->GetPrefs() : NULL), |
140 invalidator_storage_(profile_ ? profile_->GetPrefs(): NULL), | 141 invalidator_storage_( |
| 142 profile_ ? profile_->GetPrefs(): NULL, |
| 143 profile_ ? static_cast<PrefRegistrySyncable*>( |
| 144 profile_->GetPrefs()->DeprecatedGetPrefRegistry()) : NULL), |
141 sync_service_url_(kDevServerUrl), | 145 sync_service_url_(kDevServerUrl), |
142 is_first_time_sync_configure_(false), | 146 is_first_time_sync_configure_(false), |
143 backend_initialized_(false), | 147 backend_initialized_(false), |
144 is_auth_in_progress_(false), | 148 is_auth_in_progress_(false), |
145 signin_(signin_manager), | 149 signin_(signin_manager), |
146 unrecoverable_error_reason_(ERROR_REASON_UNSET), | 150 unrecoverable_error_reason_(ERROR_REASON_UNSET), |
147 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 151 weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
148 expect_sync_configuration_aborted_(false), | 152 expect_sync_configuration_aborted_(false), |
149 encrypted_types_(syncer::SyncEncryptionHandler::SensitiveTypes()), | 153 encrypted_types_(syncer::SyncEncryptionHandler::SensitiveTypes()), |
150 encrypt_everything_(false), | 154 encrypt_everything_(false), |
(...skipping 1808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1959 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. | 1963 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. |
1960 ProfileSyncService* old_this = this; | 1964 ProfileSyncService* old_this = this; |
1961 this->~ProfileSyncService(); | 1965 this->~ProfileSyncService(); |
1962 new(old_this) ProfileSyncService( | 1966 new(old_this) ProfileSyncService( |
1963 new ProfileSyncComponentsFactoryImpl(profile, | 1967 new ProfileSyncComponentsFactoryImpl(profile, |
1964 CommandLine::ForCurrentProcess()), | 1968 CommandLine::ForCurrentProcess()), |
1965 profile, | 1969 profile, |
1966 signin, | 1970 signin, |
1967 behavior); | 1971 behavior); |
1968 } | 1972 } |
OLD | NEW |