| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 content::BrowserContext* context) const { | 145 content::BrowserContext* context) const { |
| 146 ProfileSyncService::InitParams init_params; | 146 ProfileSyncService::InitParams init_params; |
| 147 | 147 |
| 148 Profile* profile = Profile::FromBrowserContext(context); | 148 Profile* profile = Profile::FromBrowserContext(context); |
| 149 | 149 |
| 150 init_params.network_time_update_callback = base::Bind(&UpdateNetworkTime); | 150 init_params.network_time_update_callback = base::Bind(&UpdateNetworkTime); |
| 151 init_params.base_directory = profile->GetPath(); | 151 init_params.base_directory = profile->GetPath(); |
| 152 init_params.url_request_context = profile->GetRequestContext(); | 152 init_params.url_request_context = profile->GetRequestContext(); |
| 153 init_params.debug_identifier = profile->GetDebugName(); | 153 init_params.debug_identifier = profile->GetDebugName(); |
| 154 init_params.channel = chrome::GetChannel(); | 154 init_params.channel = chrome::GetChannel(); |
| 155 init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); | 155 base::SequencedWorkerPool* blocking_pool = |
| 156 content::BrowserThread::GetBlockingPool(); |
| 157 init_params.blocking_task_runner = |
| 158 blocking_pool->GetSequencedTaskRunnerWithShutdownBehavior( |
| 159 blocking_pool->GetSequenceToken(), |
| 160 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); |
| 156 | 161 |
| 157 bool local_sync_backend_enabled = false; | 162 bool local_sync_backend_enabled = false; |
| 158 | 163 |
| 159 // Since the local sync backend is currently only supported on Windows don't | 164 // Since the local sync backend is currently only supported on Windows don't |
| 160 // even check the pref on other os-es. | 165 // even check the pref on other os-es. |
| 161 #if defined(OS_WIN) | 166 #if defined(OS_WIN) |
| 162 syncer::SyncPrefs prefs(profile->GetPrefs()); | 167 syncer::SyncPrefs prefs(profile->GetPrefs()); |
| 163 local_sync_backend_enabled = prefs.IsLocalSyncEnabled(); | 168 local_sync_backend_enabled = prefs.IsLocalSyncEnabled(); |
| 164 if (local_sync_backend_enabled) { | 169 if (local_sync_backend_enabled) { |
| 165 // This code as it is now will assume the same profile order is present on | 170 // This code as it is now will assume the same profile order is present on |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 | 236 |
| 232 // static | 237 // static |
| 233 void ProfileSyncServiceFactory::SetSyncClientFactoryForTest( | 238 void ProfileSyncServiceFactory::SetSyncClientFactoryForTest( |
| 234 SyncClientFactory* client_factory) { | 239 SyncClientFactory* client_factory) { |
| 235 client_factory_ = client_factory; | 240 client_factory_ = client_factory; |
| 236 } | 241 } |
| 237 | 242 |
| 238 // static | 243 // static |
| 239 ProfileSyncServiceFactory::SyncClientFactory* | 244 ProfileSyncServiceFactory::SyncClientFactory* |
| 240 ProfileSyncServiceFactory::client_factory_ = nullptr; | 245 ProfileSyncServiceFactory::client_factory_ = nullptr; |
| OLD | NEW |