| 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 "components/browser_sync/browser/profile_sync_service.h" | 5 #include "components/browser_sync/browser/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cstddef> | 9 #include <cstddef> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 browser_sync::SyncStoppedReporter::ResultCallback())); | 287 browser_sync::SyncStoppedReporter::ResultCallback())); |
| 288 sessions_sync_manager_.reset(new SessionsSyncManager( | 288 sessions_sync_manager_.reset(new SessionsSyncManager( |
| 289 sync_client_->GetSyncSessionsClient(), &sync_prefs_, local_device_.get(), | 289 sync_client_->GetSyncSessionsClient(), &sync_prefs_, local_device_.get(), |
| 290 std::move(router), | 290 std::move(router), |
| 291 base::Bind(&ProfileSyncService::NotifyForeignSessionUpdated, | 291 base::Bind(&ProfileSyncService::NotifyForeignSessionUpdated, |
| 292 sync_enabled_weak_factory_.GetWeakPtr()), | 292 sync_enabled_weak_factory_.GetWeakPtr()), |
| 293 base::Bind(&ProfileSyncService::TriggerRefresh, | 293 base::Bind(&ProfileSyncService::TriggerRefresh, |
| 294 sync_enabled_weak_factory_.GetWeakPtr(), | 294 sync_enabled_weak_factory_.GetWeakPtr(), |
| 295 syncer::ModelTypeSet(syncer::SESSIONS)))); | 295 syncer::ModelTypeSet(syncer::SESSIONS)))); |
| 296 | 296 |
| 297 if (channel_ == version_info::Channel::UNKNOWN && | 297 if (base::FeatureList::IsEnabled(switches::kSyncUSSDeviceInfo)) { |
| 298 base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 299 switches::kSyncEnableUSSDeviceInfo)) { | |
| 300 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner( | 298 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner( |
| 301 blocking_pool_->GetSequencedTaskRunnerWithShutdownBehavior( | 299 blocking_pool_->GetSequencedTaskRunnerWithShutdownBehavior( |
| 302 blocking_pool_->GetSequenceToken(), | 300 blocking_pool_->GetSequenceToken(), |
| 303 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); | 301 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); |
| 304 // TODO(skym): Stop creating leveldb files when signed out. | 302 // TODO(skym): Stop creating leveldb files when signed out. |
| 305 // TODO(skym): Verify using AsUTF8Unsafe is okay here. Should work as long | 303 // TODO(skym): Verify using AsUTF8Unsafe is okay here. Should work as long |
| 306 // as the Local State file is guaranteed to be UTF-8. | 304 // as the Local State file is guaranteed to be UTF-8. |
| 307 device_info_service_.reset(new DeviceInfoService( | 305 device_info_service_.reset(new DeviceInfoService( |
| 308 local_device_.get(), | 306 local_device_.get(), |
| 309 base::Bind(&ModelTypeStore::CreateStore, syncer::DEVICE_INFO, | 307 base::Bind(&ModelTypeStore::CreateStore, syncer::DEVICE_INFO, |
| (...skipping 2221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2531 if (--outstanding_setup_in_progress_handles_ != 0) | 2529 if (--outstanding_setup_in_progress_handles_ != 0) |
| 2532 return; | 2530 return; |
| 2533 | 2531 |
| 2534 DCHECK(startup_controller_->IsSetupInProgress()); | 2532 DCHECK(startup_controller_->IsSetupInProgress()); |
| 2535 startup_controller_->SetSetupInProgress(false); | 2533 startup_controller_->SetSetupInProgress(false); |
| 2536 | 2534 |
| 2537 if (IsBackendInitialized()) | 2535 if (IsBackendInitialized()) |
| 2538 ReconfigureDatatypeManager(); | 2536 ReconfigureDatatypeManager(); |
| 2539 NotifyObservers(); | 2537 NotifyObservers(); |
| 2540 } | 2538 } |
| OLD | NEW |