| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "chrome/browser/sync/glue/sync_backend_host.h" | 7 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/file_path.h" | 15 #include "base/file_path.h" |
| 16 #include "base/file_util.h" | 16 #include "base/file_util.h" |
| 17 #include "base/location.h" | 17 #include "base/location.h" |
| 18 #include "base/threading/sequenced_worker_pool.h" |
| 18 #include "base/threading/thread_restrictions.h" | 19 #include "base/threading/thread_restrictions.h" |
| 19 #include "base/timer.h" | 20 #include "base/timer.h" |
| 20 #include "base/utf_string_conversions.h" | 21 #include "base/utf_string_conversions.h" |
| 21 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
| 22 #include "chrome/browser/signin/token_service.h" | 23 #include "chrome/browser/signin/token_service.h" |
| 23 #include "chrome/browser/sync/glue/bridged_sync_notifier.h" | 24 #include "chrome/browser/sync/glue/bridged_sync_notifier.h" |
| 24 #include "chrome/browser/sync/glue/change_processor.h" | 25 #include "chrome/browser/sync/glue/change_processor.h" |
| 25 #include "chrome/browser/sync/glue/chrome_encryptor.h" | 26 #include "chrome/browser/sync/glue/chrome_encryptor.h" |
| 26 #include "chrome/browser/sync/glue/http_bridge.h" | 27 #include "chrome/browser/sync/glue/http_bridge.h" |
| 27 #include "chrome/browser/sync/glue/sync_backend_registrar.h" | 28 #include "chrome/browser/sync/glue/sync_backend_registrar.h" |
| (...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 DCHECK(registrar_); | 963 DCHECK(registrar_); |
| 963 | 964 |
| 964 sync_manager_.reset(new sync_api::SyncManager(name_)); | 965 sync_manager_.reset(new sync_api::SyncManager(name_)); |
| 965 sync_manager_->AddObserver(this); | 966 sync_manager_->AddObserver(this); |
| 966 success = sync_manager_->Init( | 967 success = sync_manager_->Init( |
| 967 sync_data_folder_path_, | 968 sync_data_folder_path_, |
| 968 options.event_handler, | 969 options.event_handler, |
| 969 options.service_url.host() + options.service_url.path(), | 970 options.service_url.host() + options.service_url.path(), |
| 970 options.service_url.EffectiveIntPort(), | 971 options.service_url.EffectiveIntPort(), |
| 971 options.service_url.SchemeIsSecure(), | 972 options.service_url.SchemeIsSecure(), |
| 973 BrowserThread::GetBlockingPool(), |
| 972 options.make_http_bridge_factory_fn.Run(), | 974 options.make_http_bridge_factory_fn.Run(), |
| 973 options.registrar /* as ModelSafeWorkerRegistrar */, | 975 options.registrar /* as ModelSafeWorkerRegistrar */, |
| 974 options.extensions_activity_monitor, | 976 options.extensions_activity_monitor, |
| 975 options.registrar /* as SyncManager::ChangeDelegate */, | 977 options.registrar /* as SyncManager::ChangeDelegate */, |
| 976 MakeUserAgentForSyncApi(), | 978 MakeUserAgentForSyncApi(), |
| 977 options.credentials, | 979 options.credentials, |
| 978 new BridgedSyncNotifier( | 980 new BridgedSyncNotifier( |
| 979 options.chrome_sync_notification_bridge, | 981 options.chrome_sync_notification_bridge, |
| 980 options.sync_notifier_factory->CreateSyncNotifier()), | 982 options.sync_notifier_factory->CreateSyncNotifier()), |
| 981 options.restored_key_for_bootstrapping, | 983 options.restored_key_for_bootstrapping, |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1312 FROM_HERE, | 1314 FROM_HERE, |
| 1313 base::Bind(&SyncBackendHost::Core::DoRefreshNigori, | 1315 base::Bind(&SyncBackendHost::Core::DoRefreshNigori, |
| 1314 core_.get(), sync_thread_done_callback)); | 1316 core_.get(), sync_thread_done_callback)); |
| 1315 } | 1317 } |
| 1316 | 1318 |
| 1317 #undef SDVLOG | 1319 #undef SDVLOG |
| 1318 | 1320 |
| 1319 #undef SLOG | 1321 #undef SLOG |
| 1320 | 1322 |
| 1321 } // namespace browser_sync | 1323 } // namespace browser_sync |
| OLD | NEW |