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_factory.h" | 5 #include "chrome/browser/sync/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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 content::BrowserContext* context) const { | 142 content::BrowserContext* context) const { |
143 ProfileSyncService::InitParams init_params; | 143 ProfileSyncService::InitParams init_params; |
144 | 144 |
145 Profile* profile = Profile::FromBrowserContext(context); | 145 Profile* profile = Profile::FromBrowserContext(context); |
146 | 146 |
147 init_params.network_time_update_callback = base::Bind(&UpdateNetworkTime); | 147 init_params.network_time_update_callback = base::Bind(&UpdateNetworkTime); |
148 init_params.base_directory = profile->GetPath(); | 148 init_params.base_directory = profile->GetPath(); |
149 init_params.url_request_context = profile->GetRequestContext(); | 149 init_params.url_request_context = profile->GetRequestContext(); |
150 init_params.debug_identifier = profile->GetDebugName(); | 150 init_params.debug_identifier = profile->GetDebugName(); |
151 init_params.channel = chrome::GetChannel(); | 151 init_params.channel = chrome::GetChannel(); |
152 base::SequencedWorkerPool* blocking_pool = | |
153 content::BrowserThread::GetBlockingPool(); | |
154 init_params.blocking_task_runner = | |
155 blocking_pool->GetSequencedTaskRunnerWithShutdownBehavior( | |
156 blocking_pool->GetSequenceToken(), | |
157 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); | |
158 | 152 |
159 if (!client_factory_) { | 153 if (!client_factory_) { |
160 init_params.sync_client = | 154 init_params.sync_client = |
161 base::MakeUnique<browser_sync::ChromeSyncClient>(profile); | 155 base::MakeUnique<browser_sync::ChromeSyncClient>(profile); |
162 } else { | 156 } else { |
163 init_params.sync_client = client_factory_->Run(profile); | 157 init_params.sync_client = client_factory_->Run(profile); |
164 } | 158 } |
165 | 159 |
166 bool local_sync_backend_enabled = false; | 160 bool local_sync_backend_enabled = false; |
167 // Since the local sync backend is currently only supported on Windows don't | 161 // Since the local sync backend is currently only supported on Windows don't |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 | 224 |
231 // static | 225 // static |
232 void ProfileSyncServiceFactory::SetSyncClientFactoryForTest( | 226 void ProfileSyncServiceFactory::SetSyncClientFactoryForTest( |
233 SyncClientFactory* client_factory) { | 227 SyncClientFactory* client_factory) { |
234 client_factory_ = client_factory; | 228 client_factory_ = client_factory; |
235 } | 229 } |
236 | 230 |
237 // static | 231 // static |
238 ProfileSyncServiceFactory::SyncClientFactory* | 232 ProfileSyncServiceFactory::SyncClientFactory* |
239 ProfileSyncServiceFactory::client_factory_ = nullptr; | 233 ProfileSyncServiceFactory::client_factory_ = nullptr; |
OLD | NEW |