| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.h" | 5 #include "ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 init_params.oauth2_token_service = | 135 init_params.oauth2_token_service = |
| 136 OAuth2TokenServiceFactory::GetForBrowserState(browser_state); | 136 OAuth2TokenServiceFactory::GetForBrowserState(browser_state); |
| 137 init_params.start_behavior = ProfileSyncService::MANUAL_START; | 137 init_params.start_behavior = ProfileSyncService::MANUAL_START; |
| 138 init_params.sync_client = | 138 init_params.sync_client = |
| 139 base::MakeUnique<IOSChromeSyncClient>(browser_state); | 139 base::MakeUnique<IOSChromeSyncClient>(browser_state); |
| 140 init_params.network_time_update_callback = base::Bind(&UpdateNetworkTime); | 140 init_params.network_time_update_callback = base::Bind(&UpdateNetworkTime); |
| 141 init_params.base_directory = browser_state->GetStatePath(); | 141 init_params.base_directory = browser_state->GetStatePath(); |
| 142 init_params.url_request_context = browser_state->GetRequestContext(); | 142 init_params.url_request_context = browser_state->GetRequestContext(); |
| 143 init_params.debug_identifier = browser_state->GetDebugName(); | 143 init_params.debug_identifier = browser_state->GetDebugName(); |
| 144 init_params.channel = ::GetChannel(); | 144 init_params.channel = ::GetChannel(); |
| 145 base::SequencedWorkerPool* blocking_pool = web::WebThread::GetBlockingPool(); | |
| 146 init_params.blocking_task_runner = | |
| 147 blocking_pool->GetSequencedTaskRunnerWithShutdownBehavior( | |
| 148 blocking_pool->GetSequenceToken(), | |
| 149 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); | |
| 150 | 145 |
| 151 auto pss = base::MakeUnique<ProfileSyncService>(std::move(init_params)); | 146 auto pss = base::MakeUnique<ProfileSyncService>(std::move(init_params)); |
| 152 | 147 |
| 153 // Will also initialize the sync client. | 148 // Will also initialize the sync client. |
| 154 pss->Initialize(); | 149 pss->Initialize(); |
| 155 return std::move(pss); | 150 return std::move(pss); |
| 156 } | 151 } |
| OLD | NEW |